aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2014-03-25 22:02:54 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2014-03-25 22:02:54 +0100
commitfc189a2e69c7468c12621b7d4a3c94343d1a672c (patch)
tree89d9e08195bf3c708115ded47a8e588c6e4acbb0
parent242a22849402a13e585fada9d055a85f1c6d1ee8 (diff)
parent1b47a1e5f5787a3d1681cdee8b8bc1ec7a5cd9c9 (diff)
downloadmoa-id-spss-fc189a2e69c7468c12621b7d4a3c94343d1a672c.tar.gz
moa-id-spss-fc189a2e69c7468c12621b7d4a3c94343d1a672c.tar.bz2
moa-id-spss-fc189a2e69c7468c12621b7d4a3c94343d1a672c.zip
merge
-rw-r--r--NOTICE.txt6
-rw-r--r--common/pom.xml234
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/logging/Logger.java67
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/Constants.java5
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java3
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java28
-rw-r--r--id/ConfigWebTool/ConfigurationInterface.iml193
-rw-r--r--id/ConfigWebTool/pom.xml20
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java21
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java10
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java3
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java23
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java75
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java14
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java58
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java52
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java4
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/StringHelper.java12
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java109
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java2618
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java20
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java43
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java21
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java30
-rw-r--r--id/ConfigWebTool/src/main/resources/applicationResources.properties29
-rw-r--r--id/ConfigWebTool/src/main/resources/applicationResources_en.properties459
-rw-r--r--id/ConfigWebTool/src/main/webapp/css/index.css11
-rw-r--r--id/ConfigWebTool/src/main/webapp/js/common.js57
-rw-r--r--id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp9
-rw-r--r--id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp89
-rw-r--r--id/assembly-auth.xml22
-rw-r--r--id/assembly-proxy.xml8
-rw-r--r--id/history.txt24
-rw-r--r--id/oa/pom.xml27
-rw-r--r--id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/Configuration.java7
-rw-r--r--id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/Authenticate.java5
-rw-r--r--id/pom.xml41
-rw-r--r--id/server/auth/moa-id-auth.iml166
-rw-r--r--id/server/auth/pom.xml11
-rw-r--r--id/server/auth/src/main/webapp/BKAuswahl-MOA-Template-Howto.pdfbin193669 -> 0 bytes
-rw-r--r--id/server/auth/src/main/webapp/Blockdiagramm.pngbin0 -> 84989 bytes
-rw-r--r--id/server/auth/src/main/webapp/WEB-INF/urlrewrite.xml32
-rw-r--r--id/server/auth/src/main/webapp/anmeldeablauf.pngbin0 -> 51580 bytes
-rw-r--r--id/server/auth/src/main/webapp/common/LogoBKA.png (renamed from id/server/doc/moa_id/common/LogoBKA.png)bin8062 -> 8062 bytes
-rw-r--r--id/server/auth/src/main/webapp/common/LogoEGIZ.png (renamed from id/server/doc/moa_id/common/LogoEGIZ.png)bin77395 -> 77395 bytes
-rw-r--r--id/server/auth/src/main/webapp/common/MOA.css (renamed from id/server/doc/moa_id/common/MOA.css)1
-rw-r--r--id/server/auth/src/main/webapp/css/index.css451
-rw-r--r--id/server/auth/src/main/webapp/iframeHandyBKU.html58
-rw-r--r--id/server/auth/src/main/webapp/iframeOnlineBKU.html67
-rw-r--r--id/server/auth/src/main/webapp/index.html116
-rw-r--r--id/server/auth/src/main/webapp/message-auth.jsp20
-rw-r--r--id/server/data/deploy/conf/moa-id-configuration/htmlTemplates/loginFormFull.html12
-rw-r--r--id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html12
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/SamlEngine.xml51
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/SignModule_incoming.xml12
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/SignModule_incoming_attr.xml12
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_VIDP.xml93
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming.xml93
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming_attr.xml93
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jksbin0 -> 3013 bytes
-rw-r--r--id/server/data/deploy/conf/moa-id/stork/storkDemoKeys_minividp_old.jks (renamed from id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks)bin4592 -> 4592 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cerbin0 -> 1485 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cerbin0 -> 979 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/a-sign-SSL-03.cerbin0 -> 1147 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/atrust_OCSP_Responder_03-1.crtbin0 -> 1185 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cerbin0 -> 1485 bytes
-rw-r--r--id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cerbin0 -> 1485 bytes
-rw-r--r--id/server/doc/MOA-ID PreRelease-1.9.98.pdfbin481774 -> 0 bytes
-rw-r--r--id/server/doc/handbook/additional/additional.html199
-rw-r--r--id/server/doc/handbook/application/application.html212
-rw-r--r--id/server/doc/handbook/application/iframe.pngbin0 -> 86175 bytes
-rw-r--r--id/server/doc/handbook/application/login_button.PNGbin0 -> 70066 bytes
-rw-r--r--id/server/doc/handbook/application/mainframe.PNGbin0 -> 59073 bytes
-rw-r--r--id/server/doc/handbook/application/sso_sendassertion.PNGbin0 -> 6041 bytes
-rw-r--r--id/server/doc/handbook/config/config.html229
-rw-r--r--id/server/doc/handbook/faq/faq.html125
-rw-r--r--id/server/doc/handbook/index.html11
-rw-r--r--id/server/doc/handbook/install/install.html22
-rw-r--r--id/server/doc/handbook/intro/anmeldeablauf.pngbin51570 -> 51580 bytes
-rw-r--r--id/server/doc/handbook/intro/intro.html28
-rw-r--r--id/server/doc/handbook/protocol/Assertion.xml14
-rw-r--r--id/server/doc/handbook/protocol/AuthRequest.xml8
-rw-r--r--id/server/doc/handbook/protocol/idp_metadata.xml45
-rw-r--r--id/server/doc/handbook/protocol/protocol.html582
-rw-r--r--id/server/doc/handbook/protocol/pvp21_sequence.pngbin0 -> 38601 bytes
-rw-r--r--id/server/doc/handbook/protocol/saml1_sequence.pngbin0 -> 32752 bytes
-rw-r--r--id/server/doc/handbook/protocol/sso_sequence.pngbin0 -> 56152 bytes
-rw-r--r--id/server/doc/handbook/spec/MOA ID 1.x.wsdl (renamed from id/server/doc/old/MOA ID 1.x.wsdl)82
-rw-r--r--id/server/doc/handbook/spec/MOA_ID_1.2_20040315.pdf (renamed from id/server/doc/old/MOA_ID_1.2_20040315.pdf)bin577309 -> 577309 bytes
-rw-r--r--id/server/doc/handbook/spec/MOA_ID_1.3_20060315.pdf (renamed from id/server/doc/old/MOA_ID_1.3_20060315.pdf)bin355156 -> 355156 bytes
-rw-r--r--id/server/doc/handbook/spec/MOA_ID_1.4_20070802.pdf (renamed from id/server/doc/old/MOA_ID_1.4_20070802.pdf)bin239502 -> 239502 bytes
-rw-r--r--id/server/doc/handbook/spec/MOA_ID_1.4_Anhang.pdf (renamed from id/server/doc/old/MOA_ID_1.4_Anhang.pdf)bin286834 -> 286834 bytes
-rw-r--r--id/server/doc/handbook/spec/MOA_ID_1.5_Anhang.pdf (renamed from id/server/doc/old/MOA_ID_1.5_Anhang.pdf)bin134176 -> 134176 bytes
-rw-r--r--id/server/doc/handbook/spec/OID-1-0-3.pdf (renamed from id/server/doc/old/OID-1-0-3.pdf)bin347041 -> 347041 bytes
-rw-r--r--id/server/doc/handbook/spec/cs-sstc-schema-assertion-01.xsd (renamed from id/server/doc/old/cs-sstc-schema-assertion-01.xsd)388
-rw-r--r--id/server/doc/handbook/spec/cs-sstc-schema-protocol-01.xsd (renamed from id/server/doc/old/cs-sstc-schema-protocol-01.xsd)254
-rw-r--r--id/server/doc/htmlTemplates/BKU-selection.html12
-rw-r--r--id/server/doc/moa_id/examples/BKUSelectionTemplate.html41
-rw-r--r--id/server/doc/moa_id/examples/ChainingModes.txt6
-rw-r--r--id/server/doc/moa_id/examples/IdentityLinkSigners.txt9
-rw-r--r--id/server/doc/moa_id/examples/LoginServletExample.txt171
-rw-r--r--id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml149
-rw-r--r--id/server/doc/moa_id/examples/Template.html50
-rw-r--r--id/server/doc/moa_id/examples/TransformsInfoAuthBlockTable_DE.xml161
-rw-r--r--id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml118
-rw-r--r--id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml9
-rw-r--r--id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml10
-rw-r--r--id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml10
-rw-r--r--id/server/doc/moa_id/examples/moa-id-env.sh.txt15
-rw-r--r--id/server/doc/moa_id/examples/startTomcat.bat.txt26
-rw-r--r--id/server/doc/moa_id/faqs.htm147
-rw-r--r--id/server/doc/moa_id/id-admin.htm33
-rw-r--r--id/server/doc/moa_id/id-admin_0.htm175
-rw-r--r--id/server/doc/moa_id/id-admin_1.htm393
-rw-r--r--id/server/doc/moa_id/id-admin_2.htm1156
-rw-r--r--id/server/doc/moa_id/id-admin_3.htm108
-rw-r--r--id/server/doc/moa_id/id-anwendung.htm35
-rw-r--r--id/server/doc/moa_id/id-anwendung_0.htm35
-rw-r--r--id/server/doc/moa_id/id-anwendung_1.htm141
-rw-r--r--id/server/doc/moa_id/id-anwendung_2.htm176
-rw-r--r--id/server/doc/moa_id/intro.htm182
-rw-r--r--id/server/doc/moa_id/links.htm64
-rw-r--r--id/server/doc/moa_id/moa-id-ablauf.jpgbin15550 -> 0 bytes
-rw-r--r--id/server/doc/moa_id/moa.htm34
-rw-r--r--id/server/doc/moa_images/east.gifbin966 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/idle.gifbin869 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/moa_diagramm1.jpgbin60602 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/moa_thema.gifbin25120 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/north.gifbin967 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/pfeil.gifbin843 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/print.gifbin211 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/select.gifbin880 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/south.gifbin965 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/transdot.gifbin43 -> 0 bytes
-rw-r--r--id/server/doc/moa_images/west.gifbin966 -> 0 bytes
-rw-r--r--id/server/doc/old/Architektur ID.vsdbin318464 -> 0 bytes
-rw-r--r--id/server/doc/old/MOA-ID Feinspezifikation.docbin268288 -> 0 bytes
-rw-r--r--id/server/doc/old/MOA-Testzertifikate.pdfbin33476 -> 0 bytes
-rw-r--r--id/server/doc/old/MOA-Testzertifikate.vsdbin316416 -> 0 bytes
-rw-r--r--id/server/doc/old/bku-auswahl.20030408.pdfbin131587 -> 0 bytes
-rw-r--r--id/server/doc/old/moa-id.htm7
-rw-r--r--id/server/idserverlib/moa-id-lib.iml170
-rw-r--r--id/server/idserverlib/pom.xml93
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java3605
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java201
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilderForeign.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java23
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java199
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/RedirectFormBuilder.java6
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java17
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java19
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java12
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java75
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java43
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java19
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java7
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java48
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java22
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java20
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java32
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java10
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java36
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java47
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java31
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java134
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java188
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/ModulStorage.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java81
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/opemsaml/MOAKeyStoreX509CredentialAdapter.java52
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/AuthenticationAction.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java8
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java62
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java1
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/ArtifactBinding.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/IEncoder.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/MOARequest.java79
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java27
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java7
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/SoapBinding.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java265
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/EIDSTORKTOKEN.java28
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/MOADefaultSecurityConfigurationBootstrap.java23
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/AuthnRequestValidatorException.java62
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/NameIDFormatNotSupportedException.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/ArtifactResolution.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java56
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java14
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/validation/AuthnRequestValidator.java58
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java11
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java24
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java237
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java56
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java73
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java201
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java208
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DataContainer.java78
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java222
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java29
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java104
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java213
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java117
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java125
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java28
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java126
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java129
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java162
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/UnsupportedAttributeException.java7
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java24
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/VelocityProvider.java (renamed from id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/VelocityProvider.java)4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java19
-rw-r--r--id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties9
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html12
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/oasis_dss_webform_binding.vm36
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/redirectForm.html2
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/stork2_consent.html444
-rw-r--r--id/server/idserverlib/src/main/resources/resources/templates/stork2_postbinding_template.html42
-rw-r--r--id/server/legacy-backup/mw-messages-api/.classpath (renamed from id/templates/.classpath)2
-rw-r--r--id/server/legacy-backup/mw-messages-api/.gitignore1
-rw-r--r--id/server/legacy-backup/mw-messages-api/.project36
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.core.resources.prefs5
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.component6
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.project.facet.core.xml5
-rw-r--r--id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.validation.prefs2
-rw-r--r--id/server/legacy-backup/mw-messages-api/mw-messages-api.iml17
-rw-r--r--id/server/legacy-backup/mw-messages-api/nb-configuration.xml18
-rw-r--r--id/server/legacy-backup/mw-messages-api/pom.xml65
-rw-r--r--id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/GetAuthDataRequest.java52
-rw-r--r--id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/StartAuthResponse.java129
-rw-r--r--id/server/legacy-backup/mw-messages-api/src/test/java/eu/stork/mw/core/mwmessagesapi/AppTest.java38
-rw-r--r--id/server/legacy-backup/stork-saml-engine/pom.xml92
-rw-r--r--id/server/legacy-backup/stork-saml-engine/stork-saml-engine.iml37
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKAuthnRequest.classbin0 -> 1041 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKResponse.classbin0 -> 230 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/builder/STORKMessagesBuilder.classbin0 -> 36593 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKBootstrap.classbin0 -> 1235 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKConstants.classbin0 -> 5010 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLException.classbin0 -> 765 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLValidationException.classbin0 -> 925 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttribute.classbin0 -> 941 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttributeValue.classbin0 -> 631 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKExtensions.classbin0 -> 744 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKRequestedAttribute.classbin0 -> 647 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.classbin0 -> 1582 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.classbin0 -> 847 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.classbin0 -> 1165 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.classbin0 -> 1144 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.classbin0 -> 1604 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.classbin0 -> 3161 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.classbin0 -> 836 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.classbin0 -> 5482 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.classbin0 -> 1592 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.classbin0 -> 1822 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.classbin0 -> 401 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.classbin0 -> 1734 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.classbin0 -> 1490 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.classbin0 -> 1187 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.classbin0 -> 1445 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.classbin0 -> 1564 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.classbin0 -> 946 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.classbin0 -> 811 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.classbin0 -> 1269 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/AuthenticationAttributes.classbin0 -> 992 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/CitizenCountryCode.classbin0 -> 728 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossBorderShare.classbin0 -> 697 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossSectorShare.classbin0 -> 697 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDSectorShare.classbin0 -> 682 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.classbin0 -> 745 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/RequestedAttributes.classbin0 -> 1039 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPAuthRequest.classbin0 -> 663 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertEnc.classbin0 -> 608 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertSig.classbin0 -> 608 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertType.classbin0 -> 722 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPID.classbin0 -> 686 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPInformation.classbin0 -> 1279 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpApplication.classbin0 -> 713 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpCountry.classbin0 -> 701 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpInstitution.classbin0 -> 713 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpSector.classbin0 -> 698 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.classbin0 -> 1121 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.classbin0 -> 1384 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.classbin0 -> 1682 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.classbin0 -> 422 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.classbin0 -> 1131 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.classbin0 -> 1336 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.classbin0 -> 1084 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.classbin0 -> 1010 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.classbin0 -> 832 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.classbin0 -> 1344 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.classbin0 -> 1045 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.classbin0 -> 1068 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.classbin0 -> 895 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.classbin0 -> 1344 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.classbin0 -> 1045 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.classbin0 -> 1068 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.classbin0 -> 895 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.classbin0 -> 1304 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.classbin0 -> 1025 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.classbin0 -> 1042 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.classbin0 -> 869 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.classbin0 -> 1472 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.classbin0 -> 1120 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.classbin0 -> 1148 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.classbin0 -> 971 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.classbin0 -> 1348 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.classbin0 -> 1923 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.classbin0 -> 407 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.classbin0 -> 1111 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.classbin0 -> 1296 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.classbin0 -> 1531 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.classbin0 -> 811 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.classbin0 -> 1827 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.classbin0 -> 1264 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.classbin0 -> 574 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.classbin0 -> 388 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.classbin0 -> 396 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.classbin0 -> 1264 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.classbin0 -> 574 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.classbin0 -> 388 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.classbin0 -> 396 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.classbin0 -> 1498 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.classbin0 -> 380 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.classbin0 -> 994 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDBuilder.classbin0 -> 1224 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDImpl.classbin0 -> 1014 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.classbin0 -> 941 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.classbin0 -> 763 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.classbin0 -> 1296 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationImpl.classbin0 -> 2590 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.classbin0 -> 389 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.classbin0 -> 1445 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.classbin0 -> 1296 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.classbin0 -> 1059 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.classbin0 -> 995 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.classbin0 -> 812 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.classbin0 -> 1264 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryImpl.classbin0 -> 1039 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.classbin0 -> 971 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.classbin0 -> 793 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.classbin0 -> 1296 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.classbin0 -> 1059 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.classbin0 -> 995 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.classbin0 -> 817 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.classbin0 -> 1256 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorImpl.classbin0 -> 1034 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.classbin0 -> 965 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.classbin0 -> 787 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.classbin0 -> 1416 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.classbin0 -> 2022 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.classbin0 -> 434 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.classbin0 -> 1277 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/SAMLUtil.classbin0 -> 13113 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/XMLUtil.classbin0 -> 4145 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAssertionValidator.classbin0 -> 2013 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAttributeValidator.classbin0 -> 5122 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.classbin0 -> 1153 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.classbin0 -> 1565 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.classbin0 -> 3261 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.classbin0 -> 1215 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.classbin0 -> 1679 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkConditionsValidator.classbin0 -> 1438 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.classbin0 -> 1037 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.classbin0 -> 1233 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.classbin0 -> 1182 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkExtensionsValidator.classbin0 -> 1543 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkIssuerValidator.classbin0 -> 1225 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIDValidator.classbin0 -> 1465 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.classbin0 -> 1237 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.classbin0 -> 1411 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.classbin0 -> 2573 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.classbin0 -> 1063 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkResponseValidator.classbin0 -> 3710 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPIDValidator.classbin0 -> 1563 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPInformationValidator.classbin0 -> 1188 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.classbin0 -> 1601 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpCountryValidator.classbin0 -> 1549 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.classbin0 -> 1601 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpSectorValidator.classbin0 -> 1556 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.classbin0 -> 3514 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusValidator.classbin0 -> 1029 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.classbin0 -> 3017 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.classbin0 -> 1172 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectValidator.classbin0 -> 1309 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.classbin0 -> 1474 bytes
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/saml2-post-binding-moa.vm38
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/classes/saml2-stork-config.xml242
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/maven-archiver/pom.properties5
-rw-r--r--id/server/legacy-backup/stork-saml-engine/target/stork-saml-engine-1.5.2.jarbin0 -> 145742 bytes
-rw-r--r--id/server/legacy-backup/stork2-commons/.svn/all-wcprops17
-rw-r--r--id/server/legacy-backup/stork2-commons/.svn/dir-prop-base10
-rw-r--r--id/server/legacy-backup/stork2-commons/.svn/entries99
-rw-r--r--id/server/legacy-backup/stork2-commons/.svn/text-base/Releases.svn-base62
-rw-r--r--id/server/legacy-backup/stork2-commons/.svn/text-base/pom.xml.svn-base (renamed from repository/eu/stork/Commons/1.2.0/Commons-1.2.0.pom)9
-rw-r--r--id/server/legacy-backup/stork2-commons/Releases62
-rw-r--r--id/server/legacy-backup/stork2-commons/pom.xml213
-rw-r--r--id/server/legacy-backup/stork2-commons/src/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/.svn/entries34
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/.svn/entries37
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/all-wcprops11
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/entries62
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base267
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/config/embedded/pepsUtil.properties267
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries34
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops191
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries1085
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base72
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base74
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base80
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base96
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base188
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base231
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base123
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base95
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base79
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base169
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base148
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base82
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base194
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base239
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base85
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base316
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base392
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base619
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base353
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base329
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base348
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base396
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base447
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base388
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base495
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base383
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base197
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base250
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base68
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base71
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base9
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java72
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java74
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java80
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java96
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java188
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java231
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java123
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java95
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java79
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java169
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java148
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java82
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java194
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java239
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java85
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java316
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java392
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java619
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java353
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java329
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java348
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java397
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java447
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java392
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java495
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java395
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java197
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java250
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java68
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java71
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops53
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries300
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base173
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base143
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base74
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base54
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base46
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base67
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base53
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base7
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java173
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java143
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java74
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java54
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java46
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java67
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java53
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java7
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java9
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops41
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries232
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base215
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base37
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base40
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base35
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base100
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base8
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java215
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java37
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java40
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java35
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java100
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java8
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/resources/.svn/all-wcprops11
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/resources/.svn/entries62
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base19
-rw-r--r--id/server/legacy-backup/stork2-commons/src/main/resources/log4j.xml19
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/.svn/entries34
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/entries31
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops53
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries300
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base134
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base88
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base537
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base294
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base553
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base747
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base182
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java134
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java88
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java537
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java294
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java553
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java747
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java182
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java5
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/resources/.svn/all-wcprops11
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/resources/.svn/entries62
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base19
-rw-r--r--id/server/legacy-backup/stork2-commons/src/test/resources/log4j.xml19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/Releases (renamed from id/server/stork2-saml-engine/Releases)0
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/SamlEngine.iml46
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/find.save0
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/pom.xml202
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml (renamed from id/server/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml)0
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/quartz.properties (renamed from id/server/stork2-saml-engine/src/main/config/embedded/quartz.properties)8
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/context.xml (renamed from id/server/stork2-saml-engine/src/main/config/jBoss/context.xml)0
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml (renamed from id/server/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml)0
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF (renamed from id/templates/src/main/webapp/META-INF/MANIFEST.MF)6
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java421
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java885
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java3705
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java69
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java57
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java51
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java176
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java58
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java57
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java63
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java140
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java51
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java98
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java88
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java508
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java72
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java109
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java30
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java54
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.java50
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java82
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.java45
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java26
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java63
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java50
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java114
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java87
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java47
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java43
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java89
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java46
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java47
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java51
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java85
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java46
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java47
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java84
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.java45
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java54
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java220
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java89
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java96
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java54
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java95
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java33
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.java51
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java84
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.java46
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.java42
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java82
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.java45
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.java42
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.java50
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java82
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.java45
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java110
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.java33
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java52
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.java51
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java84
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.java46
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.java50
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java84
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.java45
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.java42
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java468
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java64
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java556
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java538
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.java41
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java132
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.java33
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java55
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java57
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java61
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java65
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java136
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java69
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java233
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java74
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java70
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java57
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineException.java135
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java56
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java19
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SamlEngine.xml21
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_P11.xml11
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml)22
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml91
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml91
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml64
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml61
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml)184
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml16
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml15
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml15
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml26
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml14
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml14
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks (renamed from id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks)bin1376 -> 1376 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks (renamed from id/server/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks)bin1313 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks (renamed from id/server/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks)bin1313 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks (renamed from id/server/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks)bin1313 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/logback-test.xml23
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/p11Conf.cfg24
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/src/test/resources/storkDemoKeys.jksbin0 -> 4592 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0-sources.jarbin0 -> 152119 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0.jarbin0 -> 152651 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngine.classbin0 -> 11597 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngineUtils.classbin0 -> 19412 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/STORKSAMLEngine.classbin0 -> 71474 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/X509PrincipalUtil.classbin0 -> 1990 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/AuthenticationAttributes.classbin0 -> 1108 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CitizenCountryCode.classbin0 -> 955 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomAttributeQuery.classbin0 -> 1100 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.classbin0 -> 2341 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.classbin0 -> 961 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.classbin0 -> 962 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDSectorShare.classbin0 -> 907 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/QAAAttribute.classbin0 -> 1033 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttribute.classbin0 -> 1728 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttributes.classbin0 -> 1010 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLCore.classbin0 -> 2649 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLEngineSignI.classbin0 -> 564 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPApplication.classbin0 -> 923 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPCountry.classbin0 -> 899 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPID.classbin0 -> 871 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInformation.classbin0 -> 968 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInstitution.classbin0 -> 923 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPSector.classbin0 -> 893 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/STORKSAMLCore.classbin0 -> 7839 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.classbin0 -> 1241 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.classbin0 -> 1624 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.classbin0 -> 2512 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.classbin0 -> 436 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.classbin0 -> 1116 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.classbin0 -> 1576 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.classbin0 -> 1659 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.classbin0 -> 1057 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.classbin0 -> 879 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.classbin0 -> 1484 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.classbin0 -> 1938 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.classbin0 -> 1992 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.classbin0 -> 4815 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.classbin0 -> 1584 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.classbin0 -> 1667 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.classbin0 -> 1061 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.classbin0 -> 883 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.classbin0 -> 1593 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.classbin0 -> 1667 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.classbin0 -> 1061 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.classbin0 -> 879 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.classbin0 -> 1544 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.classbin0 -> 1627 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.classbin0 -> 1026 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.classbin0 -> 844 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.classbin0 -> 1528 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.classbin0 -> 1595 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.classbin0 -> 1011 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.classbin0 -> 829 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.classbin0 -> 1576 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.classbin0 -> 3478 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.classbin0 -> 2750 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.classbin0 -> 2599 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.classbin0 -> 1584 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.classbin0 -> 2217 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.classbin0 -> 425 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.classbin0 -> 1083 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.classbin0 -> 1536 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.classbin0 -> 1619 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.classbin0 -> 1022 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.classbin0 -> 844 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.classbin0 -> 1504 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.classbin0 -> 1587 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.classbin0 -> 994 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.classbin0 -> 816 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.classbin0 -> 1464 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDImpl.classbin0 -> 1547 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.classbin0 -> 959 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.classbin0 -> 781 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.classbin0 -> 1569 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.classbin0 -> 2304 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.classbin0 -> 407 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.classbin0 -> 989 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.classbin0 -> 1536 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.classbin0 -> 1619 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.classbin0 -> 1022 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.classbin0 -> 844 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.classbin0 -> 1496 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.classbin0 -> 1272 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.classbin0 -> 987 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.classbin0 -> 809 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignHW.classbin0 -> 13842 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.classbin0 -> 1319 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignP12.classbin0 -> 15801 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignSW.classbin0 -> 15105 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.classbin0 -> 1689 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.classbin0 -> 2930 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.classbin0 -> 452 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.classbin0 -> 1274 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.classbin0 -> 1890 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.classbin0 -> 1949 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.classbin0 -> 1612 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationCreator.classbin0 -> 4511 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationEngine.classbin0 -> 1125 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationReader.classbin0 -> 5829 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationSingleton.classbin0 -> 1934 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/InstanceEngine.classbin0 -> 1212 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/SAMLEngineException.classbin0 -> 833 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineException.classbin0 -> 1864 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.classbin0 -> 884 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/maven-archiver/pom.properties5
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SamlEngine.xml21
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf0.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf1.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf2.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf3.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_P11.xml11
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_outgoing.xml12
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf0.xml91
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf1.xml91
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf2.xml64
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf3.xml61
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_outgoing.xml93
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml16
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml15
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml15
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml26
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml14
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml14
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry0.jksbin0 -> 1376 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry1.jksbin0 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry2.jksbin0 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry3.jksbin0 -> 1313 bytes
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/logback-test.xml23
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/p11Conf.cfg24
-rw-r--r--id/server/legacy-backup/stork2-saml-engine/target/test-classes/storkDemoKeys.jksbin0 -> 4592 bytes
-rw-r--r--id/server/moa-id-commons/moa-id-commons.iml107
-rw-r--r--id/server/moa-id-commons/pom.xml16
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java706
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/bindings.xjb6
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd18
-rw-r--r--id/server/moa-id.iml14
-rw-r--r--id/server/pom.xml3
-rw-r--r--id/server/proxy/moa-id-proxy.iml163
-rw-r--r--id/server/proxy/pom.xml3
-rw-r--r--id/server/stork2-commons/.svn/all-wcprops17
-rw-r--r--id/server/stork2-commons/.svn/dir-prop-base10
-rw-r--r--id/server/stork2-commons/.svn/entries99
-rw-r--r--id/server/stork2-commons/.svn/text-base/Releases.svn-base73
-rw-r--r--id/server/stork2-commons/.svn/text-base/pom.xml.svn-base213
-rw-r--r--id/server/stork2-commons/Releases73
-rw-r--r--id/server/stork2-commons/pom.xml213
-rw-r--r--id/server/stork2-commons/src/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/.svn/entries34
-rw-r--r--id/server/stork2-commons/src/main/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/.svn/entries37
-rw-r--r--id/server/stork2-commons/src/main/config/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/config/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/main/config/embedded/.svn/all-wcprops11
-rw-r--r--id/server/stork2-commons/src/main/config/embedded/.svn/entries62
-rw-r--r--id/server/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base269
-rw-r--r--id/server/stork2-commons/src/main/config/embedded/pepsUtil.properties269
-rw-r--r--id/server/stork2-commons/src/main/java/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/main/java/eu/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/eu/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/entries34
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries34
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops191
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries1085
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base72
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base74
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base123
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base96
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base188
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base231
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base123
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base95
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base79
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base169
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base148
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base82
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base194
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base239
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base85
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base316
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base392
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base625
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base391
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base342
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base348
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base396
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base447
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base388
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base495
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base383
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base197
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base250
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base68
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base71
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base9
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java72
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java74
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java123
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java96
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java188
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java231
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java123
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java95
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java79
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java169
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java148
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java82
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java194
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java239
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java85
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java316
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java392
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java625
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java391
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java342
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java348
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java397
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java447
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java392
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java495
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java387
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java197
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java250
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java68
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java71
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops53
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries300
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base173
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base143
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base74
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base54
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base46
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base67
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base53
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base7
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java173
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java143
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java74
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java54
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java46
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java67
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java53
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java7
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java9
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops41
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries232
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base215
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base37
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base40
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base35
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base100
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base8
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java215
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java37
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java40
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java35
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java100
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java8
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/all-wcprops125
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/entries708
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AcTitleType.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AttributeStatusType.java.svn-base61
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/CanonicalAddressType.java.svn-base264
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/Habilitation.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HabilitationType.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasAccountInBankType.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasDegreeType.java.svn-base174
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAcademicStaffType.java.svn-base145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAdminStaffType.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsCourseCoordinatorType.java.svn-base89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHCPType.java.svn-base145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHealthCareProfessionalType.java.svn-base145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsStudentType.java.svn-base146
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsTeacherOfType.java.svn-base145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateContentType.java.svn-base233
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateType.java.svn-base125
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/ObjectFactory.java.svn-base433
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RepresentationPersonType.java.svn-base289
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RequestedAttributeType.java.svn-base212
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/package-info.java.svn-base9
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AcTitleType.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AttributeStatusType.java61
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/CanonicalAddressType.java264
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/Habilitation.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HabilitationType.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasAccountInBankType.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasDegreeType.java174
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAcademicStaffType.java145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAdminStaffType.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsCourseCoordinatorType.java89
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHCPType.java145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHealthCareProfessionalType.java145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsStudentType.java146
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsTeacherOfType.java145
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateContentType.java233
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateType.java125
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/ObjectFactory.java433
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RepresentationPersonType.java289
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RequestedAttributeType.java212
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/package-info.java9
-rw-r--r--id/server/stork2-commons/src/main/resources/.svn/all-wcprops17
-rw-r--r--id/server/stork2-commons/src/main/resources/.svn/entries96
-rw-r--r--id/server/stork2-commons/src/main/resources/.svn/text-base/StorkcomplexAttributes.xsd.svn-base305
-rw-r--r--id/server/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base19
-rw-r--r--id/server/stork2-commons/src/main/resources/StorkcomplexAttributes.xsd305
-rw-r--r--id/server/stork2-commons/src/main/resources/log4j.xml19
-rw-r--r--id/server/stork2-commons/src/test/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/test/.svn/entries34
-rw-r--r--id/server/stork2-commons/src/test/java/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/test/java/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/test/java/eu/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/test/java/eu/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops5
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/entries31
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops59
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries334
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base134
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base88
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base537
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/ComplexAttributesMarshalling.java.svn-base187
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base294
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base553
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base747
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base182
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base5
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java134
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java88
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java537
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/ComplexAttributesMarshalling.java187
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java294
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java553
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java747
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java182
-rw-r--r--id/server/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java5
-rw-r--r--id/server/stork2-commons/src/test/resources/.svn/all-wcprops11
-rw-r--r--id/server/stork2-commons/src/test/resources/.svn/entries62
-rw-r--r--id/server/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base19
-rw-r--r--id/server/stork2-commons/src/test/resources/log4j.xml19
-rw-r--r--id/server/stork2-saml-engine/pom.xml130
-rw-r--r--id/server/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF6
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java836
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java1718
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java7449
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java138
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java114
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java102
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java352
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java116
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java114
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java126
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java280
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java102
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java196
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java176
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java1016
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java144
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java112
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java218
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java57
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java108
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java164
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java52
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java130
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java100
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java228
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java102
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java172
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java94
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java86
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java102
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java176
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java92
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java94
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java100
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java168
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java92
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java94
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java168
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java108
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java440
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java178
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java192
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java108
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java190
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java66
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java104
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java168
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java164
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java164
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java220
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java104
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java168
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java168
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java936
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java128
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java1121
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java1065
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java264
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java110
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java36
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java36
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java126
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java122
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/MultipleAssertionResponseValidator.java80
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java130
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java36
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java36
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java276
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java138
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java467
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java146
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java140
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java38
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java114
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java110
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java36
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SSETestUtils.java173
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SimpleBaseTest.java64
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryRequestTest.java864
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryResponseTest.java1085
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAuthRequestTest.java968
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutRequestTest.java89
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutResponseTest.java142
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkNewResponseTest.java533
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkResponseTest.java935
-rw-r--r--id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/package-info.java20
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml86
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml31
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml22
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml22
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml22
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_P11.xml20
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml176
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml174
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml122
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml116
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml98
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestSdoc.xml15
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml81
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml139
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml98
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml61
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml61
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/logback-test.xml4
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/p11Conf.cfg46
-rw-r--r--id/templates/pom.xml25
-rw-r--r--id/templates/src/main/webapp/SampleBKUSelectionTemplate.html41
-rw-r--r--id/templates/src/main/webapp/SampleInputProcessorSignTemplate.html45
-rw-r--r--id/templates/src/main/webapp/SampleLogo.gifbin24664 -> 0 bytes
-rw-r--r--id/templates/src/main/webapp/SampleTemplate.html47
-rw-r--r--id/templates/src/main/webapp/WEB-INF/web.xml9
-rw-r--r--id/templates/src/main/webapp/css/display.css52
-rw-r--r--id/templates/src/main/webapp/css/main.css74
-rw-r--r--id/templates/src/main/webapp/valid-html401.gifbin2328 -> 0 bytes
-rw-r--r--pom.xml27
-rw-r--r--repository/eu/stork/Commons/1.2.0/Commons-1.2.0.jarbin72102 -> 0 bytes
-rw-r--r--repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.jarbin0 -> 282669 bytes
-rw-r--r--repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.pom (renamed from repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.pom)42
-rw-r--r--repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.jarbin180095 -> 0 bytes
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.jarbin0 -> 550695 bytes
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.jar.md51
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.jar.sha11
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.pom390
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.pom.md51
-rw-r--r--repository/iaik/asit/1.3.4/asit-1.3.4.pom.sha11
-rw-r--r--repository/iaik/asit/1.3.5/asit-1.3.5.jarbin0 -> 551218 bytes
-rw-r--r--repository/iaik/asit/1.3.5/asit-1.3.5.jar.sha11
-rw-r--r--repository/iaik/asit/1.3.5/asit-1.3.5.pom9
-rw-r--r--repository/iaik/asit/1.3.5/asit-1.3.5.pom.sha11
-rw-r--r--repository/iaik/asit/1.3.6/asit-1.3.6-javadoc.jarbin0 -> 1166091 bytes
-rw-r--r--repository/iaik/asit/1.3.6/asit-1.3.6-sources.jarbin0 -> 231674 bytes
-rw-r--r--repository/iaik/asit/1.3.6/asit-1.3.6.jarbin0 -> 551232 bytes
-rw-r--r--repository/iaik/asit/1.3.6/asit-1.3.6.pom390
-rw-r--r--repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jarbin0 -> 107994 bytes
-rw-r--r--repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar.sha11
-rw-r--r--repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom6
-rw-r--r--repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom.sha11
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jarbin0 -> 449160 bytes
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.md51
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.sha11
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom633
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.md51
-rw-r--r--repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.sha11
-rw-r--r--repository/iaik/commons-iaik/0.6.2/commons-iaik-0.6.2.jarbin0 -> 470399 bytes
-rw-r--r--repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.md51
-rw-r--r--repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.sha11
-rw-r--r--repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.md51
-rw-r--r--repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.sha11
-rw-r--r--repository/iaik/commons-iaik/0.7.1/m2e-lastUpdated.properties3
-rw-r--r--repository/iaik/ecc/3.18/ecc-3.18.jarbin0 -> 111446 bytes
-rw-r--r--repository/iaik/ecc/3.18/ecc-3.18.pom7
-rw-r--r--repository/iaik/iaikPkcs11Provider/1.3/iaikPkcs11Provider-1.3.jarbin0 -> 294725 bytes
-rw-r--r--repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.jarbin0 -> 105735 bytes
-rw-r--r--repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.pom9
-rw-r--r--repository/iaik/iaik_ecc_eval_signed/2.15/iaik_ecc_eval_signed-2.15.jarbin0 -> 134778 bytes
-rw-r--r--repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.jarbin0 -> 107890 bytes
-rw-r--r--repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.pom7
-rw-r--r--repository/iaik/iaik_ecc_signed/2.19/iaik_ecc.jarbin0 -> 111446 bytes
-rw-r--r--repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar.sha11
-rw-r--r--repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom.sha11
-rw-r--r--repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0-eval.jarbin0 -> 167965 bytes
-rw-r--r--repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0.pom9
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jarbin0 -> 568449 bytes
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar.sha11
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jarbin0 -> 197953 bytes
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar.sha11
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom6
-rw-r--r--repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom.sha11
-rw-r--r--repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom9
-rw-r--r--repository/iaik/iaik_jce_eval_signed/3.16/iaik_jce_eval_signed-3.16.jarbin0 -> 854896 bytes
-rw-r--r--repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jarbin890328 -> 921338 bytes
-rw-r--r--repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom9
-rw-r--r--repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.jarbin0 -> 1059043 bytes
-rw-r--r--repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.pom9
-rw-r--r--repository/iaik/iaik_jce_full/5.101/iaik_jce_full-5.101.jarbin0 -> 1115849 bytes
-rw-r--r--repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.jarbin0 -> 875901 bytes
-rw-r--r--repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.pom7
-rw-r--r--repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.jarbin0 -> 99575 bytes
-rw-r--r--repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.pom7
-rw-r--r--repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom9
-rw-r--r--repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.jarbin0 -> 375286 bytes
-rw-r--r--repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.pom7
-rw-r--r--repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom9
-rw-r--r--repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom9
-rw-r--r--repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.jarbin0 -> 542887 bytes
-rw-r--r--repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.pom135
-rw-r--r--repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/maven-metadata-local.xml24
-rw-r--r--repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.jarbin0 -> 559971 bytes
-rw-r--r--repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.pom250
-rw-r--r--repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.jarbin0 -> 549794 bytes
-rw-r--r--repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.pom251
-rw-r--r--repository/iaik/iaik_tsl/maven-metadata-local.xml14
-rw-r--r--repository/iaik/iaik_util/0.23/iaik_util-0.23.jarbin39377 -> 39372 bytes
-rw-r--r--repository/iaik/iaik_util/0.23/iaik_util-0.23.pom9
-rw-r--r--repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jarbin0 -> 374890 bytes
-rw-r--r--repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar.sha11
-rw-r--r--repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom9
-rw-r--r--repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom.sha11
-rw-r--r--repository/iaik/iaik_xsect/1.1709142/iaik_xsect-1.1709142.jarbin0 -> 401150 bytes
-rw-r--r--repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jarbin0 -> 321478 bytes
-rw-r--r--repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar.sha11
-rw-r--r--repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom32
-rw-r--r--repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom.sha11
-rw-r--r--repository/iaik/iaik_xsect_eval/1.17/iaik_xsect_eval-1.17.jarbin0 -> 572245 bytes
-rw-r--r--repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom9
-rw-r--r--repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.jarbin0 -> 205197 bytes
-rw-r--r--repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.pom7
-rw-r--r--repository/iaik/jce/3.18/jce-3.18.jarbin0 -> 919238 bytes
-rw-r--r--repository/iaik/jce/3.18/jce-3.18.pom7
-rw-r--r--repository/iaik/moa/1.28/m2e-lastUpdated.properties10
-rw-r--r--repository/iaik/moa/1.28/moa-1.28.jarbin0 -> 711652 bytes
-rw-r--r--repository/iaik/moa/1.28/moa-1.28.pom7
-rw-r--r--repository/iaik/moa_common/2006-03-20/moa_common-2006-03-20.jarbin0 -> 100788 bytes
-rw-r--r--repository/iaik/prod/iaik_X509TrustManager/0.3/m2e-lastUpdated.properties10
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jarbin0 -> 365565 bytes
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.md51
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.sha11
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom6
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.md51
-rw-r--r--repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.sha11
-rw-r--r--repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jarbin0 -> 111446 bytes
-rw-r--r--repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom6
-rw-r--r--repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.jar.sha11
-rw-r--r--repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.pom.sha11
-rw-r--r--repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.jar.lastUpdated22
-rw-r--r--repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.pom.lastUpdated12
-rw-r--r--repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jarbin0 -> 999669 bytes
-rw-r--r--repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar.sha11
-rw-r--r--repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom6
-rw-r--r--repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom.sha11
-rw-r--r--repository/iaik/prod/iaik_moa/1.32/m2e-lastUpdated.properties10
-rw-r--r--repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.jar.lastUpdated22
-rw-r--r--repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.pom.lastUpdated12
-rw-r--r--repository/iaik/prod/iaik_moa/1.5/m2e-lastUpdated.properties9
-rw-r--r--repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.jar.lastUpdated3
-rw-r--r--repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.pom.lastUpdated3
-rw-r--r--repository/iaik/w3c_http/1.0/w3c_http-1.0.pom9
-rw-r--r--repository/iaik/xsect/1.02/xsect-1.02.jarbin0 -> 327071 bytes
-rw-r--r--repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.jar.lastUpdated3
-rw-r--r--repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.pom.lastUpdated3
-rw-r--r--repository/xalan-bin-dist/serializer/2.10.0/serializer-2.10.0-sources.jar.lastUpdated8
-rw-r--r--repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.jar.lastUpdated20
-rw-r--r--repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.pom.lastUpdated12
-rw-r--r--repository/xalan-bin-dist/xml-apis/2.10.0/xml-apis-2.10.0-sources.jar.lastUpdated8
-rw-r--r--repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.jar.lastUpdated20
-rw-r--r--repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.pom.lastUpdated12
-rw-r--r--spss/assembly-lib.xml2
-rw-r--r--spss/assembly.xml2
-rw-r--r--spss/handbook/clients/api/moa-spss-handbook-apiClient.iml67
-rw-r--r--spss/handbook/clients/moa-spss-handbook-clients.iml14
-rw-r--r--spss/handbook/clients/referencedData/moa-spss-handbook-referencedData.iml26
-rw-r--r--spss/handbook/clients/webservice/moa-spss-handbook-webserviceClient.iml67
-rw-r--r--spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.resp.xml50
-rw-r--r--spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.xml6
-rw-r--r--spss/handbook/conf/moa-spss/certstore/54A361D38F73772377E15E145772C03EC0197142/F86591A6D86718886A0234B8E54E21AAEA63E24Bbin0 -> 1586 bytes
-rw-r--r--spss/handbook/conf/moa-spss/certstore/CCBA90ED697BA209AB6093FC19FB15B53EE26933/159E42D4A53599389431771D5C936552BB22B084bin0 -> 1576 bytes
-rw-r--r--spss/handbook/conf/moa-spss/certstore/D866A07634012B24DB601087D8B3A9FFEDF5CADB/969A71FDCC5302167A60158828B9E7862DED3B4Dbin0 -> 1580 bytes
-rw-r--r--spss/handbook/conf/moa-spss/certstore/E583DB7202A8D1570A18CD11146B0CBCA438F71A/2A5945E1FC2006BE0D59C3375253C9D3327D197Dbin0 -> 1580 bytes
-rw-r--r--spss/handbook/conf/moa-spss/certstore/FE51079176B9F46204816CABA94824B3B14A3830/2E66C9841181C08FB1DFABD4FF8D5CC72BE08F02bin0 -> 1485 bytes
-rw-r--r--spss/handbook/conf/moa-spss/log4j.properties2
-rw-r--r--spss/handbook/conf/moa-spss/sp.minimum_with_tsl.config.xml4
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Enc-05.20130923-20230920.SerNoFCDEE.cerbin0 -> 1580 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cerbin0 -> 1580 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-corporate-05.20130923-20230920.SerNoFCE21.cerbin0 -> 1576 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cerbin0 -> 1485 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cerbin0 -> 1580 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-premium-mobile-05.20130923-20230920.SerNoFCDD4.cerbin0 -> 1586 bytes
-rw-r--r--spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cerbin0 -> 1485 bytes
-rw-r--r--spss/handbook/handbook/config/MOA-SPSS-config-2.0.0.xsd (renamed from spss/handbook/handbook/config/MOA-SPSS-config-1.5.2.xsd)0
-rw-r--r--spss/handbook/handbook/config/config.html2
-rw-r--r--spss/handbook/handbook/index.html2
-rw-r--r--spss/handbook/handbook/install/install.html6
-rw-r--r--spss/handbook/handbook/intro/intro.html2
-rw-r--r--spss/handbook/handbook/spec/MOA-SPSS-1.5.2.pdfbin555449 -> 0 bytes
-rw-r--r--spss/handbook/handbook/spec/MOA-SPSS-2.0.0.pdfbin0 -> 291606 bytes
-rw-r--r--spss/handbook/handbook/spec/MOA-SPSS-2.0.0.wsdl (renamed from spss/handbook/handbook/spec/MOA-SPSS-1.5.2.wsdl)2
-rw-r--r--spss/handbook/handbook/spec/MOA-SPSS-2.0.0.xsd (renamed from spss/handbook/handbook/spec/MOA-SPSS-1.5.2.xsd)0
-rw-r--r--spss/handbook/handbook/usage/usage.html64
-rw-r--r--spss/handbook/moa-spss-handbook.iml23
-rw-r--r--spss/server/history.txt10
-rw-r--r--spss/server/moa-spss.iml14
-rw-r--r--spss/server/readme.update.txt16
-rw-r--r--spss/server/serverlib/moa-spss-lib.iml114
-rw-r--r--spss/server/serverlib/pom.xml14
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java1
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java2
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java147
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java81
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java8
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/connector/TSLConnector.java1
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/timer/TSLUpdaterTimerTask.java46
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/utils/TSLImportFromFileContext.java343
-rw-r--r--spss/server/serverlib/src/main/resources/resources/properties/spss_messages_de.properties1
-rw-r--r--spss/server/serverws/moa-spss-ws.iml79
-rw-r--r--spss/server/serverws/pom.xml33
-rw-r--r--spss/server/tools/moa-spss-tools.iml23
-rw-r--r--spss/server/tools/pom.xml18
-rw-r--r--spss/server/tools/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java8
1354 files changed, 108561 insertions, 23101 deletions
diff --git a/NOTICE.txt b/NOTICE.txt
index a43afb055..073423e09 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
MOA-ID/SP/SS
-Copyright 2008 Federal Chancellery Austria
+Copyright 2014 Federal Chancellery Austria
This "NOTICE" text file is part of the distribution. Any derivative works that
you distribute must include a readable copy of the attribution notices contained
@@ -15,7 +15,7 @@ www.digitales.oesterreich.gv.at).
This product includes software developed by third parties
and provided under an open source license (www.opensource.org).
-This product -- up to and including version 1.5.0 -- includes software
+This product -- up to and including version 2.0-RC1 -- includes software
"IAIK MOA" provided by Stiftung Secure Information and Communication
Technologies SIC (www.sic.st). This software has been licensed under the terms
and conditions given in "IAIK-LICENSE".
@@ -25,7 +25,7 @@ Information and Communication Technologies SIC (www.sic.st). This software has
been licensed under the terms and conditions given in "SIC-LICENSE.txt".
License change:
-Up to and including version 1.5.0 of this product were published under an
+Up to and including version 2.0-RC1 of this product were published under an
Apache 2.0 license (see "LICENSE-2.0.txt"). From version 1.5.0 onwards the
product is licensed under the terms and conditions of the European Union Public
Licence (EUPL) Version 1.1 ("EUPL v.1.1 - Licence.pdf").
diff --git a/common/pom.xml b/common/pom.xml
index 468ecaf2d..46f26501f 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -1,94 +1,148 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>MOA</groupId>
- <artifactId>MOA</artifactId>
- <version>2.0.0</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>moa-common</artifactId>
- <!-- <version>2.0.0</version> -->
- <packaging>jar</packaging>
- <name>MOA common library</name>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>MOA</groupId>
+ <artifactId>MOA</artifactId>
+ <version>2.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>moa-common</artifactId>
+ <!-- <version>2.0.0</version> -->
+ <packaging>jar</packaging>
+ <name>MOA common library</name>
- <properties>
- <repositoryPath>${basedir}/../repository</repositoryPath>
- </properties>
+ <properties>
+ <repositoryPath>${basedir}/../repository</repositoryPath>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>iaik.prod</groupId>
+ <artifactId>iaik_jce_full</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>iaik.prod</groupId>
+ <artifactId>iaik_moa</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>saxpath</groupId>
+ <artifactId>saxpath</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xalan-bin-dist</groupId>
+ <artifactId>xalan</artifactId>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xalan-bin-dist</groupId>
+ <artifactId>xml-apis</artifactId>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xalan-bin-dist</groupId>
+ <artifactId>serializer</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>enforce-banned-dependencies</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <searchTransitive>true</searchTransitive>
+ <excludes>
+ <!-- <exclude>commons-logging</exclude> -->
+ <exclude>org.slf4j:1.5*</exclude>
+ <exclude>org.slf4j:1.6*</exclude>
+ <!-- <exclude>org.springframework:2.*</exclude>
+ <exclude>org.springframework:3.0.*</exclude> -->
+ </excludes>
+ </bannedDependencies>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_jce_full</artifactId>
- </dependency>
- <dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_moa</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- </dependency>
- <dependency>
- <groupId>saxpath</groupId>
- <artifactId>saxpath</artifactId>
- </dependency>
- <dependency>
- <groupId>xalan-bin-dist</groupId>
- <artifactId>xalan</artifactId>
- <scope>compile</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>xalan-bin-dist</groupId>
- <artifactId>xml-apis</artifactId>
- <scope>compile</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>xalan-bin-dist</groupId>
- <artifactId>serializer</artifactId>
- <scope>runtime</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <addMavenDescriptor>false</addMavenDescriptor>
- </archive>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
index 07f9e27af..2e76325a5 100644
--- a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
+++ b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
@@ -24,9 +24,6 @@
package at.gv.egovernment.moa.logging;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* A utility class acting as a facade to the logging subsystem.
*
@@ -39,35 +36,13 @@ import org.apache.commons.logging.LogFactory;
*/
public class Logger {
- /** The default logging hierarchy. */
- private static String defaultHierarchy = "";
-
- /**
- * Get the <code>Log</code> object for the default hierarchy.
- *
- * @return The <code>Log</code> object to write log messages to.
- */
- private static Log getLog() {
- return LogFactory.getLog(defaultHierarchy);
- }
-
- /**
- * Get the <code>Log</code> object for a given hierarchy.
- *
- * @param hierarchy The logging hierarchy for which to return the logger.
- * @return The <code>Log</code> object to write log messages to.
- */
- private static Log getLog(String hierarchy) {
- return LogFactory.getLog(hierarchy);
- }
-
/**
* Set the default hierarchy to which the <code>Logger</code> should send its
* logging output.
* @param hierarchy The logging defaultHierarchy.
*/
public static void setHierarchy(String hierarchy) {
- defaultHierarchy = hierarchy;
+ // there is no need for that anymore
}
/**
@@ -77,7 +52,8 @@ public class Logger {
* <code>false</code> otherwise.
*/
public static boolean isTraceEnabled() {
- return getLog().isTraceEnabled();
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ return logger.isTraceEnabled();
}
/**
@@ -88,7 +64,8 @@ public class Logger {
* <code>false</code> otherwise.
*/
public static boolean isTraceEnabled(String hierarchy) {
- return getLog(hierarchy).isTraceEnabled();
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ return logger.isTraceEnabled();
}
/**
@@ -97,7 +74,8 @@ public class Logger {
* @param message The message to trace.
*/
public static void trace(Object message) {
- getLog().trace(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.trace(message);
}
/**
@@ -107,7 +85,8 @@ public class Logger {
* <code>false</code> otherwise.
*/
public static boolean isDebugEnabled() {
- return getLog().isDebugEnabled();
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ return logger.isDebugEnabled();
}
/**
@@ -118,7 +97,8 @@ public class Logger {
* <code>false</code> otherwise.
*/
public static boolean isDebugEnabled(String hierarchy) {
- return getLog(hierarchy).isDebugEnabled();
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ return logger.isDebugEnabled();
}
/**
@@ -127,7 +107,8 @@ public class Logger {
* @param message The message to log.
*/
public static void debug(Object message) {
- getLog().debug(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.debug(message);
}
/**
@@ -136,7 +117,8 @@ public class Logger {
* @param message The message to log.
*/
public static void info(Object message) {
- getLog().info(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.info(message);
}
/**
@@ -145,7 +127,8 @@ public class Logger {
* @param message The message to log.
*/
public static void warn(Object message) {
- getLog().warn(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.warn(message);
}
/**
@@ -155,7 +138,8 @@ public class Logger {
* @param t An exception that may be the cause of the warning.
*/
public static void warn(Object message, Throwable t) {
- getLog().warn(message, t);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.warn(message, t);
}
/**
@@ -164,7 +148,8 @@ public class Logger {
* @param message The message to log.
*/
public static void error(Object message) {
- getLog().error(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.error(message);
}
/**
@@ -174,7 +159,8 @@ public class Logger {
* @param t An exception that may be the cause of the error.
*/
public static void error(Object message, Throwable t) {
- getLog().error(message, t);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.error(message, t);
}
/**
@@ -183,7 +169,8 @@ public class Logger {
* @param message The message to log.
*/
public static void fatal(Object message) {
- getLog().fatal(message);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.fatal(message);
}
/**
@@ -193,7 +180,7 @@ public class Logger {
* @param t An exception that may be the cause of the error.
*/
public static void fatal(Object message, Throwable t) {
- getLog().fatal(message, t);
+ org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
+ logger.fatal(message, t);
}
-
}
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java
index 213eb6242..ed75768ba 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java
@@ -429,7 +429,10 @@ public interface Constants {
/** URN prefix for context dependent id (wbPK). */
public static final String URN_PREFIX_WBPK = URN_PREFIX + ":wbpk";
-
+
+ /** URN prefix for context dependent id (stork). */
+ public static final String URN_PREFIX_STORK = URN_PREFIX + ":storkid";
+
/** URN prefix for context dependent id. */
public static final String URN_PREFIX_BASEID = URN_PREFIX + ":baseid";
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java
index cac179a75..ff22c7313 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java
@@ -133,7 +133,8 @@ public class FileUtils {
keyFile = new File(url);
if (!keyFile.isAbsolute()) {
keyFile = new File(root, url);
- newURL = keyFile.getPath();
+ newURL = keyFile.toURI().toString();
+
}
return newURL;
}
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java b/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java
index 043baea0e..c2f2c9f47 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java
@@ -143,20 +143,20 @@ public class MiscUtil {
return out.toByteArray();
}
- public static Document parseDocument(InputStream inputStream)
- throws IOException {
- try {
- DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
- .newInstance();
- docBuilderFactory.setNamespaceAware(true);
- DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
- return docBuilder.parse(inputStream);
- } catch (ParserConfigurationException e) {
- throw new IOException(e);
- } catch (SAXException e) {
- throw new IOException(e);
- }
- }
+// public static Document parseDocument(InputStream inputStream)
+// throws IOException {
+// try {
+// DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
+// .newInstance();
+// docBuilderFactory.setNamespaceAware(true);
+// DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+// return docBuilder.parse(inputStream);
+// } catch (ParserConfigurationException e) {
+// throw new IOException(e);
+// } catch (SAXException e) {
+// throw new IOException(e);
+// }
+// }
public static String removePrecedingSlash(String path, String slash) {
assertNotEmpty(slash, "Shash");
diff --git a/id/ConfigWebTool/ConfigurationInterface.iml b/id/ConfigWebTool/ConfigurationInterface.iml
new file mode 100644
index 000000000..10f5ffc26
--- /dev/null
+++ b/id/ConfigWebTool/ConfigurationInterface.iml
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ </configuration>
+ <facet type="Struts2" name="Struts 2">
+ <configuration>
+ <propertiesKeys disabled="false" />
+ </configuration>
+ </facet>
+ </facet>
+ <facet type="javaeeApplication" name="javaEEApplication">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="application.xml" url="file://$MODULE_DIR$/src/main/webapp/jsp/importexport.jsp" />
+ </descriptors>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.6" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:jstl:1.2" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="module" module-name="moa-id-commons" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-c3p0:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:maven-hyperjaxb3-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.annox:annox:0.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-tools:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:0.5.6" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-testing:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: xmlunit:xmlunit:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-persistence:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-customizations:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring:2.0.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.org.apache.xml.internal:resolver:20050927" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-project:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-model:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:1.5.15" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.11" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
+ <orderEntry type="library" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-profile:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact-manager:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6" level="project" />
+ <orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-registry:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jfrog.maven.annomojo:maven-plugin-anno:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-xjc:2.2.4-1" level="project" />
+ <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
+ <orderEntry type="module" module-name="moa-id-lib" />
+ <orderEntry type="library" name="Maven: eu.stork:oasis-dss-api:1.0.0-RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
+ <orderEntry type="module" module-name="Commons" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.6.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.4.0" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.5.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xml-apis:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xercesImpl:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:serializer:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
+ <orderEntry type="module" module-name="SamlEngine" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-tools:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-rt:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3" level="project" />
+ <orderEntry type="library" name="Maven: dav4j:dav4j:0.1" level="project" />
+ <orderEntry type="library" name="Maven: httpsclient:httpsclient:JSSE-1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_X509TrustManager:0.3" level="project" />
+ <orderEntry type="library" name="Maven: regexp:regexp:1.3" level="project" />
+ <orderEntry type="library" name="Maven: com.googlecode.jsontoken:jsontoken:1.0" level="project" />
+ <orderEntry type="library" name="Maven: com.google.code.gson:gson:1.4" level="project" />
+ <orderEntry type="library" name="Maven: com.google.collections:google-collections:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
+ <orderEntry type="library" name="Maven: at.gv.util:egovutils:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: commons-validator:commons-validator:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-digester:commons-digester:1.6" level="project" />
+ <orderEntry type="library" name="Maven: bouncycastle:bcprov-jdk16:140" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.struts:struts2-core:2.3.14.3" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.struts.xwork:xwork-core:2.3.14.3" level="project" />
+ <orderEntry type="library" name="Maven: ognl:ognl:3.0.6" level="project" />
+ <orderEntry type="library" name="Maven: javassist:javassist:3.11.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: asm:asm:3.3" level="project" />
+ <orderEntry type="library" name="Maven: asm:asm-commons:3.3" level="project" />
+ <orderEntry type="library" name="Maven: asm:asm-tree:3.3" level="project" />
+ <orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.19" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.struts:struts2-json-plugin:2.3.14.3" level="project" />
+ <orderEntry type="library" name="Maven: iaik:commons-iaik:0.7.1" level="project" />
+ </component>
+</module>
+
diff --git a/id/ConfigWebTool/pom.xml b/id/ConfigWebTool/pom.xml
index 15228a30e..25dbcc25d 100644
--- a/id/ConfigWebTool/pom.xml
+++ b/id/ConfigWebTool/pom.xml
@@ -2,13 +2,13 @@
<parent>
<groupId>MOA</groupId>
<artifactId>id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.id</groupId>
<artifactId>moa-id-configuration</artifactId>
- <version>0.9.8-SNAPSHOT</version>
+ <version>1.0.0</version>
<packaging>war</packaging>
<name>MOA-ID 2.0 Configuration Tool</name>
<description>Web based Configuration Tool for MOA-ID 2.x</description>
@@ -45,7 +45,7 @@
<dependency>
<groupId>MOA.id.server</groupId>
<artifactId>moa-id-commons</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</dependency>
<dependency>
<groupId>MOA.id.server</groupId>
@@ -68,9 +68,17 @@
<groupId>com.sun</groupId>
<artifactId>*</artifactId>
</exclusion>
- </exclusions>
-
- </dependency>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
+ </dependency>
<dependency>
<groupId>org.opensaml</groupId>
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
index 7a9d91a5d..79a966b81 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
@@ -69,9 +69,12 @@ public class Constants {
public static final String BKU_HANDY = "bkuhandy";
public static final String MOA_CONFIG_BUSINESSSERVICE = "businessService";
- public static final String MOA_CONFIG_PROTOCOL_SAML1 = "id_saml1";
+ public static final String MOA_CONFIG_STORKSERVICE = "storkService";
+ public static final String MOA_CONFIG_PROTOCOL_SAML1 = "id_saml1";
public static final String MOA_CONFIG_PROTOCOL_PVP2 = "id_pvp2x";
-
+ public static final String MOA_CONFIG_PROTOCOL_STORK2 = "id_stork2";
+
+
public static final String DEFAULT_LOCALBKU_URL = "https://127.0.0.1:3496/https-security-layer-request";
public static final String DEFAULT_HANDYBKU_URL = "https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx";
@@ -80,20 +83,24 @@ public class Constants {
public static final String IDENIFICATIONTYPE_FN = "FN";
public static final String IDENIFICATIONTYPE_ERSB = "ERSB";
public static final String IDENIFICATIONTYPE_ZVR = "ZVR";
- public static final String IDENIFICATIONTYPE_BASEID = "urn:publicid:gv.at:baseid+";
+ public static final String IDENIFICATIONTYPE_STORK = "STORK";
+ public static final String IDENIFICATIONTYPE_BASEID = "urn:publicid:gv.at:baseid+";
public static final String IDENIFICATIONTYPE_BASEID_FN = IDENIFICATIONTYPE_BASEID + "X" + IDENIFICATIONTYPE_FN;
public static final String IDENIFICATIONTYPE_BASEID_ZVR = IDENIFICATIONTYPE_BASEID + "X" + IDENIFICATIONTYPE_ZVR;
public static final String PREFIX_WPBK = "urn:publicid:gv.at:wbpk+";
-
- public static final Map<String, String> BUSINESSSERVICENAMES;
+ public static final String PREFIX_STORK = "urn:publicid:gv.at:storkid+";
+
+
+ public static final Map<String, String> BUSINESSSERVICENAMES;
static {
Hashtable<String, String> tmp = new Hashtable<String, String>();
tmp.put(IDENIFICATIONTYPE_FN, "Firmenbuchnummer");
tmp.put(IDENIFICATIONTYPE_ZVR, "Vereinsnummer");
tmp.put(IDENIFICATIONTYPE_ERSB, "ERsB Kennzahl");
-
- BUSINESSSERVICENAMES = Collections.unmodifiableMap(tmp);
+ tmp.put(IDENIFICATIONTYPE_STORK, "STORK");
+
+ BUSINESSSERVICENAMES = Collections.unmodifiableMap(tmp);
}
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
index 0c4823f43..2dce3534f 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java
@@ -92,7 +92,7 @@ public class ConfigurationProvider {
configFileName = System.getProperty(SYSTEM_PROP_CONFIG);
if (configFileName == null) {
- throw new ConfigurationException("config.01");
+ throw new ConfigurationException("config.05");
}
// determine the directory of the root config file
@@ -377,6 +377,14 @@ public class ConfigurationProvider {
public String getMailOAActivationSubject() {
return props.getProperty("general.mail.createOArequest.isactive.subject");
}
+
+ public String getDefaultLanguage() {
+ try {
+ return props.getProperty("general.defaultlanguage").toLowerCase();
+ } catch (Exception ex) {
+ return "de";
+ }
+ }
public String getMailOAActivationTemplate() throws ConfigurationException {
String url = props.getProperty("general.mail.createOArequest.isactive.template");
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
index d6ede8fbf..4c3486b46 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
@@ -55,6 +55,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType;
import at.gv.egovernment.moa.id.commons.db.dao.config.TrustAnchor;
import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock;
import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink;
+import at.gv.egovernment.moa.id.config.legacy.ConfigurationBuilder;
import at.gv.egovernment.moa.id.configuration.Constants;
import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -113,6 +114,7 @@ public class GeneralMOAIDConfig {
private static Map<String, String> chainigmodelist;
private String trustedCACerts = null;
+
private String defaultBKUOnline = "";
private String defaultBKULocal = "https://127.0.0.1:3496/https-security-layer-request";
@@ -305,6 +307,7 @@ public class GeneralMOAIDConfig {
if (modes != null) {
ChainingModeType defaultmode = modes.getSystemDefaultMode();
if (defaultmode != null) {
+
defaultchainigmode = defaultmode.value();
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
index 980aa4731..3354fd708 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java
@@ -31,14 +31,18 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.STORK;
import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute;
+import org.apache.log4j.Logger;
public class GeneralStorkConfig {
private List<CPEPS> cpepslist;
private List<StorkAttribute> attributes;
private int qaa;
+ private static final Logger log = Logger.getLogger(GeneralStorkConfig.class);
+
+ public void parse(MOAIDConfiguration config) {
+ log.error("STARTED STORK CONFIG");
- public void parse(MOAIDConfiguration config) {
if (config != null) {
AuthComponentGeneral auth = config.getAuthComponentGeneral();
@@ -48,22 +52,23 @@ public class GeneralStorkConfig {
if (foreign != null) {
STORK stork = foreign.getSTORK();
+ cpepslist = new ArrayList<CPEPS>();
+ attributes = new ArrayList<StorkAttribute>();
+
if (stork != null) {
// deep clone all the things
// to foreclose lazyloading session timeouts
- cpepslist = new ArrayList<CPEPS>();
+
for(CPEPS current : stork.getCPEPS()) {
cpepslist.add(current);
}
-
+
List<StorkAttribute> tmp = stork.getAttributes();
if(null != tmp) {
- attributes = new ArrayList<StorkAttribute>();
+
for(StorkAttribute current : tmp)
attributes.add(current);
}
- if(attributes.isEmpty())
- attributes.add(new StorkAttribute());
try {
qaa = stork.getQualityAuthenticationAssuranceLevel();
@@ -71,6 +76,12 @@ public class GeneralStorkConfig {
qaa = 4;
}
}
+
+ if (cpepslist.isEmpty())
+ cpepslist.add(new CPEPS());
+
+ if(attributes.isEmpty())
+ attributes.add(new StorkAttribute());
}
}
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
index ba58701fc..7510b8932 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
@@ -37,6 +37,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector;
import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
+import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem;
import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType;
import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType;
@@ -58,17 +59,19 @@ public class OAGeneralConfig {
private String friendlyName = null;
private boolean businessService = false;
-
- private String target = null;
+ private boolean storkService = false;
+
+ private String target = null;
private String target_subsector = null;
private String target_admin = null;
private static List<String> targetList = null;
private String targetFriendlyName = null;
private boolean isAdminTarget = false;
-
+
private String identificationNumber = null;
private String identificationType = null;
private static List<String> identificationTypeList = null;
+ private String storkSPTargetCountry = null;
private String aditionalAuthBlockText = null;
@@ -118,7 +121,8 @@ public class OAGeneralConfig {
identificationTypeList = Arrays.asList(
Constants.IDENIFICATIONTYPE_FN,
Constants.IDENIFICATIONTYPE_ZVR,
- Constants.IDENIFICATIONTYPE_ERSB);
+ Constants.IDENIFICATIONTYPE_ERSB,
+ Constants.IDENIFICATIONTYPE_STORK);
}
@@ -159,8 +163,17 @@ public class OAGeneralConfig {
businessService = true;
else
businessService = false;
-
- AuthComponentOA oaauth = dbOAConfig.getAuthComponentOA();
+
+ if (dbOAConfig.getType().equals(Constants.MOA_CONFIG_STORKSERVICE))
+ storkService = true;
+ else
+ storkService = false;
+
+ if (dbOAConfig.getStorkSPTargetCountry() != null)
+ storkSPTargetCountry = dbOAConfig.getStorkSPTargetCountry();
+
+
+ AuthComponentOA oaauth = dbOAConfig.getAuthComponentOA();
if (oaauth != null) {
BKUURLS bkuurls = oaauth.getBKUURLS();
@@ -205,22 +218,42 @@ public class OAGeneralConfig {
if (Constants.PREFIX_WPBK.startsWith(split[0]) && split.length >= 2) {
identificationType = split[1];
identificationNumber = split[2];
- }
+ } else if (Constants.PREFIX_STORK.startsWith(split[0]) && split.length >= 2) {
+ identificationType = split[1]; // setting at as iden category ?
+ identificationNumber = split[2]; // setting sp country as ident type -> sp ident
+ }
}
}
Mandates mandates = oaauth.getMandates();
if (mandates != null) {
- if (MiscUtil.isNotEmpty(mandates.getProfiles())) {
- mandateProfiles = mandates.getProfiles();
- useMandates = true;
+ mandateProfiles = null;
+
+ List<MandatesProfileNameItem> profileList = mandates.getProfileNameItems();
+ for (MandatesProfileNameItem el : profileList) {
+ if (mandateProfiles == null)
+ mandateProfiles = el.getItem();
- } else {
- mandateProfiles = new String();
- useMandates = false;
+ else
+ mandateProfiles += "," + el.getItem();
}
+ //TODO: only for RC1
+ if (MiscUtil.isNotEmpty(mandates.getProfiles())) {
+ if (mandateProfiles == null)
+ mandateProfiles = mandates.getProfiles();
+
+ else
+ mandateProfiles += "," + mandates.getProfiles();
+
+ }
+
+ if (mandateProfiles != null)
+ useMandates = true;
+
+ else
+ useMandates = false;
}
@@ -301,6 +334,14 @@ public class OAGeneralConfig {
return identificationNumber;
}
+ public String getStorkSPTargetCountry() {
+ return storkSPTargetCountry;
+ }
+
+ public void setStorkSPTargetCountry(String storkSPTargetCountry) {
+ this.storkSPTargetCountry = storkSPTargetCountry;
+ }
+
public void setIdentificationNumber(String identificationNumber) {
this.identificationNumber = identificationNumber;
}
@@ -341,6 +382,14 @@ public class OAGeneralConfig {
return businessService;
}
+ public boolean isStorkService() {
+ return storkService;
+ }
+
+ public void setStorkService(boolean storkService) {
+ this.storkService = storkService;
+ }
+
public void setBusinessService(boolean businessService) {
this.businessService = businessService;
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java
index cdfb20294..bb5baf53e 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java
@@ -28,13 +28,13 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
public class OASAML1Config {
- private boolean isActive = false;
- private boolean provideStammZahl = false;
- private boolean provideAuthBlock = false;
- private boolean provideIdentityLink = false;
- private boolean provideCertificate = false;
- private boolean provideFullMandateData = false;
- private boolean useCondition = false;
+ private Boolean isActive = false;
+ private Boolean provideStammZahl = false;
+ private Boolean provideAuthBlock = false;
+ private Boolean provideIdentityLink = false;
+ private Boolean provideCertificate = false;
+ private Boolean provideFullMandateData = false;
+ private Boolean useCondition = false;
private int conditionLength = -1;
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java
index da07b10b0..d5355a421 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java
@@ -26,21 +26,31 @@ import java.util.ArrayList;
import java.util.List;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute;
import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute;
+import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory;
public class OASTORKConfig {
private boolean isStorkLogonEnabled = false;
private int qaa;
- private List<AttributeHelper> attributes;
+ private List<AttributeHelper> attributes = null;
+ /*
+ * VIDP settings below
+ */
+ private boolean vidpEnabled = false;
+ private List<AttributeProviderPlugin> attributeProviderPlugins = new ArrayList<AttributeProviderPlugin>();
+ private boolean requireConsent = false;
+
public OASTORKConfig() {
-
+
}
/**
@@ -65,6 +75,7 @@ public class OASTORKConfig {
// prepare attribute helper list
attributes = new ArrayList<AttributeHelper>();
+ try {
for(StorkAttribute current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) {
AttributeHelper tmp = null;
@@ -77,6 +88,21 @@ public class OASTORKConfig {
attributes.add(tmp);
}
+
+ // fetch vidp config
+ setVidpEnabled(config.isVidpEnabled());
+ setRequireConsent(config.isRequireConsent());
+
+ attributeProviderPlugins = config.getAttributeProviders();
+ // - if no attribute providers are configured, add a dummy
+ // TODO this is a dirty hack since we have to have one entry to
+ // clone from in the web form. Happens when time is short.
+ // Sorry.
+ if (attributeProviderPlugins.isEmpty())
+ attributeProviderPlugins.add(new AttributeProviderPlugin());
+ } catch (NullPointerException ex) {
+ Logger.error("Nullpointerexception encountered in Configurationinterface");
+ }
}
}
}
@@ -126,4 +152,32 @@ public class OASTORKConfig {
public void setHelperAttributes(List<AttributeHelper> attributes) {
this.attributes = attributes;
}
+
+ public List<String> getAvailableAttributeProviderPlugins() {
+ return AttributeProviderFactory.getAvailablePlugins();
+ }
+
+ public List<AttributeProviderPlugin> getAttributeProviderPlugins() {
+ return attributeProviderPlugins;
+ }
+
+ public void setAttributeProviderPlugins(List<AttributeProviderPlugin> update) {
+ attributeProviderPlugins = update;
+ }
+
+ public boolean isVidpEnabled() {
+ return vidpEnabled;
+ }
+
+ public void setVidpEnabled(boolean update) {
+ vidpEnabled = update;
+ }
+
+ public boolean isRequireConsent() {
+ return requireConsent;
+ }
+
+ public void setRequireConsent(boolean update) {
+ requireConsent = update;
+ }
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java
index a2f0628eb..73b2708ae 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/LanguageHelper.java
@@ -23,6 +23,10 @@
package at.gv.egovernment.moa.id.configuration.helper;
+import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
+import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException;
+import at.gv.egovernment.moa.logging.Logger;
+
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -34,9 +38,44 @@ public class LanguageHelper {
private static ResourceBundle errorRes_DE = ResourceBundle.getBundle("applicationResources", Locale.GERMAN);
private static ResourceBundle guiRes_DE = ResourceBundle.getBundle("applicationResources", Locale.GERMAN);
-
- public static String getGUIString(String code, HttpServletRequest request) {
- return guiRes_DE.getString(code);
+
+ private static ResourceBundle errorRes_EN = ResourceBundle.getBundle("applicationResources_en", Locale.ENGLISH);
+ private static ResourceBundle guiRes_EN = ResourceBundle.getBundle("applicationResources_en", Locale.ENGLISH);
+
+ private static ResourceBundle errorLanguage() {
+ Logger.setHierarchy("moa.id.configuration");
+ try {
+ ConfigurationProvider configurationProvider = ConfigurationProvider.getInstance();
+ if (configurationProvider.getDefaultLanguage().equals("en")) {
+ return errorRes_EN;
+ } else {
+ return errorRes_DE;
+ }
+ } catch (ConfigurationException e) {
+ Logger.error("Configuration exception while getting ConfigurationProvider instance");
+ e.printStackTrace();
+ return errorRes_DE;
+ }
+ }
+
+ private static ResourceBundle guiLanguage() {
+ Logger.setHierarchy("moa.id.configuration");
+ try {
+ ConfigurationProvider configurationProvider = ConfigurationProvider.getInstance();
+ if (configurationProvider.getDefaultLanguage().equals("en")) {
+ return guiRes_EN;
+ } else {
+ return guiRes_DE;
+ }
+ } catch (ConfigurationException e) {
+ Logger.error("Configuration exception while getting ConfigurationProvider instance");
+ e.printStackTrace();
+ return guiRes_DE;
+ }
+ }
+
+ public static String getGUIString(String code, HttpServletRequest request) {
+ return guiRes_DE.getString(code);
}
public static String getGUIString(String code) {
@@ -44,16 +83,15 @@ public class LanguageHelper {
}
public static String getErrorString(String code, HttpServletRequest request) {
- return errorRes_DE.getString(code);
+ return errorLanguage().getString(code);
}
public static String getErrorString(String code) {
- return errorRes_DE.getString(code);
+ return errorLanguage().getString(code);
}
public static String getGUIString(String code, String parameter, HttpServletRequest request) {
-
- return MessageFormat.format(getGUIString(code, request), parameter);
+ return MessageFormat.format(getGUIString(code, request), parameter);
}
public static String getErrorString(String code, Object[] parameter, HttpServletRequest request) {
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java
index 6f1112e2e..0aeed8cb5 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/MailHelper.java
@@ -69,7 +69,7 @@ public class MailHelper {
String template = readTemplateFromURL(templateurl);
- if (userdb.isIsMandateUser()) {
+ if (userdb.isIsMandateUser() != null && userdb.isIsMandateUser()) {
template = template.replace(PATTERN_GIVENNAME, userdb.getInstitut());
template = template.replace(PATTERN_FAMILYNAME, "");
@@ -174,7 +174,7 @@ public class MailHelper {
String template = readTemplateFromURL(templateurl);
- if (userdb.isIsMandateUser()) {
+ if (userdb.isIsMandateUser() != null && userdb.isIsMandateUser()) {
template = template.replace(PATTERN_GIVENNAME, userdb.getInstitut());
template = template.replace(PATTERN_FAMILYNAME, "");
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/StringHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/StringHelper.java
index 43fc78821..53afa59a0 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/StringHelper.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/helper/StringHelper.java
@@ -22,6 +22,8 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.configuration.helper;
+import java.io.UnsupportedEncodingException;
+
public class StringHelper {
public static String formatText(String strGivenText)
@@ -47,4 +49,14 @@ public class StringHelper {
}
return sbFormattedText.toString();
}
+
+ public static String getUTF8String(String input) {
+ try {
+ return new String(input.getBytes(), "UTF-8");
+
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ return input;
+ }
+ }
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
index 5df12a7a5..b77b47d15 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
@@ -23,12 +23,7 @@
package at.gv.egovernment.moa.id.configuration.struts.action;
import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -41,6 +36,7 @@ import org.apache.struts2.interceptor.ServletResponseAware;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral;
+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;
@@ -62,6 +58,7 @@ 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.StorkAttribute;
import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts;
import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType;
import at.gv.egovernment.moa.id.commons.db.dao.config.TrustAnchor;
@@ -73,6 +70,7 @@ import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser;
import at.gv.egovernment.moa.id.configuration.data.GeneralMOAIDConfig;
import at.gv.egovernment.moa.id.configuration.data.GeneralStorkConfig;
import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper;
+import at.gv.egovernment.moa.id.configuration.helper.StringHelper;
import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper;
import at.gv.egovernment.moa.id.configuration.validation.moaconfig.MOAConfigValidator;
import at.gv.egovernment.moa.id.configuration.validation.moaconfig.StorkConfigValidator;
@@ -96,7 +94,8 @@ public class EditGeneralConfigAction extends ActionSupport
private String formID;
public String loadConfig() {
- HttpSession session = request.getSession();
+
+ HttpSession session = request.getSession();
if (session == null) {
log.info("No http Session found.");
return Constants.STRUTS_ERROR;
@@ -113,8 +112,16 @@ public class EditGeneralConfigAction extends ActionSupport
moaconfig.parse(dbconfig);
storkconfig = new GeneralStorkConfig();
storkconfig.parse(dbconfig);
-
- ConfigurationDBUtils.closeSession();
+
+ if (moaconfig == null) {
+ log.error("MOA configuration is null");
+ }
+
+ if (storkconfig == null) {
+ log.error("Stork configuration is null");
+ }
+
+ ConfigurationDBUtils.closeSession();
formID = Random.nextRandom();
session.setAttribute(Constants.SESSION_FORMID, formID);
@@ -133,7 +140,7 @@ public class EditGeneralConfigAction extends ActionSupport
log.info("No http Session found.");
return Constants.STRUTS_ERROR;
}
-
+
Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
authUser = (AuthenticatedUser) authUserObj;
@@ -161,7 +168,7 @@ public class EditGeneralConfigAction extends ActionSupport
errors.addAll(new StorkConfigValidator().validate(storkconfig));
if (errors.size() > 0) {
- log.info("General MOA-ID configuration has some erros.");
+ log.info("General MOA-ID configuration has some errors.");
for (String el : errors)
addActionError(el);
@@ -198,7 +205,24 @@ public class EditGeneralConfigAction extends ActionSupport
}
private String saveFormToDatabase() {
-
+
+ log.debug("Saving form to database");
+ log.error("Saving form to db");
+ log.info("SV frm db");
+
+ for (Object obj : Collections.list(request.getParameterNames())) {
+ log.error(" PARAM: " + obj.toString());
+ }
+ for (Object obj : Collections.list(request.getSession().getAttributeNames())) {
+ log.error(" SES PARAM: " + obj.toString());
+ }
+
+ try {
+ log.error(" ASSERTION " + moaconfig.getTimeoutAssertion());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
MOAIDConfiguration oldconfig = ConfigurationDBRead.getMOAIDConfiguration();
AuthComponentGeneral oldauth = null;
if (oldconfig != null) {
@@ -269,7 +293,8 @@ public class EditGeneralConfigAction extends ActionSupport
dbauthgeneral.setTrustManagerRevocationChecking(moaconfig.isTrustmanagerrevocationcheck());
-
+
+
Protocols dbprotocols = dbauth.getProtocols();
if (dbprotocols == null) {
dbprotocols = new Protocols();
@@ -330,9 +355,10 @@ public class EditGeneralConfigAction extends ActionSupport
pvp2.setOrganization(pvp2org);
}
if (MiscUtil.isNotEmpty(moaconfig.getPvp2OrgDisplayName()))
- pvp2org.setDisplayName(moaconfig.getPvp2OrgDisplayName());
+ pvp2org.setDisplayName(StringHelper.getUTF8String(
+ moaconfig.getPvp2OrgDisplayName()));
if (MiscUtil.isNotEmpty(moaconfig.getPvp2OrgName()))
- pvp2org.setName(moaconfig.getPvp2OrgName());
+ pvp2org.setName(StringHelper.getUTF8String(moaconfig.getPvp2OrgName()));
if (MiscUtil.isNotEmpty(moaconfig.getPvp2OrgURL()))
pvp2org.setURL(moaconfig.getPvp2OrgURL());
@@ -349,10 +375,12 @@ public class EditGeneralConfigAction extends ActionSupport
Contact cont = pvp2cont.get(0);
if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getCompany()))
- cont.setCompany(moaconfig.getPvp2Contact().getCompany());
+ cont.setCompany(StringHelper.getUTF8String(
+ moaconfig.getPvp2Contact().getCompany()));
if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getGivenname()))
- cont.setGivenName(moaconfig.getPvp2Contact().getGivenname());
+ cont.setGivenName(StringHelper.getUTF8String(
+ moaconfig.getPvp2Contact().getGivenname()));
//TODO: change to list if required
if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getMail()))
@@ -361,7 +389,8 @@ public class EditGeneralConfigAction extends ActionSupport
cont.setPhone(Arrays.asList(moaconfig.getPvp2Contact().getPhone()));
if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getSurname()))
- cont.setSurName(moaconfig.getPvp2Contact().getSurname());
+ cont.setSurName(StringHelper.getUTF8String(
+ moaconfig.getPvp2Contact().getSurname()));
if (MiscUtil.isNotEmpty(moaconfig.getPvp2Contact().getType()))
cont.setType(moaconfig.getPvp2Contact().getType());
@@ -372,9 +401,11 @@ public class EditGeneralConfigAction extends ActionSupport
}
if (MiscUtil.isNotEmpty(moaconfig.getSsoFriendlyName()))
- dbsso.setFriendlyName(moaconfig.getSsoFriendlyName());
+ dbsso.setFriendlyName(StringHelper.getUTF8String(
+ moaconfig.getSsoFriendlyName()));
if (MiscUtil.isNotEmpty(moaconfig.getSsoSpecialText()))
- dbsso.setSpecialText(moaconfig.getSsoSpecialText());
+ dbsso.setSpecialText(StringHelper.getUTF8String(
+ moaconfig.getSsoSpecialText()));
// if (MiscUtil.isNotEmpty(moaconfig.getSsoPublicUrl()))
// dbsso.setPublicURL(moaconfig.getSsoPublicUrl());
@@ -417,6 +448,7 @@ public class EditGeneralConfigAction extends ActionSupport
// }
DefaultBKUs dbbkus = dbconfig.getDefaultBKUs();
+
if (dbbkus == null) {
dbbkus = new DefaultBKUs();
dbconfig.setDefaultBKUs(dbbkus);
@@ -480,16 +512,39 @@ public class EditGeneralConfigAction extends ActionSupport
//TODO: Set STORK Config!!!
if (oldauth != null) {
- ForeignIdentities oldforeign = oldauth.getForeignIdentities();
+ ForeignIdentities oldforeign = oldauth.getForeignIdentities();
if (oldforeign != null) {
STORK oldstork = oldforeign.getSTORK();
- if (oldstork != null)
+ if (oldstork == null)
oldstork = new STORK();
+ try {
+ log.error("QAAAA " + storkconfig.getDefaultQaa());
oldstork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa());
- oldstork.setAttributes(storkconfig.getAttributes());
- oldstork.setCPEPS(storkconfig.getCpepslist());
+
+ if (storkconfig.getAttributes() != null)
+ oldstork.setAttributes(storkconfig.getAttributes());
+
+ else
+ oldstork.setAttributes((List<StorkAttribute>) (new ArrayList<StorkAttribute>()));
+
+ if (storkconfig.getCpepslist() != null)
+ oldstork.setCPEPS(storkconfig.getCpepslist());
+
+ else
+ oldstork.setCPEPS((List<CPEPS>) (new ArrayList<CPEPS>()));
+
dbforeign.setSTORK(oldstork);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try{
+ log.error("CPEPS LIST: " + storkconfig.getCpepslist().size() );
+ log.error("CPEPS 1:" + storkconfig.getCpepslist().get(0).getCountryCode() +storkconfig.getCpepslist().get(0).getURL());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
}
}
@@ -631,6 +686,7 @@ public class EditGeneralConfigAction extends ActionSupport
*/
public void setMoaconfig(GeneralMOAIDConfig moaconfig) {
this.moaconfig = moaconfig;
+ log.error("MOA CONFIG SET");
}
/**
@@ -649,6 +705,7 @@ public class EditGeneralConfigAction extends ActionSupport
*/
public void setStorkconfig(GeneralStorkConfig storkconfig) {
this.storkconfig = storkconfig;
+ log.error("STORK CONFIG SET");
}
/**
@@ -664,8 +721,8 @@ public class EditGeneralConfigAction extends ActionSupport
public void setFormID(String formID) {
this.formID = formID;
}
-
-
+
+
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
index fd4030937..78747eca6 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java
@@ -22,1335 +22,1331 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.configuration.struts.action;
-import iaik.utils.URLDecoder;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.security.cert.CertificateException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.log4j.Logger;
-import org.apache.struts2.interceptor.ServletRequestAware;
-import org.apache.struts2.interceptor.ServletResponseAware;
-
import at.gv.egovernment.moa.id.auth.builder.LoginFormBuilder;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
-import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
-import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType;
-import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS;
-import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs;
-import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
-import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
-import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector;
-import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OASSO;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
-import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplicationType;
-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.TransformsInfoType;
-import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase;
+import at.gv.egovernment.moa.id.commons.db.dao.config.*;
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.id.configuration.Constants;
import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser;
import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.configuration.data.FormularCustomization;
-import at.gv.egovernment.moa.id.configuration.data.oa.OAGeneralConfig;
-import at.gv.egovernment.moa.id.configuration.data.oa.OAOAuth20Config;
-import at.gv.egovernment.moa.id.configuration.data.oa.OAPVP2Config;
-import at.gv.egovernment.moa.id.configuration.data.oa.OASAML1Config;
-import at.gv.egovernment.moa.id.configuration.data.oa.OASSOConfig;
-import at.gv.egovernment.moa.id.configuration.data.oa.OASTORKConfig;
+import at.gv.egovernment.moa.id.configuration.data.oa.*;
import at.gv.egovernment.moa.id.configuration.exception.ConfigurationException;
import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper;
import at.gv.egovernment.moa.id.configuration.helper.MailHelper;
+import at.gv.egovernment.moa.id.configuration.helper.StringHelper;
import at.gv.egovernment.moa.id.configuration.validation.FormularCustomizationValitator;
import at.gv.egovernment.moa.id.configuration.validation.TargetValidator;
import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OAFileUploadValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OAGeneralConfigValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OAOAUTH20ConfigValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OAPVP2ConfigValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OASAML1ConfigValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OASSOConfigValidation;
-import at.gv.egovernment.moa.id.configuration.validation.oa.OASTORKConfigValidation;
+import at.gv.egovernment.moa.id.configuration.validation.oa.*;
import at.gv.egovernment.moa.id.util.FormBuildUtils;
import at.gv.egovernment.moa.id.util.Random;
import at.gv.egovernment.moa.util.MiscUtil;
-
import com.opensymphony.xwork2.ActionSupport;
+import iaik.utils.URLDecoder;
+import org.apache.log4j.Logger;
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.ServletResponseAware;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.*;
+import java.math.BigInteger;
+import java.security.cert.CertificateException;
+import java.util.*;
public class EditOAAction extends ActionSupport implements ServletRequestAware, ServletResponseAware {
-
- private final Logger log = Logger.getLogger(EditOAAction.class);
-
- private static final long serialVersionUID = 1L;
-
- private HttpServletRequest request;
- private HttpServletResponse response;
-
- private AuthenticatedUser authUser;
-
- private String oaidobj;
- private boolean newOA;
- private String formID;
-
- private boolean onlyBusinessService = false;
- private boolean subTargetSet = false;
- private boolean deaktivededBusinessService = false;
- private boolean isMetaDataRefreshRequired = false;
-
- private String nextPage;
-
- private OAGeneralConfig generalOA = new OAGeneralConfig();
- private OAPVP2Config pvp2OA = new OAPVP2Config();
- private OASAML1Config saml1OA = new OASAML1Config();
- private OASSOConfig ssoOA = new OASSOConfig();
- private OAOAuth20Config oauth20OA = new OAOAuth20Config();
- private OASTORKConfig storkOA = new OASTORKConfig();
- private FormularCustomization formOA = new FormularCustomization();
-
- private InputStream stream;
-
- private Map<String, byte[]> sendAssertionForm = new HashMap<String, byte[]>();
- private Map<String, byte[]> bkuSelectionForm = new HashMap<String, byte[]>();
-
- // STRUTS actions
- public String inital() {
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- return Constants.STRUTS_ERROR;
- }
-
- Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
-
- authUser = (AuthenticatedUser) authUserObj;
-
- long oaid = -1;
-
- if (!ValidationHelper.validateOAID(oaidobj)) {
- addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
- return Constants.STRUTS_ERROR;
- }
- oaid = Long.valueOf(oaidobj);
-
- UserDatabase userdb = null;
- OnlineApplication onlineapplication = null;
-
- if (authUser.isAdmin())
- onlineapplication = ConfigurationDBRead.getOnlineApplication(oaid);
-
- else {
- userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
-
- if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
- log.info("Online-Applikation managemant disabled. Mail address is not verified.");
- addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
- return Constants.STRUTS_SUCCESS;
- }
-
- // TODO: change to direct Database operation
- List<OnlineApplication> oas = userdb.getOnlineApplication();
- for (OnlineApplication oa : oas) {
- if (oa.getHjid() == oaid) {
- onlineapplication = oa;
- break;
- }
- }
- if (onlineapplication == null) {
- addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
- return Constants.STRUTS_ERROR;
- }
- }
-
- generalOA.parse(onlineapplication);
- ssoOA.parse(onlineapplication);
- saml1OA.parse(onlineapplication);
- oauth20OA.parse(onlineapplication);
- session.setAttribute(Constants.SESSION_OAUTH20SECRET, this.oauth20OA.getClientSecret());
-
- storkOA.parse(onlineapplication);
-
- Map<String, String> map = new HashMap<String, String>();
- map.putAll(FormBuildUtils.getDefaultMap());
- formOA.parse(onlineapplication, map);
-
- session.setAttribute(Constants.SESSION_BKUFORMPREVIEW, map);
-
- List<String> errors = pvp2OA.parse(onlineapplication);
-
- if (errors.size() > 0) {
- for (String el : errors)
- addActionError(el);
- }
-
- subTargetSet = MiscUtil.isNotEmpty(generalOA.getTarget_subsector());
-
- // set UserSpezific OA Parameters
- if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
-
- ConfigurationDBUtils.closeSession();
- session.setAttribute(Constants.SESSION_OAID, oaid);
-
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
-
- newOA = false;
-
- return Constants.STRUTS_OA_EDIT;
- }
-
- public String newOA() {
- log.debug("insert new Online-Application");
-
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- return Constants.STRUTS_ERROR;
- }
-
- session.setAttribute(Constants.SESSION_OAID, null);
- nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
-
- Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
-
- authUser = (AuthenticatedUser) authUserObj;
-
- UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
-
- if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
- log.info("Online-Applikation managemant disabled. Mail address is not verified.");
- addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
- return Constants.STRUTS_SUCCESS;
- }
-
- MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
- if (moaidconfig != null) {
- DefaultBKUs defaultbkus = moaidconfig.getDefaultBKUs();
- if (defaultbkus != null) {
- generalOA.setBkuHandyURL(defaultbkus.getHandyBKU());
- generalOA.setBkuLocalURL(defaultbkus.getLocalBKU());
- generalOA.setBkuOnlineURL(defaultbkus.getOnlineBKU());
- }
- }
-
- // set UserSpezific OA Parameters
- if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
-
- ConfigurationDBUtils.closeSession();
-
- newOA = true;
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
-
- session.setAttribute(Constants.SESSION_BKUFORMPREVIEW, null);
-
- this.oauth20OA.generateClientSecret();
- session.setAttribute(Constants.SESSION_OAUTH20SECRET, this.oauth20OA.getClientSecret());
-
- return Constants.STRUTS_OA_EDIT;
- }
-
- public String saveOA() {
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- return Constants.STRUTS_ERROR;
- }
-
- Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
- authUser = (AuthenticatedUser) authUserObj;
-
- Object formidobj = session.getAttribute(Constants.SESSION_FORMID);
- if (formidobj != null && formidobj instanceof String) {
- String formid = (String) formidobj;
- if (!formid.equals(formID)) {
- log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
- + authUser.getGivenName() + authUser.getUserID());
- return Constants.STRUTS_ERROR;
- }
- } else {
- log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
- + authUser.getGivenName() + authUser.getUserID());
- return Constants.STRUTS_ERROR;
- }
- session.setAttribute(Constants.SESSION_FORMID, null);
-
- UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
- if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
- log.info("Online-Applikation managemant disabled. Mail address is not verified.");
- addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
- return Constants.STRUTS_SUCCESS;
- }
-
- OnlineApplication onlineapplication = null;
- List<String> errors = new ArrayList<String>();
-
- Object oadbid = request.getSession().getAttribute(Constants.SESSION_OAID);
- Long oaid = (long) -1;
-
- if (oadbid != null) {
- try {
- oaid = (Long) oadbid;
- if (oaid < 0 || oaid > Long.MAX_VALUE) {
- addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
- return Constants.STRUTS_ERROR;
- }
-
- }
- catch (Throwable t) {
- addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
- return Constants.STRUTS_ERROR;
- }
- }
-
- // valid DBID and check entry
- String oaidentifier = generalOA.getIdentifier();
- if (MiscUtil.isEmpty(oaidentifier)) {
- log.info("Empty OA identifier");
- errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.empty"));
-
- } else {
-
- if (!ValidationHelper.validateURL(oaidentifier)) {
- log.warn("OnlineapplikationIdentifier is not a valid URL: " + oaidentifier);
- errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.valid",
- new Object[] { ValidationHelper.getNotValidOAIdentifierCharacters() }));
- } else {
-
- if (oaid == -1) {
- onlineapplication = ConfigurationDBRead.getOnlineApplication(oaidentifier);
- newOA = true;
- if (onlineapplication != null) {
- log.info("The OAIdentifier is not unique");
- errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.notunique"));
- }
-
- } else {
- onlineapplication = ConfigurationDBRead.getOnlineApplication(oaid);
- if (!oaidentifier.equals(onlineapplication.getPublicURLPrefix())) {
-
- if (ConfigurationDBRead.getOnlineApplication(oaidentifier) != null) {
- log.info("The OAIdentifier is not unique");
- errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.notunique"));
- }
- }
- }
- }
- }
-
- // set UserSpezific OA Parameters
- if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
-
- // check form
- OAGeneralConfigValidation validatior_general = new OAGeneralConfigValidation();
- OAPVP2ConfigValidation validatior_pvp2 = new OAPVP2ConfigValidation();
- OASAML1ConfigValidation validatior_saml1 = new OASAML1ConfigValidation();
- OASSOConfigValidation validatior_sso = new OASSOConfigValidation();
- OASTORKConfigValidation validator_stork = new OASTORKConfigValidation();
- FormularCustomizationValitator validator_form = new FormularCustomizationValitator();
- OAOAUTH20ConfigValidation validatior_oauth20 = new OAOAUTH20ConfigValidation();
- OAFileUploadValidation valiator_fileUpload = new OAFileUploadValidation();
-
- errors.addAll(validatior_general.validate(generalOA, authUser.isAdmin()));
- errors.addAll(validatior_pvp2.validate(pvp2OA));
- errors.addAll(validatior_saml1.validate(saml1OA, generalOA));
- errors.addAll(validatior_sso.validate(ssoOA, authUser.isAdmin()));
- errors.addAll(validator_stork.validate(storkOA));
- errors.addAll(validator_form.validate(formOA));
- errors.addAll(validatior_oauth20.validate(oauth20OA));
-
- //validate BKU-selection template
- List<String> templateError = valiator_fileUpload.validate(generalOA.getBkuSelectionFileUploadFileName()
- , generalOA.getBkuSelectionFileUpload(), "validation.general.bkuselection", bkuSelectionForm);
- if (templateError != null && templateError.size() == 0) {
- if (bkuSelectionForm != null && bkuSelectionForm.size() > 0)
- session.setAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE, bkuSelectionForm);
-
- else
- bkuSelectionForm = (Map<String, byte[]>) session.getAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE);
-
- } else {
- errors.addAll(templateError);
-
- }
-
- //validate send-assertion template
- templateError = valiator_fileUpload.validate(generalOA.getSendAssertionFileUploadFileName()
- , generalOA.getSendAssertionFileUpload(), "validation.general.sendassertion", sendAssertionForm);
- if (templateError != null && templateError.size() == 0) {
- if (sendAssertionForm != null && sendAssertionForm.size() > 0)
- session.setAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE, sendAssertionForm);
-
- else
- sendAssertionForm = (Map<String, byte[]>) session.getAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE);
-
- } else {
- errors.addAll(templateError);
-
- }
-
-
- // Do not allow SSO in combination with special BKUSelection features
- if (ssoOA.isUseSSO() && (formOA.isOnlyMandateAllowed() || !formOA.isShowMandateLoginButton())) {
- log.warn("Special BKUSelection features can not be used in combination with SSO");
- errors.add(LanguageHelper.getErrorString("validation.general.bkuselection.specialfeatures.valid"));
- }
-
- if (errors.size() > 0) {
- log.info("OAConfiguration with ID " + generalOA.getIdentifier() + " has some errors.");
- for (String el : errors)
- addActionError(el);
-
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
- return Constants.STRUTS_ERROR_VALIDATION;
-
- } else {
-
- boolean newentry = false;
-
- if (onlineapplication == null) {
- onlineapplication = new OnlineApplication();
- newentry = true;
- onlineapplication.setIsActive(false);
-
- if (!authUser.isAdmin()) {
- onlineapplication.setIsAdminRequired(true);
-
- } else
- isMetaDataRefreshRequired = true;
-
- } else {
- if (!authUser.isAdmin() && !onlineapplication.getPublicURLPrefix().equals(generalOA.getIdentifier())) {
-
- onlineapplication.setIsAdminRequired(true);
- onlineapplication.setIsActive(false);
- log.info("User with ID " + authUser.getUserID() + " change OA-PublicURLPrefix. Reaktivation is required.");
- }
-
- }
-
- if ((onlineapplication.isIsAdminRequired() == null)
- || (authUser.isAdmin() && generalOA.isActive() && onlineapplication.isIsAdminRequired())) {
-
- onlineapplication.setIsAdminRequired(false);
- isMetaDataRefreshRequired = true;
-
- if (onlineapplication.getHjid() != null) userdb = ConfigurationDBRead.getUsersWithOADBID(onlineapplication.getHjid());
-
- if (userdb != null && !userdb.isIsAdmin()) {
- try {
- MailHelper.sendUserOnlineApplicationActivationMail(userdb.getGivenname(), userdb.getFamilyname(),
- userdb.getInstitut(), onlineapplication.getPublicURLPrefix(), userdb.getMail());
- }
- catch (ConfigurationException e) {
- log.warn("Sending Mail to User " + userdb.getMail() + " failed", e);
- }
- }
- }
-
- //save OA configuration
- String error = saveOAConfigToDatabase(onlineapplication, newentry);
- if (MiscUtil.isNotEmpty(error)) {
- log.warn("OA configuration can not be stored!");
- addActionError(error);
-
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
- return Constants.STRUTS_ERROR_VALIDATION;
- }
-
- //set metadata reload flag if reload is required
- if (pvp2OA.getMetaDataURL() != null) {
-
- try {
- if (isMetaDataRefreshRequired
- || !pvp2OA.getMetaDataURL().equals(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())
- || pvp2OA.getFileUpload() != null
- || pvp2OA.isReLoad()) {
-
- log.debug("Set PVP2 Metadata refresh flag.");
- MOAIDConfiguration moaconfig = ConfigurationDBRead.getMOAIDConfiguration();
- moaconfig.setPvp2RefreshItem(new Date());
- ConfigurationDBUtils.saveOrUpdate(moaconfig);
-
- }
- }
- catch (Throwable e) {
- log.info("Found no MetadataURL in OA-Databaseconfig!", e);
- }
-
- }
- }
-
- Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
- if (nextPageAttr != null && nextPageAttr instanceof String) {
- nextPage = (String) nextPageAttr;
- session.setAttribute(Constants.SESSION_RETURNAREA, null);
-
- } else {
- nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
- }
-
- if (onlineapplication.isIsAdminRequired()) {
- int numoas = 0;
- int numusers = 0;
-
- List<OnlineApplication> openOAs = ConfigurationDBRead.getAllNewOnlineApplications();
- if (openOAs != null) numoas = openOAs.size();
-
- List<UserDatabase> openUsers = ConfigurationDBRead.getAllNewUsers();
- if (openUsers != null) numusers = openUsers.size();
- try {
-
- addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.success.admin", generalOA.getIdentifier(), request));
-
- if (numusers > 0 || numoas > 0) MailHelper.sendAdminMail(numoas, numusers);
-
- }
- catch (ConfigurationException e) {
- log.warn("Sending Mail to Admin failed.", e);
- }
-
- } else
- addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.success", generalOA.getIdentifier(), request));
-
- //remove session attributes
- session.setAttribute(Constants.SESSION_OAID, null);
- session.removeAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE);
- session.removeAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE);
-
- ConfigurationDBUtils.closeSession();
- return Constants.STRUTS_SUCCESS;
- }
-
- public String cancleAndBackOA() {
-
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- return Constants.STRUTS_ERROR;
- }
-
- Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
- if (nextPageAttr != null && nextPageAttr instanceof String) {
- nextPage = (String) nextPageAttr;
- session.setAttribute(Constants.SESSION_RETURNAREA, null);
-
- } else {
- nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
- }
-
- session.setAttribute(Constants.SESSION_OAID, null);
-
- addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.cancle", generalOA.getIdentifier(), request));
-
- ConfigurationDBUtils.closeSession();
-
- return Constants.STRUTS_SUCCESS;
- }
-
- public String deleteOA() {
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- return Constants.STRUTS_ERROR;
- }
-
- Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
- authUser = (AuthenticatedUser) authUserObj;
-
- Object formidobj = session.getAttribute(Constants.SESSION_FORMID);
- if (formidobj != null && formidobj instanceof String) {
- String formid = (String) formidobj;
- if (!formid.equals(formID)) {
- log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
- + authUser.getGivenName() + authUser.getUserID());
- return Constants.STRUTS_ERROR;
- }
- } else {
- log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
- + authUser.getGivenName() + authUser.getUserID());
- return Constants.STRUTS_ERROR;
- }
- session.setAttribute(Constants.SESSION_FORMID, null);
-
- Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
- if (nextPageAttr != null && nextPageAttr instanceof String) {
- nextPage = (String) nextPageAttr;
-
- } else {
- nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
- }
-
- UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
- if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
- log.info("Online-Applikation managemant disabled. Mail address is not verified.");
- addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
- return Constants.STRUTS_SUCCESS;
- }
-
- String oaidentifier = generalOA.getIdentifier();
- if (MiscUtil.isEmpty(oaidentifier)) {
- log.info("Empty OA identifier");
- addActionError(LanguageHelper.getErrorString("validation.general.oaidentifier.empty"));
-
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
- return Constants.STRUTS_ERROR_VALIDATION;
-
- } else {
- if (ValidationHelper.isValidOAIdentifier(oaidentifier)) {
- log.warn("IdentificationNumber contains potentail XSS characters: " + oaidentifier);
- addActionError(LanguageHelper.getErrorString("validation.general.oaidentifier.valid",
- new Object[] { ValidationHelper.getNotValidOAIdentifierCharacters() }));
-
- formID = Random.nextRandom();
- session.setAttribute(Constants.SESSION_FORMID, formID);
- return Constants.STRUTS_ERROR_VALIDATION;
- }
- }
-
- OnlineApplication onlineapplication = ConfigurationDBRead.getOnlineApplication(oaidentifier);
- request.getSession().setAttribute(Constants.SESSION_OAID, null);
-
- try {
- if (MiscUtil.isNotEmpty(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())) {
-
- MOAIDConfiguration moaconfig = ConfigurationDBRead.getMOAIDConfiguration();
- moaconfig.setPvp2RefreshItem(new Date());
- ConfigurationDBUtils.saveOrUpdate(moaconfig);
-
- }
- }
- catch (Throwable e) {
- log.info("Found no MetadataURL in OA-Databaseconfig!", e);
- }
-
- if (ConfigurationDBUtils.delete(onlineapplication)) {
-
- if (!authUser.isAdmin()) {
- UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID());
- List<OnlineApplication> useroas = user.getOnlineApplication();
-
- for (OnlineApplicationType oa : useroas) {
- if (oa.getHjid().equals(onlineapplication.getHjid())) {
- useroas.remove(oa);
- }
- }
-
- try {
- ConfigurationDBUtils.saveOrUpdate(user);
-
- }
- catch (MOADatabaseException e) {
- log.warn("User information can not be updated in database", e);
- addActionError(LanguageHelper.getGUIString("error.db.oa.store", request));
- return Constants.STRUTS_ERROR;
- }
- }
-
- ConfigurationDBUtils.closeSession();
-
- addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.delete.message", generalOA.getIdentifier(), request));
-
- return Constants.STRUTS_SUCCESS;
-
- } else {
- ConfigurationDBUtils.closeSession();
- addActionError(LanguageHelper.getGUIString("webpages.oaconfig.delete.error", generalOA.getIdentifier(), request));
- return Constants.STRUTS_SUCCESS;
- }
-
- }
-
- public String bkuFramePreview() {
-
- String preview = null;
-
- HttpSession session = request.getSession();
- if (session == null) {
- log.info("No http Session found.");
- preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
-
- } else {
- InputStream input = null;
-
- try {
- Object mapobj = session.getAttribute(Constants.SESSION_BKUFORMPREVIEW);
- if (mapobj != null && mapobj instanceof Map<?, ?>) {
-
- ConfigurationProvider config = ConfigurationProvider.getInstance();
- String templateURL = config.getConfigRootDir() + ConfigurationProvider.HTMLTEMPLATE_DIR
- + ConfigurationProvider.HTMLTEMPLATE_FILE;
-
- File file = new File(templateURL);
- input = new FileInputStream(file);
-
- String contextpath = config.getMOAIDInstanceURL();
- if (MiscUtil.isEmpty(contextpath)) {
- log.info("NO MOA-ID instance URL configurated.");
- throw new ConfigurationException("No MOA-ID instance configurated");
- }
-
- preview = LoginFormBuilder.getTemplate(input);
- preview = preview.replace(LoginFormBuilder.CONTEXTPATH, contextpath);
-
- Map<String, String> map = (Map<String, String>) mapobj;
-
- request.setCharacterEncoding("UTF-8");
-
- String module = request.getParameter(Constants.REQUEST_FORMCUSTOM_MODULE);
- String value = request.getParameter(Constants.REQUEST_FORMCUSTOM_VALUE);
-
- if (value != null) {
- String[] query = URLDecoder.decode(request.getQueryString()).split("&");
- value = query[1].substring("value=".length());
- }
-
- synchronized (map) {
-
- if (MiscUtil.isNotEmpty(module)) {
- if (map.containsKey("#" + module + "#")) {
- if (MiscUtil.isNotEmpty(value)) {
- if (FormBuildUtils.FONTFAMILY.contains(module) || FormBuildUtils.HEADER_TEXT.contains(module)
- || value.startsWith("#"))
- map.put("#" + module + "#", value);
- else
- map.put("#" + module + "#", "#" + value);
-
- } else {
- map.put("#" + module + "#", FormBuildUtils.getDefaultMap().get("#" + module + "#"));
- }
- }
- }
- preview = FormBuildUtils.customiceLayoutBKUSelection(preview, true, false, map, true);
- }
-
- } else {
- preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
-
- }
-
- }
- catch (Exception e) {
- log.warn("BKUSelection Preview can not be generated.", e);
- preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
-
- }
- }
-
- stream = new ByteArrayInputStream(preview.getBytes());
-
- return Constants.STRUTS_SUCCESS;
- }
-
- private String saveOAConfigToDatabase(OnlineApplication dboa, boolean newentry) {
-
- AuthComponentOA authoa = dboa.getAuthComponentOA();
- if (authoa == null) {
- authoa = new AuthComponentOA();
- dboa.setAuthComponentOA(authoa);
- }
-
- if (authUser.isAdmin()) dboa.setIsActive(generalOA.isActive());
-
- dboa.setFriendlyName(generalOA.getFriendlyName());
- dboa.setCalculateHPI(generalOA.isCalculateHPI());
- dboa.setRemoveBPKFromAuthBlock(generalOA.isHideBPKAuthBlock());
-
- if (authUser.isAdmin())
- dboa.setKeyBoxIdentifier(MOAKeyBoxSelector.fromValue(generalOA.getKeyBoxIdentifier()));
- else {
- if (newentry) dboa.setKeyBoxIdentifier(MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR);
- }
-
- dboa.setPublicURLPrefix(generalOA.getIdentifier());
-
- if (generalOA.isBusinessService() || onlyBusinessService) {
-
- dboa.setType(Constants.MOA_CONFIG_BUSINESSSERVICE);
-
- String num = generalOA.getIdentificationNumber().replaceAll(" ", "");
- if (num.startsWith(Constants.IDENIFICATIONTYPE_FN)) {
- num = num.substring(Constants.IDENIFICATIONTYPE_FN.length());
-
- num = at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(num);
-
- // num = StringUtils.leftPad(num, 7, '0');
- }
-
- if (num.startsWith(Constants.IDENIFICATIONTYPE_ZVR)) num = num.substring(Constants.IDENIFICATIONTYPE_ZVR.length());
-
- if (num.startsWith(Constants.IDENIFICATIONTYPE_ERSB)) num = num.substring(Constants.IDENIFICATIONTYPE_ERSB.length());
-
- IdentificationNumber idnumber = new IdentificationNumber();
- idnumber.setValue(Constants.PREFIX_WPBK + generalOA.getIdentificationType() + "+" + num);
- idnumber.setType(Constants.BUSINESSSERVICENAMES.get(generalOA.getIdentificationType()));
-
- authoa.setIdentificationNumber(idnumber);
-
- } else {
- dboa.setType(null);
-
- if (authUser.isAdmin()) {
- if (MiscUtil.isNotEmpty(generalOA.getTarget_admin()) && generalOA.isAdminTarget()) {
- dboa.setTarget(generalOA.getTarget_admin());
- dboa.setTargetFriendlyName(generalOA.getTargetFriendlyName());
-
- } else {
-
- String target = generalOA.getTarget();
-
- if (MiscUtil.isNotEmpty(generalOA.getTarget_subsector()) && subTargetSet)
- dboa.setTarget(target + "-" + generalOA.getTarget_subsector());
- else
- dboa.setTarget(target);
-
- String targetname = TargetValidator.getTargetFriendlyName(target);
- if (MiscUtil.isNotEmpty(targetname)) dboa.setTargetFriendlyName(targetname);
-
- }
-
- } else {
-
- if (MiscUtil.isNotEmpty(generalOA.getTarget())) {
-
- String target = generalOA.getTarget();
-
- if (MiscUtil.isNotEmpty(generalOA.getTarget_subsector()) && subTargetSet)
- dboa.setTarget(target + "-" + generalOA.getTarget_subsector());
-
- else
- dboa.setTarget(target);
-
- String targetname = TargetValidator.getTargetFriendlyName(target);
- if (MiscUtil.isNotEmpty(targetname)) dboa.setTargetFriendlyName(targetname);
-
- }
- }
- }
-
- //store BKU-URLs
- BKUURLS bkuruls = new BKUURLS();
- authoa.setBKUURLS(bkuruls);
- if (authUser.isAdmin()) {
- bkuruls.setHandyBKU(generalOA.getBkuHandyURL());
- bkuruls.setLocalBKU(generalOA.getBkuLocalURL());
- bkuruls.setOnlineBKU(generalOA.getBkuOnlineURL());
- }
-
- TemplatesType templates = authoa.getTemplates();
- if (templates == null) {
- templates = new TemplatesType();
- authoa.setTemplates(templates);
- }
-
- //store BKU-selection and send-assertion templates
- if (authUser.isAdmin()) {
-
- if(generalOA.isDeleteBKUTemplate())
- templates.setBKUSelectionTemplate(null);
-
- if (generalOA.isDeleteSendAssertionTemplate())
- templates.setSendAssertionTemplate(null);
-
-
- if (bkuSelectionForm != null && bkuSelectionForm.size() > 0) {
- TransformsInfoType template = new TransformsInfoType();
-
- Iterator<String> interator = bkuSelectionForm.keySet().iterator();
- template.setFilename(interator.next());
- template.setTransformation(bkuSelectionForm.get(
- template.getFilename()));
-
- templates.setBKUSelectionTemplate(template);
- }
-
- if (sendAssertionForm != null && sendAssertionForm.size() > 0) {
- TransformsInfoType template = new TransformsInfoType();
-
- Iterator<String> interator = sendAssertionForm.keySet().iterator();
- template.setFilename(interator.next());
- template.setTransformation(sendAssertionForm.get(
- template.getFilename()));
-
- templates.setSendAssertionTemplate(template);
- }
- }
-
-
- //store BKU-selection customization
- BKUSelectionCustomizationType bkuselectioncustom = templates.getBKUSelectionCustomization();
- if (bkuselectioncustom == null) {
- bkuselectioncustom = new BKUSelectionCustomizationType();
- templates.setBKUSelectionCustomization(bkuselectioncustom);
- }
-
- Mandates mandates = new Mandates();
- if (generalOA.isUseMandates()) {
- mandates.setProfiles(generalOA.getMandateProfiles());
-
- } else {
- mandates.setProfiles(new String());
- }
-
- authoa.setMandates(mandates);
- bkuselectioncustom.setMandateLoginButton(MiscUtil.isNotEmpty(generalOA.getMandateProfiles()));
- bkuselectioncustom.setOnlyMandateLoginAllowed(formOA.isOnlyMandateAllowed());
-
- if (authUser.isAdmin()) {
- templates.setAditionalAuthBlockText(generalOA.getAditionalAuthBlockText());
-
- List<TemplateType> template = templates.getTemplate();
- if (generalOA.isLegacy()) {
-
- if (template == null)
- template = new ArrayList<TemplateType>();
- else
- template.clear();
-
- if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL1())) {
- TemplateType el = new TemplateType();
- el.setURL(generalOA.getSLTemplateURL1());
- template.add(el);
- } else
- template.add(new TemplateType());
- if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL2())) {
- TemplateType el = new TemplateType();
- el.setURL(generalOA.getSLTemplateURL2());
- template.add(el);
- }else
- template.add(new TemplateType());
- if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL3())) {
- TemplateType el = new TemplateType();
- el.setURL(generalOA.getSLTemplateURL3());
- template.add(el);
- }else
- template.add(new TemplateType());
-
- } else {
- if (template != null && template.size() > 0) template.clear();
- }
-
- bkuselectioncustom.setBackGroundColor(parseColor(formOA.getBackGroundColor()));
- bkuselectioncustom.setFrontColor(parseColor(formOA.getFrontColor()));
-
- bkuselectioncustom.setHeaderBackGroundColor(parseColor(formOA.getHeader_BackGroundColor()));
- bkuselectioncustom.setHeaderFrontColor(parseColor(formOA.getHeader_FrontColor()));
- bkuselectioncustom.setHeaderText(formOA.getHeader_text());
-
- bkuselectioncustom.setButtonBackGroundColor(parseColor(formOA.getButton_BackGroundColor()));
- bkuselectioncustom.setButtonBackGroundColorFocus(parseColor(formOA.getButton_BackGroundColorFocus()));
- bkuselectioncustom.setButtonFontColor(parseColor(formOA.getButton_FrontColor()));
-
- if (MiscUtil.isNotEmpty(formOA.getAppletRedirectTarget()))
- bkuselectioncustom.setAppletRedirectTarget(formOA.getAppletRedirectTarget());
-
- bkuselectioncustom.setFontType(formOA.getFontType());
-
- bkuselectioncustom.setAppletHeight(formOA.getApplet_height());
- bkuselectioncustom.setAppletWidth(formOA.getApplet_width());
-
- }
-
- // set default transformation if it is empty
- List<TransformsInfoType> transformsInfo = authoa.getTransformsInfo();
- if (transformsInfo == null) {
- // TODO: set OA specific transformation if it is required
-
- }
-
- OAPVP2 pvp2 = authoa.getOAPVP2();
- if (pvp2 == null) {
- pvp2 = new OAPVP2();
- authoa.setOAPVP2(pvp2);
- }
-
- pvp2.setMetadataURL(pvp2OA.getMetaDataURL());
- try {
-
- if (pvp2OA.getFileUpload() != null) pvp2.setCertificate(pvp2OA.getCertificate());
-
- }
- catch (CertificateException e) {
- log.info("Uploaded Certificate can not be found", e);
- return LanguageHelper.getErrorString("validation.pvp2.certificate.notfound");
- }
- catch (IOException e) {
- log.info("Uploaded Certificate can not be parsed", e);
- return LanguageHelper.getErrorString("validation.pvp2.certificate.format");
- }
-
- OASAML1 saml1 = authoa.getOASAML1();
- if (saml1 == null) {
- saml1 = new OASAML1();
- authoa.setOASAML1(saml1);
- saml1.setIsActive(false);
- }
-
- if (authUser.isAdmin()) {
- saml1.setIsActive(saml1OA.isActive());
- }
-
- if (saml1.isIsActive() != null && saml1.isIsActive()) {
- saml1.setProvideAUTHBlock(saml1OA.isProvideAuthBlock());
- saml1.setProvideCertificate(saml1OA.isProvideCertificate());
- saml1.setProvideFullMandatorData(saml1OA.isProvideFullMandateData());
- saml1.setProvideIdentityLink(saml1OA.isProvideIdentityLink());
- saml1.setProvideStammzahl(saml1OA.isProvideStammZahl());
- saml1.setUseCondition(saml1OA.isUseCondition());
- saml1.setConditionLength(BigInteger.valueOf(saml1OA.getConditionLength()));
- // TODO: set sourceID
- // saml1.setSourceID("");
- }
-
- OASSO sso = authoa.getOASSO();
- if (sso == null) {
- sso = new OASSO();
- authoa.setOASSO(sso);
- sso.setAuthDataFrame(true);
- }
- sso.setUseSSO(ssoOA.isUseSSO());
-
- if (authUser.isAdmin()) sso.setAuthDataFrame(ssoOA.isShowAuthDataFrame());
-
- sso.setSingleLogOutURL(ssoOA.getSingleLogOutURL());
-
- if (oauth20OA != null) {
- log.debug("Saving OAuth 2.0 configuration:");
- OAOAUTH20 oaOAuth20 = authoa.getOAOAUTH20();
- if (oaOAuth20 == null) {
- oaOAuth20 = new OAOAUTH20();
- authoa.setOAOAUTH20(oaOAuth20);
- }
-
- oaOAuth20.setOAuthClientId(generalOA.getIdentifier());
- // oaOAuth20.setOAuthClientSecret(oauth20OA.getClientSecret());
- oaOAuth20.setOAuthRedirectUri(oauth20OA.getRedirectUri());
- log.debug("client id: " + oauth20OA.getClientId());
- log.debug("client secret: " + oauth20OA.getClientSecret());
- log.debug("redirect uri:" + oauth20OA.getRedirectUri());
-
- oaOAuth20.setOAuthClientSecret((String) request.getSession().getAttribute(Constants.SESSION_OAUTH20SECRET));
- request.getSession().setAttribute(Constants.SESSION_OAUTH20SECRET, null);
-
- }
-
-
- // fetch stork configuration from database model
- OASTORK stork = authoa.getOASTORK();
- if (stork == null) {
- // if there is none, create a new one with default values.
- stork = new OASTORK();
- authoa.setOASTORK(stork);
- stork.setStorkLogonEnabled(false);
- }
- // transfer the incoming data to the database model
- stork.setStorkLogonEnabled(storkOA.isStorkLogonEnabled());
- stork.setQaa(storkOA.getQaa());
- stork.setOAAttributes(storkOA.getAttributes());
-
- try {
- if (newentry) {
- ConfigurationDBUtils.save(dboa);
-
- if (!authUser.isAdmin()) {
- UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID());
-
- List<OnlineApplication> useroas = user.getOnlineApplication();
- if (useroas == null) useroas = new ArrayList<OnlineApplication>();
-
- useroas.add(dboa);
- ConfigurationDBUtils.saveOrUpdate(user);
- }
- }
-
- else
- ConfigurationDBUtils.saveOrUpdate(dboa);
-
- }
- catch (MOADatabaseException e) {
- log.warn("Online-Application can not be stored.", e);
- return LanguageHelper.getErrorString("error.db.oa.store");
- }
-
- return null;
- }
-
- private String parseColor(String color) {
- String value = "";
-
- if (MiscUtil.isNotEmpty(color)) {
- if (!color.startsWith("#"))
- value = "#" + color;
- else
- value = color;
- }
- return value;
- }
-
- private void generateUserSpecificConfigurationOptions(UserDatabase userdb) {
-
- if (userdb.isIsMandateUser() != null && userdb.isIsMandateUser()) {
- String bpk = userdb.getBpk();
- if (bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_FN) || bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_ZVR)) {
-
- onlyBusinessService = true;
- generalOA.setBusinessService(true);
-
- }
-
- deaktivededBusinessService = true;
- String[] split = bpk.split("\\+");
- generalOA.setIdentificationType(split[1].substring(1));
-
- if (bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_FN))
- generalOA.setIdentificationNumber(at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(split[2]));
- else
- generalOA.setIdentificationNumber(split[2]);
-
- }
-
- }
-
- public String setGeneralOAConfig() {
-
- return Constants.STRUTS_SUCCESS;
- }
-
- public String setSAML1OAConfig() {
-
- return Constants.STRUTS_SUCCESS;
- }
-
- public String setPVP2OAConfig() {
-
- return Constants.STRUTS_SUCCESS;
- }
-
- public String setSSOOAConfig() {
-
- return Constants.STRUTS_SUCCESS;
- }
-
- public String setSTORKOAConfig() {
-
- return Constants.STRUTS_SUCCESS;
- }
-
- // Getter and Setter
- public void setServletResponse(HttpServletResponse arg0) {
- this.response = arg0;
-
- }
-
- public void setServletRequest(HttpServletRequest arg0) {
- this.request = arg0;
-
- }
-
- public HttpServletRequest getRequest() {
- return request;
- }
-
- public void setRequest(HttpServletRequest request) {
- this.request = request;
- }
-
- public HttpServletResponse getResponse() {
- return response;
- }
-
- public void setResponse(HttpServletResponse response) {
- this.response = response;
- }
-
- public OAGeneralConfig getGeneralOA() {
- return generalOA;
- }
-
- public void setGeneralOA(OAGeneralConfig generalOA) {
- this.generalOA = generalOA;
- }
-
- public OAPVP2Config getPvp2OA() {
- return pvp2OA;
- }
-
- public void setPvp2OA(OAPVP2Config pvp2oa) {
- pvp2OA = pvp2oa;
- }
-
- public OASAML1Config getSaml1OA() {
- return saml1OA;
- }
-
- public void setSaml1OA(OASAML1Config saml1oa) {
- saml1OA = saml1oa;
- }
-
- public OASSOConfig getSsoOA() {
- return ssoOA;
- }
-
- public void setSsoOA(OASSOConfig ssoOA) {
- this.ssoOA = ssoOA;
- }
-
- public OASTORKConfig getStorkOA() {
- return storkOA;
- }
-
- public void setStorkOA(OASTORKConfig storkOA) {
- this.storkOA = storkOA;
- }
-
- /**
- * @param oaidobj
- * the oaidobj to set
- */
- public void setOaidobj(String oaidobj) {
- this.oaidobj = oaidobj;
- }
-
- /**
- * @return the authUser
- */
- public AuthenticatedUser getAuthUser() {
- return authUser;
- }
-
- /**
- * @return the newOA
- */
- public boolean isNewOA() {
- return newOA;
- }
-
- /**
- * @param newOA
- * the newOA to set
- */
- public void setNewOA(boolean newOA) {
- this.newOA = newOA;
- }
-
- /**
- * @return the nextPage
- */
- public String getNextPage() {
- return nextPage;
- }
-
- /**
- * @return the formID
- */
- public String getFormID() {
- return formID;
- }
-
- /**
- * @param formID
- * the formID to set
- */
- public void setFormID(String formID) {
- this.formID = formID;
- }
-
- /**
- * @return the onlyBusinessService
- */
- public boolean isOnlyBusinessService() {
- return onlyBusinessService;
- }
-
- /**
- * @param onlyBusinessService
- * the onlyBusinessService to set
- */
- public void setOnlyBusinessService(boolean onlyBusinessService) {
- this.onlyBusinessService = onlyBusinessService;
- }
-
- /**
- * @return the subTargetSet
- */
- public boolean isSubTargetSet() {
- return subTargetSet;
- }
-
- /**
- * @param subTargetSet
- * the subTargetSet to set
- */
- public void setSubTargetSet(boolean subTargetSet) {
- this.subTargetSet = subTargetSet;
- }
-
- /**
- * @return the deaktivededBusinessService
- */
- public boolean isDeaktivededBusinessService() {
- return deaktivededBusinessService;
- }
-
- /**
- * @param deaktivededBusinessService
- * the deaktivededBusinessService to set
- */
- public void setDeaktivededBusinessService(boolean deaktivededBusinessService) {
- this.deaktivededBusinessService = deaktivededBusinessService;
- }
-
- /**
- * @return the formOA
- */
- public FormularCustomization getFormOA() {
- return formOA;
- }
-
- /**
- * @param formOA
- * the formOA to set
- */
- public void setFormOA(FormularCustomization formOA) {
- this.formOA = formOA;
- }
-
- /**
- * @return the stream
- */
- public InputStream getStream() {
- return stream;
- }
-
- public OAOAuth20Config getOauth20OA() {
- return oauth20OA;
- }
-
- public void setOauth20OA(OAOAuth20Config oauth20OA) {
- this.oauth20OA = oauth20OA;
- }
-
+
+ private final Logger log = Logger.getLogger(EditOAAction.class);
+
+ private static final long serialVersionUID = 1L;
+
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ private AuthenticatedUser authUser;
+
+ private String oaidobj;
+ private boolean newOA;
+ private String formID;
+
+ private boolean onlyBusinessService = false;
+ private boolean onlyStorkService = false;
+ private boolean subTargetSet = false;
+ private boolean deaktivededBusinessService = false;
+ private boolean deactivatedStorkService = false;
+ private boolean isMetaDataRefreshRequired = false;
+
+ private String nextPage;
+
+ private OAGeneralConfig generalOA = new OAGeneralConfig();
+ private OAPVP2Config pvp2OA = new OAPVP2Config();
+ private OASAML1Config saml1OA = new OASAML1Config();
+ private OASSOConfig ssoOA = new OASSOConfig();
+ private OAOAuth20Config oauth20OA = new OAOAuth20Config();
+ private OASTORKConfig storkOA = new OASTORKConfig();
+ private FormularCustomization formOA = new FormularCustomization();
+
+ private InputStream stream;
+
+ private Map<String, byte[]> sendAssertionForm = new HashMap<String, byte[]>();
+ private Map<String, byte[]> bkuSelectionForm = new HashMap<String, byte[]>();
+
+ // STRUTS actions
+ public String inital() {
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ return Constants.STRUTS_ERROR;
+ }
+
+ Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
+
+ authUser = (AuthenticatedUser) authUserObj;
+
+ long oaid = -1;
+
+ if (!ValidationHelper.validateOAID(oaidobj)) {
+ addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
+ return Constants.STRUTS_ERROR;
+ }
+ oaid = Long.valueOf(oaidobj);
+
+ UserDatabase userdb = null;
+ OnlineApplication onlineapplication = null;
+
+ if (authUser.isAdmin())
+ onlineapplication = ConfigurationDBRead.getOnlineApplication(oaid);
+
+ else {
+ userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+
+ if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
+ log.info("Online-Applikation managemant disabled. Mail address is not verified.");
+ addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ // TODO: change to direct Database operation
+ List<OnlineApplication> oas = userdb.getOnlineApplication();
+ for (OnlineApplication oa : oas) {
+ if (oa.getHjid() == oaid) {
+ onlineapplication = oa;
+ break;
+ }
+ }
+ if (onlineapplication == null) {
+ addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
+ return Constants.STRUTS_ERROR;
+ }
+ }
+
+ generalOA.parse(onlineapplication);
+ ssoOA.parse(onlineapplication);
+ saml1OA.parse(onlineapplication);
+ oauth20OA.parse(onlineapplication);
+ session.setAttribute(Constants.SESSION_OAUTH20SECRET, this.oauth20OA.getClientSecret());
+
+ storkOA.parse(onlineapplication);
+
+ Map<String, String> map = new HashMap<String, String>();
+ map.putAll(FormBuildUtils.getDefaultMap());
+ formOA.parse(onlineapplication, map);
+
+ session.setAttribute(Constants.SESSION_BKUFORMPREVIEW, map);
+
+ List<String> errors = pvp2OA.parse(onlineapplication);
+
+ if (errors.size() > 0) {
+ for (String el : errors)
+ addActionError(el);
+ }
+
+ subTargetSet = MiscUtil.isNotEmpty(generalOA.getTarget_subsector());
+
+ // set UserSpezific OA Parameters
+ if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
+
+ ConfigurationDBUtils.closeSession();
+ session.setAttribute(Constants.SESSION_OAID, oaid);
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
+ newOA = false;
+
+ return Constants.STRUTS_OA_EDIT;
+ }
+
+ public String newOA() {
+ log.debug("insert new Online-Application");
+
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ return Constants.STRUTS_ERROR;
+ }
+
+ session.setAttribute(Constants.SESSION_OAID, null);
+ nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
+
+ Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
+
+ authUser = (AuthenticatedUser) authUserObj;
+
+ UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+
+ if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
+ log.info("Online-Applikation managemant disabled. Mail address is not verified.");
+ addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
+ if (moaidconfig != null) {
+ DefaultBKUs defaultbkus = moaidconfig.getDefaultBKUs();
+ if (defaultbkus != null) {
+ generalOA.setBkuHandyURL(defaultbkus.getHandyBKU());
+ generalOA.setBkuLocalURL(defaultbkus.getLocalBKU());
+ generalOA.setBkuOnlineURL(defaultbkus.getOnlineBKU());
+ }
+ }
+
+ // set UserSpezific OA Parameters
+ if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
+
+ ConfigurationDBUtils.closeSession();
+
+ //VIDP attribute provider configuration
+ storkOA = new OASTORKConfig();
+ storkOA.getAttributeProviderPlugins().add(new AttributeProviderPlugin());
+
+ newOA = true;
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
+ session.setAttribute(Constants.SESSION_BKUFORMPREVIEW, null);
+
+ this.oauth20OA.generateClientSecret();
+ session.setAttribute(Constants.SESSION_OAUTH20SECRET, this.oauth20OA.getClientSecret());
+
+ return Constants.STRUTS_OA_EDIT;
+ }
+
+ public String saveOA() {
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ return Constants.STRUTS_ERROR;
+ }
+
+ Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
+ authUser = (AuthenticatedUser) authUserObj;
+
+ Object formidobj = session.getAttribute(Constants.SESSION_FORMID);
+ if (formidobj != null && formidobj instanceof String) {
+ String formid = (String) formidobj;
+ if (!formid.equals(formID)) {
+ log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
+ + authUser.getGivenName() + authUser.getUserID());
+ return Constants.STRUTS_ERROR;
+ }
+ } else {
+ log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
+ + authUser.getGivenName() + authUser.getUserID());
+ return Constants.STRUTS_ERROR;
+ }
+ session.setAttribute(Constants.SESSION_FORMID, null);
+
+ UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+ if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
+ log.info("Online-Applikation managemant disabled. Mail address is not verified.");
+ addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ OnlineApplication onlineapplication = null;
+ List<String> errors = new ArrayList<String>();
+
+ Object oadbid = request.getSession().getAttribute(Constants.SESSION_OAID);
+ Long oaid = (long) -1;
+
+ if (oadbid != null) {
+ try {
+ oaid = (Long) oadbid;
+ if (oaid < 0 || oaid > Long.MAX_VALUE) {
+ addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
+ return Constants.STRUTS_ERROR;
+ }
+
+ } catch (Throwable t) {
+ addActionError(LanguageHelper.getErrorString("errors.edit.oa.oaid", request));
+ return Constants.STRUTS_ERROR;
+ }
+ }
+
+ // valid DBID and check entry
+ String oaidentifier = generalOA.getIdentifier();
+ if (MiscUtil.isEmpty(oaidentifier)) {
+ log.info("Empty OA identifier");
+ errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.empty"));
+
+ } else {
+
+ if (!ValidationHelper.validateURL(oaidentifier)) {
+ log.warn("OnlineapplikationIdentifier is not a valid URL: " + oaidentifier);
+ errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.valid",
+ new Object[]{ValidationHelper.getNotValidOAIdentifierCharacters()}));
+ } else {
+
+ if (oaid == -1) {
+ onlineapplication = ConfigurationDBRead.getOnlineApplication(oaidentifier);
+ newOA = true;
+ if (onlineapplication != null) {
+ log.info("The OAIdentifier is not unique");
+ errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.notunique"));
+ }
+
+ } else {
+ onlineapplication = ConfigurationDBRead.getOnlineApplication(oaid);
+ if (!oaidentifier.equals(onlineapplication.getPublicURLPrefix())) {
+
+ if (ConfigurationDBRead.getOnlineApplication(oaidentifier) != null) {
+ log.info("The OAIdentifier is not unique");
+ errors.add(LanguageHelper.getErrorString("validation.general.oaidentifier.notunique"));
+ }
+ }
+ }
+ }
+ }
+
+ // set UserSpezific OA Parameters
+ if (!authUser.isAdmin()) generateUserSpecificConfigurationOptions(userdb);
+
+ // check form
+ OAGeneralConfigValidation validatior_general = new OAGeneralConfigValidation();
+ OAPVP2ConfigValidation validatior_pvp2 = new OAPVP2ConfigValidation();
+ OASAML1ConfigValidation validatior_saml1 = new OASAML1ConfigValidation();
+ OASSOConfigValidation validatior_sso = new OASSOConfigValidation();
+ OASTORKConfigValidation validator_stork = new OASTORKConfigValidation();
+ FormularCustomizationValitator validator_form = new FormularCustomizationValitator();
+ OAOAUTH20ConfigValidation validatior_oauth20 = new OAOAUTH20ConfigValidation();
+ OAFileUploadValidation valiator_fileUpload = new OAFileUploadValidation();
+
+ errors.addAll(validatior_general.validate(generalOA, authUser.isAdmin()));
+ errors.addAll(validatior_pvp2.validate(pvp2OA));
+ errors.addAll(validatior_saml1.validate(saml1OA, generalOA));
+ errors.addAll(validatior_sso.validate(ssoOA, authUser.isAdmin()));
+ errors.addAll(validator_stork.validate(storkOA));
+ errors.addAll(validator_form.validate(formOA));
+ errors.addAll(validatior_oauth20.validate(oauth20OA));
+
+ //validate BKU-selection template
+ List<String> templateError = valiator_fileUpload.validate(generalOA.getBkuSelectionFileUploadFileName()
+ , generalOA.getBkuSelectionFileUpload(), "validation.general.bkuselection", bkuSelectionForm);
+ if (templateError != null && templateError.size() == 0) {
+ if (bkuSelectionForm != null && bkuSelectionForm.size() > 0)
+ session.setAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE, bkuSelectionForm);
+
+ else
+ bkuSelectionForm = (Map<String, byte[]>) session.getAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE);
+
+ } else {
+ errors.addAll(templateError);
+
+ }
+
+ //validate send-assertion template
+ templateError = valiator_fileUpload.validate(generalOA.getSendAssertionFileUploadFileName()
+ , generalOA.getSendAssertionFileUpload(), "validation.general.sendassertion", sendAssertionForm);
+ if (templateError != null && templateError.size() == 0) {
+ if (sendAssertionForm != null && sendAssertionForm.size() > 0)
+ session.setAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE, sendAssertionForm);
+
+ else
+ sendAssertionForm = (Map<String, byte[]>) session.getAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE);
+
+ } else {
+ errors.addAll(templateError);
+
+ }
+
+
+ // Do not allow SSO in combination with special BKUSelection features
+ if (ssoOA.isUseSSO() && (formOA.isOnlyMandateAllowed() || !formOA.isShowMandateLoginButton())) {
+ log.warn("Special BKUSelection features can not be used in combination with SSO");
+ errors.add(LanguageHelper.getErrorString("validation.general.bkuselection.specialfeatures.valid"));
+ }
+
+ if (errors.size() > 0) {
+ log.info("OAConfiguration with ID " + generalOA.getIdentifier() + " has some errors.");
+ for (String el : errors)
+ addActionError(el);
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+ return Constants.STRUTS_ERROR_VALIDATION;
+
+ } else {
+
+ boolean newentry = false;
+
+ if (onlineapplication == null) {
+ onlineapplication = new OnlineApplication();
+ newentry = true;
+ onlineapplication.setIsActive(false);
+
+ if (!authUser.isAdmin()) {
+ onlineapplication.setIsAdminRequired(true);
+
+ } else
+ isMetaDataRefreshRequired = true;
+
+ } else {
+ if (!authUser.isAdmin() && !onlineapplication.getPublicURLPrefix().equals(generalOA.getIdentifier())) {
+
+ onlineapplication.setIsAdminRequired(true);
+ onlineapplication.setIsActive(false);
+ log.info("User with ID " + authUser.getUserID() + " change OA-PublicURLPrefix. Reaktivation is required.");
+ }
+
+ }
+
+ if ((onlineapplication.isIsAdminRequired() == null)
+ || (authUser.isAdmin() && generalOA.isActive() && onlineapplication.isIsAdminRequired())) {
+
+ onlineapplication.setIsAdminRequired(false);
+ isMetaDataRefreshRequired = true;
+
+ if (onlineapplication.getHjid() != null)
+ userdb = ConfigurationDBRead.getUsersWithOADBID(onlineapplication.getHjid());
+
+ if (userdb != null && !userdb.isIsAdmin()) {
+ try {
+ MailHelper.sendUserOnlineApplicationActivationMail(userdb.getGivenname(), userdb.getFamilyname(),
+ userdb.getInstitut(), onlineapplication.getPublicURLPrefix(), userdb.getMail());
+ } catch (ConfigurationException e) {
+ log.warn("Sending Mail to User " + userdb.getMail() + " failed", e);
+ }
+ }
+ }
+
+ //save OA configuration
+ String error = saveOAConfigToDatabase(onlineapplication, newentry);
+ if (MiscUtil.isNotEmpty(error)) {
+ log.warn("OA configuration can not be stored!");
+ addActionError(error);
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+ return Constants.STRUTS_ERROR_VALIDATION;
+ }
+
+ //set metadata reload flag if reload is required
+ if (pvp2OA.getMetaDataURL() != null) {
+
+ try {
+ if (isMetaDataRefreshRequired
+ || !pvp2OA.getMetaDataURL().equals(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())
+ || pvp2OA.getFileUpload() != null
+ || pvp2OA.isReLoad()) {
+
+ log.debug("Set PVP2 Metadata refresh flag.");
+ MOAIDConfiguration moaconfig = ConfigurationDBRead.getMOAIDConfiguration();
+ moaconfig.setPvp2RefreshItem(new Date());
+ ConfigurationDBUtils.saveOrUpdate(moaconfig);
+
+ }
+ } catch (Throwable e) {
+ log.info("Found no MetadataURL in OA-Databaseconfig!", e);
+ }
+
+ }
+ }
+
+ Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
+ if (nextPageAttr != null && nextPageAttr instanceof String) {
+ nextPage = (String) nextPageAttr;
+ session.setAttribute(Constants.SESSION_RETURNAREA, null);
+
+ } else {
+ nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
+ }
+
+ if (onlineapplication.isIsAdminRequired()) {
+ int numoas = 0;
+ int numusers = 0;
+
+ List<OnlineApplication> openOAs = ConfigurationDBRead.getAllNewOnlineApplications();
+ if (openOAs != null) numoas = openOAs.size();
+
+ List<UserDatabase> openUsers = ConfigurationDBRead.getAllNewUsers();
+ if (openUsers != null) numusers = openUsers.size();
+ try {
+
+ addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.success.admin", generalOA.getIdentifier(), request));
+
+ if (numusers > 0 || numoas > 0) MailHelper.sendAdminMail(numoas, numusers);
+
+ } catch (ConfigurationException e) {
+ log.warn("Sending Mail to Admin failed.", e);
+ }
+
+ } else
+ addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.success", generalOA.getIdentifier(), request));
+
+ //remove session attributes
+ session.setAttribute(Constants.SESSION_OAID, null);
+ session.removeAttribute(Constants.SESSION_BKUSELECTIONTEMPLATE);
+ session.removeAttribute(Constants.SESSION_SENDASSERTIONTEMPLATE);
+
+ ConfigurationDBUtils.closeSession();
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String cancleAndBackOA() {
+
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ return Constants.STRUTS_ERROR;
+ }
+
+ Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
+ if (nextPageAttr != null && nextPageAttr instanceof String) {
+ nextPage = (String) nextPageAttr;
+ session.setAttribute(Constants.SESSION_RETURNAREA, null);
+
+ } else {
+ nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
+ }
+
+ session.setAttribute(Constants.SESSION_OAID, null);
+
+ addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.cancle", generalOA.getIdentifier(), request));
+
+ ConfigurationDBUtils.closeSession();
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String deleteOA() {
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ return Constants.STRUTS_ERROR;
+ }
+
+ Object authUserObj = session.getAttribute(Constants.SESSION_AUTH);
+ authUser = (AuthenticatedUser) authUserObj;
+
+ Object formidobj = session.getAttribute(Constants.SESSION_FORMID);
+ if (formidobj != null && formidobj instanceof String) {
+ String formid = (String) formidobj;
+ if (!formid.equals(formID)) {
+ log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
+ + authUser.getGivenName() + authUser.getUserID());
+ return Constants.STRUTS_ERROR;
+ }
+ } else {
+ log.warn("FormIDs does not match. Some suspect Form is received from user " + authUser.getFamilyName()
+ + authUser.getGivenName() + authUser.getUserID());
+ return Constants.STRUTS_ERROR;
+ }
+ session.setAttribute(Constants.SESSION_FORMID, null);
+
+ Object nextPageAttr = session.getAttribute(Constants.SESSION_RETURNAREA);
+ if (nextPageAttr != null && nextPageAttr instanceof String) {
+ nextPage = (String) nextPageAttr;
+
+ } else {
+ nextPage = Constants.STRUTS_RETURNAREA_VALUES.main.name();
+ }
+
+ UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+ if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && !userdb.isIsMailAddressVerified()) {
+ log.info("Online-Applikation managemant disabled. Mail address is not verified.");
+ addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ String oaidentifier = generalOA.getIdentifier();
+ if (MiscUtil.isEmpty(oaidentifier)) {
+ log.info("Empty OA identifier");
+ addActionError(LanguageHelper.getErrorString("validation.general.oaidentifier.empty"));
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+ return Constants.STRUTS_ERROR_VALIDATION;
+
+ } else {
+ if (ValidationHelper.isValidOAIdentifier(oaidentifier)) {
+ log.warn("IdentificationNumber contains potentail XSS characters: " + oaidentifier);
+ addActionError(LanguageHelper.getErrorString("validation.general.oaidentifier.valid",
+ new Object[]{ValidationHelper.getNotValidOAIdentifierCharacters()}));
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+ return Constants.STRUTS_ERROR_VALIDATION;
+ }
+ }
+
+ OnlineApplication onlineapplication = ConfigurationDBRead.getOnlineApplication(oaidentifier);
+ request.getSession().setAttribute(Constants.SESSION_OAID, null);
+
+ try {
+ if (MiscUtil.isNotEmpty(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())) {
+
+ MOAIDConfiguration moaconfig = ConfigurationDBRead.getMOAIDConfiguration();
+ moaconfig.setPvp2RefreshItem(new Date());
+ ConfigurationDBUtils.saveOrUpdate(moaconfig);
+
+ }
+ } catch (Throwable e) {
+ log.info("Found no MetadataURL in OA-Databaseconfig!", e);
+ }
+
+ if (ConfigurationDBUtils.delete(onlineapplication)) {
+
+ if (!authUser.isAdmin()) {
+ UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+ List<OnlineApplication> useroas = user.getOnlineApplication();
+
+ for (OnlineApplicationType oa : useroas) {
+ if (oa.getHjid().equals(onlineapplication.getHjid())) {
+ useroas.remove(oa);
+ }
+ }
+
+ try {
+ ConfigurationDBUtils.saveOrUpdate(user);
+
+ } catch (MOADatabaseException e) {
+ log.warn("User information can not be updated in database", e);
+ addActionError(LanguageHelper.getGUIString("error.db.oa.store", request));
+ return Constants.STRUTS_ERROR;
+ }
+ }
+
+ ConfigurationDBUtils.closeSession();
+
+ addActionMessage(LanguageHelper.getGUIString("webpages.oaconfig.delete.message", generalOA.getIdentifier(), request));
+
+ return Constants.STRUTS_SUCCESS;
+
+ } else {
+ ConfigurationDBUtils.closeSession();
+ addActionError(LanguageHelper.getGUIString("webpages.oaconfig.delete.error", generalOA.getIdentifier(), request));
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ }
+
+ public String bkuFramePreview() {
+
+ String preview = null;
+
+ HttpSession session = request.getSession();
+ if (session == null) {
+ log.info("No http Session found.");
+ preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
+
+ } else {
+ InputStream input = null;
+
+ try {
+ Object mapobj = session.getAttribute(Constants.SESSION_BKUFORMPREVIEW);
+ if (mapobj != null && mapobj instanceof Map<?, ?>) {
+
+ ConfigurationProvider config = ConfigurationProvider.getInstance();
+ String templateURL = config.getConfigRootDir() + ConfigurationProvider.HTMLTEMPLATE_DIR
+ + ConfigurationProvider.HTMLTEMPLATE_FILE;
+
+ File file = new File(templateURL);
+ input = new FileInputStream(file);
+
+ String contextpath = config.getMOAIDInstanceURL();
+ if (MiscUtil.isEmpty(contextpath)) {
+ log.info("NO MOA-ID instance URL configurated.");
+ throw new ConfigurationException("No MOA-ID instance configurated");
+ }
+
+ preview = LoginFormBuilder.getTemplate(input);
+ preview = preview.replace(LoginFormBuilder.CONTEXTPATH, contextpath);
+
+ Map<String, String> map = (Map<String, String>) mapobj;
+
+ request.setCharacterEncoding("UTF-8");
+
+ String module = request.getParameter(Constants.REQUEST_FORMCUSTOM_MODULE);
+ String value = request.getParameter(Constants.REQUEST_FORMCUSTOM_VALUE);
+
+ if (value != null) {
+ String[] query = URLDecoder.decode(request.getQueryString()).split("&");
+ value = query[1].substring("value=".length());
+ }
+
+ synchronized (map) {
+
+ if (MiscUtil.isNotEmpty(module)) {
+ if (map.containsKey("#" + module + "#")) {
+ if (MiscUtil.isNotEmpty(value)) {
+ if (FormBuildUtils.FONTFAMILY.contains(module) || FormBuildUtils.HEADER_TEXT.contains(module)
+ || value.startsWith("#"))
+ map.put("#" + module + "#", value);
+ else
+ map.put("#" + module + "#", "#" + value);
+
+ } else {
+ map.put("#" + module + "#", FormBuildUtils.getDefaultMap().get("#" + module + "#"));
+ }
+ }
+ }
+ preview = FormBuildUtils.customiceLayoutBKUSelection(preview, true, false, map, true);
+ }
+
+ } else {
+ preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
+
+ }
+
+ } catch (Exception e) {
+ log.warn("BKUSelection Preview can not be generated.", e);
+ preview = LanguageHelper.getErrorString("error.bkuformpreview.notpossible");
+
+ }
+ }
+
+ stream = new ByteArrayInputStream(preview.getBytes());
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ private String saveOAConfigToDatabase(OnlineApplication dboa, boolean newentry) {
+
+ AuthComponentOA authoa = dboa.getAuthComponentOA();
+ if (authoa == null) {
+ authoa = new AuthComponentOA();
+ dboa.setAuthComponentOA(authoa);
+ }
+
+ if (authUser.isAdmin()) dboa.setIsActive(generalOA.isActive());
+
+ dboa.setFriendlyName(generalOA.getFriendlyName());
+ dboa.setCalculateHPI(generalOA.isCalculateHPI());
+ dboa.setRemoveBPKFromAuthBlock(generalOA.isHideBPKAuthBlock());
+
+ if (authUser.isAdmin())
+ dboa.setKeyBoxIdentifier(MOAKeyBoxSelector.fromValue(generalOA.getKeyBoxIdentifier()));
+ else {
+ if (newentry) dboa.setKeyBoxIdentifier(MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR);
+ }
+
+ dboa.setPublicURLPrefix(generalOA.getIdentifier());
+
+ if (generalOA.isStorkService() || onlyStorkService) {
+ dboa.setType(Constants.MOA_CONFIG_STORKSERVICE);
+ dboa.setStorkSPTargetCountry(generalOA.getStorkSPTargetCountry());
+
+
+ IdentificationNumber idnumber = new IdentificationNumber();
+ idnumber.setValue(Constants.PREFIX_STORK + "AT+" + generalOA.getStorkSPTargetCountry());
+ idnumber.setType(Constants.BUSINESSSERVICENAMES.get(generalOA.getIdentificationType()));
+
+ authoa.setIdentificationNumber(idnumber);
+
+ } else if (generalOA.isBusinessService() || onlyBusinessService) {
+
+ dboa.setType(Constants.MOA_CONFIG_BUSINESSSERVICE);
+
+ String num = generalOA.getIdentificationNumber().replaceAll(" ", "");
+ if (num.startsWith(Constants.IDENIFICATIONTYPE_FN)) {
+ num = num.substring(Constants.IDENIFICATIONTYPE_FN.length());
+
+ num = at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(num);
+
+ // num = StringUtils.leftPad(num, 7, '0');
+ }
+
+ if (num.startsWith(Constants.IDENIFICATIONTYPE_ZVR))
+ num = num.substring(Constants.IDENIFICATIONTYPE_ZVR.length());
+
+ if (num.startsWith(Constants.IDENIFICATIONTYPE_ERSB))
+ num = num.substring(Constants.IDENIFICATIONTYPE_ERSB.length());
+
+ IdentificationNumber idnumber = new IdentificationNumber();
+ idnumber.setValue(Constants.PREFIX_WPBK + generalOA.getIdentificationType() + "+" + num);
+ idnumber.setType(Constants.BUSINESSSERVICENAMES.get(generalOA.getIdentificationType()));
+
+ authoa.setIdentificationNumber(idnumber);
+
+ } else {
+ dboa.setType(null);
+
+ if (authUser.isAdmin()) {
+ if (MiscUtil.isNotEmpty(generalOA.getTarget_admin()) && generalOA.isAdminTarget()) {
+ dboa.setTarget(generalOA.getTarget_admin());
+ dboa.setTargetFriendlyName(generalOA.getTargetFriendlyName());
+
+ } else {
+
+ String target = generalOA.getTarget();
+
+ if (MiscUtil.isNotEmpty(generalOA.getTarget_subsector()) && subTargetSet)
+ dboa.setTarget(target + "-" + generalOA.getTarget_subsector());
+ else
+ dboa.setTarget(target);
+
+ String targetname = TargetValidator.getTargetFriendlyName(target);
+ if (MiscUtil.isNotEmpty(targetname)) dboa.setTargetFriendlyName(targetname);
+
+ }
+
+ } else {
+
+ if (MiscUtil.isNotEmpty(generalOA.getTarget())) {
+
+ String target = generalOA.getTarget();
+
+ if (MiscUtil.isNotEmpty(generalOA.getTarget_subsector()) && subTargetSet)
+ dboa.setTarget(target + "-" + generalOA.getTarget_subsector());
+
+ else
+ dboa.setTarget(target);
+
+ String targetname = TargetValidator.getTargetFriendlyName(target);
+ if (MiscUtil.isNotEmpty(targetname)) dboa.setTargetFriendlyName(targetname);
+
+ }
+ }
+ }
+
+ //store BKU-URLs
+ BKUURLS bkuruls = new BKUURLS();
+ authoa.setBKUURLS(bkuruls);
+ if (authUser.isAdmin()) {
+ bkuruls.setHandyBKU(generalOA.getBkuHandyURL());
+ bkuruls.setLocalBKU(generalOA.getBkuLocalURL());
+ bkuruls.setOnlineBKU(generalOA.getBkuOnlineURL());
+ }
+
+ TemplatesType templates = authoa.getTemplates();
+ if (templates == null) {
+ templates = new TemplatesType();
+ authoa.setTemplates(templates);
+ }
+
+ //store BKU-selection and send-assertion templates
+ if (authUser.isAdmin()) {
+
+ if (generalOA.isDeleteBKUTemplate())
+ templates.setBKUSelectionTemplate(null);
+
+ if (generalOA.isDeleteSendAssertionTemplate())
+ templates.setSendAssertionTemplate(null);
+
+
+ if (bkuSelectionForm != null && bkuSelectionForm.size() > 0) {
+ TransformsInfoType template = new TransformsInfoType();
+
+ Iterator<String> interator = bkuSelectionForm.keySet().iterator();
+ template.setFilename(interator.next());
+ template.setTransformation(bkuSelectionForm.get(
+ template.getFilename()));
+
+ templates.setBKUSelectionTemplate(template);
+ }
+
+ if (sendAssertionForm != null && sendAssertionForm.size() > 0) {
+ TransformsInfoType template = new TransformsInfoType();
+
+ Iterator<String> interator = sendAssertionForm.keySet().iterator();
+ template.setFilename(interator.next());
+ template.setTransformation(sendAssertionForm.get(
+ template.getFilename()));
+
+ templates.setSendAssertionTemplate(template);
+ }
+ }
+
+
+ //store BKU-selection customization
+ BKUSelectionCustomizationType bkuselectioncustom = templates.getBKUSelectionCustomization();
+ if (bkuselectioncustom == null) {
+ bkuselectioncustom = new BKUSelectionCustomizationType();
+ templates.setBKUSelectionCustomization(bkuselectioncustom);
+ }
+
+ Mandates mandates = new Mandates();
+ if (generalOA.isUseMandates()) {
+ mandates.setProfiles(generalOA.getMandateProfiles());
+
+ } else {
+ mandates.setProfiles(new String());
+ }
+
+ authoa.setMandates(mandates);
+ bkuselectioncustom.setMandateLoginButton(MiscUtil.isNotEmpty(generalOA.getMandateProfiles()));
+ bkuselectioncustom.setOnlyMandateLoginAllowed(formOA.isOnlyMandateAllowed());
+
+ if (authUser.isAdmin()) {
+ templates.setAditionalAuthBlockText(generalOA.getAditionalAuthBlockText());
+
+ List<TemplateType> template = templates.getTemplate();
+ if (generalOA.isLegacy()) {
+
+ if (template == null)
+ template = new ArrayList<TemplateType>();
+ else
+ template.clear();
+
+ if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL1())) {
+ TemplateType el = new TemplateType();
+ el.setURL(generalOA.getSLTemplateURL1());
+ template.add(el);
+ } else
+ template.add(new TemplateType());
+ if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL2())) {
+ TemplateType el = new TemplateType();
+ el.setURL(generalOA.getSLTemplateURL2());
+ template.add(el);
+ } else
+ template.add(new TemplateType());
+ if (MiscUtil.isNotEmpty(generalOA.getSLTemplateURL3())) {
+ TemplateType el = new TemplateType();
+ el.setURL(generalOA.getSLTemplateURL3());
+ template.add(el);
+ } else
+ template.add(new TemplateType());
+
+ } else {
+ if (template != null && template.size() > 0) template.clear();
+ }
+
+ bkuselectioncustom.setBackGroundColor(parseColor(formOA.getBackGroundColor()));
+ bkuselectioncustom.setFrontColor(parseColor(formOA.getFrontColor()));
+
+ bkuselectioncustom.setHeaderBackGroundColor(parseColor(formOA.getHeader_BackGroundColor()));
+ bkuselectioncustom.setHeaderFrontColor(parseColor(formOA.getHeader_FrontColor()));
+ bkuselectioncustom.setHeaderText(formOA.getHeader_text());
+
+ bkuselectioncustom.setButtonBackGroundColor(parseColor(formOA.getButton_BackGroundColor()));
+ bkuselectioncustom.setButtonBackGroundColorFocus(parseColor(formOA.getButton_BackGroundColorFocus()));
+ bkuselectioncustom.setButtonFontColor(parseColor(formOA.getButton_FrontColor()));
+
+ if (MiscUtil.isNotEmpty(formOA.getAppletRedirectTarget()))
+ bkuselectioncustom.setAppletRedirectTarget(formOA.getAppletRedirectTarget());
+
+ bkuselectioncustom.setFontType(formOA.getFontType());
+
+ bkuselectioncustom.setAppletHeight(formOA.getApplet_height());
+ bkuselectioncustom.setAppletWidth(formOA.getApplet_width());
+
+ }
+
+ // set default transformation if it is empty
+ List<TransformsInfoType> transformsInfo = authoa.getTransformsInfo();
+ if (transformsInfo == null) {
+ // TODO: set OA specific transformation if it is required
+
+ }
+
+ OAPVP2 pvp2 = authoa.getOAPVP2();
+ if (pvp2 == null) {
+ pvp2 = new OAPVP2();
+ authoa.setOAPVP2(pvp2);
+ }
+
+ pvp2.setMetadataURL(pvp2OA.getMetaDataURL());
+ try {
+
+ if (pvp2OA.getFileUpload() != null) pvp2.setCertificate(pvp2OA.getCertificate());
+
+ } catch (CertificateException e) {
+ log.info("Uploaded Certificate can not be found", e);
+ return LanguageHelper.getErrorString("validation.pvp2.certificate.notfound");
+ } catch (IOException e) {
+ log.info("Uploaded Certificate can not be parsed", e);
+ return LanguageHelper.getErrorString("validation.pvp2.certificate.format");
+ }
+
+ OASAML1 saml1 = authoa.getOASAML1();
+ if (saml1 == null) {
+ saml1 = new OASAML1();
+ authoa.setOASAML1(saml1);
+ saml1.setIsActive(false);
+ }
+
+ if (authUser.isAdmin()) {
+ saml1.setIsActive(saml1OA.isActive());
+ }
+
+ if (saml1.isIsActive() != null && saml1.isIsActive()) {
+ saml1.setProvideAUTHBlock(saml1OA.isProvideAuthBlock());
+ saml1.setProvideCertificate(saml1OA.isProvideCertificate());
+ saml1.setProvideFullMandatorData(saml1OA.isProvideFullMandateData());
+ saml1.setProvideIdentityLink(saml1OA.isProvideIdentityLink());
+ saml1.setProvideStammzahl(saml1OA.isProvideStammZahl());
+ saml1.setUseCondition(saml1OA.isUseCondition());
+ saml1.setConditionLength(BigInteger.valueOf(saml1OA.getConditionLength()));
+ // TODO: set sourceID
+ // saml1.setSourceID("");
+ }
+
+ OASSO sso = authoa.getOASSO();
+ if (sso == null) {
+ sso = new OASSO();
+ authoa.setOASSO(sso);
+ sso.setAuthDataFrame(true);
+ }
+ sso.setUseSSO(ssoOA.isUseSSO());
+
+ if (authUser.isAdmin()) sso.setAuthDataFrame(ssoOA.isShowAuthDataFrame());
+
+ sso.setSingleLogOutURL(ssoOA.getSingleLogOutURL());
+
+ if (oauth20OA != null) {
+ log.debug("Saving OAuth 2.0 configuration:");
+ OAOAUTH20 oaOAuth20 = authoa.getOAOAUTH20();
+ if (oaOAuth20 == null) {
+ oaOAuth20 = new OAOAUTH20();
+ authoa.setOAOAUTH20(oaOAuth20);
+ }
+
+ oaOAuth20.setOAuthClientId(generalOA.getIdentifier());
+ // oaOAuth20.setOAuthClientSecret(oauth20OA.getClientSecret());
+ oaOAuth20.setOAuthRedirectUri(oauth20OA.getRedirectUri());
+ log.debug("client id: " + oauth20OA.getClientId());
+ log.debug("client secret: " + oauth20OA.getClientSecret());
+ log.debug("redirect uri:" + oauth20OA.getRedirectUri());
+
+ oaOAuth20.setOAuthClientSecret((String) request.getSession().getAttribute(Constants.SESSION_OAUTH20SECRET));
+ request.getSession().setAttribute(Constants.SESSION_OAUTH20SECRET, null);
+
+ }
+
+
+ // fetch stork configuration from database model
+ OASTORK stork = authoa.getOASTORK();
+ if (stork == null) {
+ // if there is none, create a new one with default values.
+ stork = new OASTORK();
+ authoa.setOASTORK(stork);
+ stork.setStorkLogonEnabled(false);
+ }
+ // transfer the incoming data to the database model
+ stork.setStorkLogonEnabled(storkOA.isStorkLogonEnabled());
+ stork.setQaa(storkOA.getQaa());
+ stork.setOAAttributes(storkOA.getAttributes());
+ stork.setVidpEnabled(storkOA.isVidpEnabled());
+ stork.setRequireConsent(storkOA.isRequireConsent());
+ stork.setAttributeProviders(storkOA.getAttributeProviderPlugins());
+
+ try {
+ if (newentry) {
+ ConfigurationDBUtils.save(dboa);
+
+ if (!authUser.isAdmin()) {
+ UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID());
+
+ List<OnlineApplication> useroas = user.getOnlineApplication();
+ if (useroas == null) useroas = new ArrayList<OnlineApplication>();
+
+ useroas.add(dboa);
+ ConfigurationDBUtils.saveOrUpdate(user);
+ }
+ } else
+ ConfigurationDBUtils.saveOrUpdate(dboa);
+
+ } catch (MOADatabaseException e) {
+ log.warn("Online-Application can not be stored.", e);
+ return LanguageHelper.getErrorString("error.db.oa.store");
+ }
+
+ return null;
+ }
+
+ private String parseColor(String color) {
+ String value = "";
+
+ if (MiscUtil.isNotEmpty(color)) {
+ if (!color.startsWith("#"))
+ value = "#" + color;
+ else
+ value = color;
+ }
+ return value;
+ }
+
+ private void generateUserSpecificConfigurationOptions(UserDatabase userdb) {
+
+ if (userdb.isIsMandateUser() != null && userdb.isIsMandateUser()) {
+ String bpk = userdb.getBpk();
+ if (bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_FN) || bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_ZVR)) {
+ onlyBusinessService = true;
+ generalOA.setBusinessService(true);
+ } else if (bpk.startsWith(Constants.IDENIFICATIONTYPE_STORK)) {
+ onlyStorkService = true;
+ generalOA.setStorkService(true);
+ }
+
+ deaktivededBusinessService = true;
+ deactivatedStorkService = true;
+ String[] split = bpk.split("\\+");
+ generalOA.setIdentificationType(split[1].substring(1));
+
+ if (bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_FN))
+ generalOA.setIdentificationNumber(at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(split[2]));
+ else
+ generalOA.setIdentificationNumber(split[2]);
+
+ }
+
+ }
+
+ public String setGeneralOAConfig() {
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String setSAML1OAConfig() {
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String setPVP2OAConfig() {
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String setSSOOAConfig() {
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ public String setSTORKOAConfig() {
+
+ return Constants.STRUTS_SUCCESS;
+ }
+
+ // Getter and Setter
+ public void setServletResponse(HttpServletResponse arg0) {
+ this.response = arg0;
+
+ }
+
+ public void setServletRequest(HttpServletRequest arg0) {
+ this.request = arg0;
+
+ }
+
+ public HttpServletRequest getRequest() {
+ return request;
+ }
+
+ public void setRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ public HttpServletResponse getResponse() {
+ return response;
+ }
+
+ public void setResponse(HttpServletResponse response) {
+ this.response = response;
+ }
+
+ public OAGeneralConfig getGeneralOA() {
+ return generalOA;
+ }
+
+ public void setGeneralOA(OAGeneralConfig generalOA) {
+ this.generalOA = generalOA;
+ }
+
+ public OAPVP2Config getPvp2OA() {
+ return pvp2OA;
+ }
+
+ public void setPvp2OA(OAPVP2Config pvp2oa) {
+ pvp2OA = pvp2oa;
+ }
+
+ public OASAML1Config getSaml1OA() {
+ return saml1OA;
+ }
+
+ public void setSaml1OA(OASAML1Config saml1oa) {
+ saml1OA = saml1oa;
+ }
+
+ public OASSOConfig getSsoOA() {
+ return ssoOA;
+ }
+
+ public void setSsoOA(OASSOConfig ssoOA) {
+ this.ssoOA = ssoOA;
+ }
+
+ public OASTORKConfig getStorkOA() {
+ return storkOA;
+ }
+
+ public void setStorkOA(OASTORKConfig storkOA) {
+ this.storkOA = storkOA;
+ }
+
+ /**
+ * @param oaidobj the oaidobj to set
+ */
+ public void setOaidobj(String oaidobj) {
+ this.oaidobj = oaidobj;
+ }
+
+ /**
+ * @return the authUser
+ */
+ public AuthenticatedUser getAuthUser() {
+ return authUser;
+ }
+
+ /**
+ * @return the newOA
+ */
+ public boolean isNewOA() {
+ return newOA;
+ }
+
+ /**
+ * @param newOA the newOA to set
+ */
+ public void setNewOA(boolean newOA) {
+ this.newOA = newOA;
+ }
+
+ /**
+ * @return the nextPage
+ */
+ public String getNextPage() {
+ return nextPage;
+ }
+
+ /**
+ * @return the formID
+ */
+ public String getFormID() {
+ return formID;
+ }
+
+ /**
+ * @param formID the formID to set
+ */
+ public void setFormID(String formID) {
+ this.formID = formID;
+ }
+
+ /**
+ * @return the onlyBusinessService
+ */
+ public boolean isOnlyBusinessService() {
+ return onlyBusinessService;
+ }
+
+ /**
+ * @param onlyStorkService the onlyStorkService to set
+ */
+ public void setOnlyStorkService(boolean onlyStorkService) {
+ this.onlyStorkService = onlyStorkService;
+ }
+
+ /**
+ * @return the onlyStorkService
+ */
+ public boolean isOnlyStorkService() {
+ return onlyStorkService;
+ }
+
+ /**
+ * @param onlyBusinessService the onlyBusinessService to set
+ */
+ public void setOnlyBusinessService(boolean onlyBusinessService) {
+ this.onlyBusinessService = onlyBusinessService;
+ }
+
+
+ /**
+ * @return the subTargetSet
+ */
+ public boolean isSubTargetSet() {
+ return subTargetSet;
+ }
+
+ /**
+ * @param subTargetSet the subTargetSet to set
+ */
+ public void setSubTargetSet(boolean subTargetSet) {
+ this.subTargetSet = subTargetSet;
+ }
+
+ /**
+ * @return the deaktivededBusinessService
+ */
+ public boolean isDeaktivededBusinessService() {
+ return deaktivededBusinessService;
+ }
+
+ /**
+ * @return the deactivatedStorkService
+ */
+ public boolean isDeactivatedStorkService() {
+ return deactivatedStorkService;
+ }
+
+ /**
+ * @param deactivatedStorkService the deactivatedStorkService to set
+ */
+
+ public void setDeactivatedStorkService(boolean deactivatedStorkService) {
+
+ this.deactivatedStorkService = deactivatedStorkService;
+ }
+
+ /**
+ * @param deaktivededBusinessService the deaktivededBusinessService to set
+ */
+ public void setDeaktivededBusinessService(boolean deaktivededBusinessService) {
+ this.deaktivededBusinessService = deaktivededBusinessService;
+ }
+
+ /**
+ * @return the formOA
+ */
+ public FormularCustomization getFormOA() {
+ return formOA;
+ }
+
+ /**
+ * @param formOA the formOA to set
+ */
+ public void setFormOA(FormularCustomization formOA) {
+ this.formOA = formOA;
+ }
+
+ /**
+ * @return the stream
+ */
+ public InputStream getStream() {
+ return stream;
+ }
+
+ public OAOAuth20Config getOauth20OA() {
+ return oauth20OA;
+ }
+
+ public void setOauth20OA(OAOAuth20Config oauth20OA) {
+ this.oauth20OA = oauth20OA;
+ }
+
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java
index 3bc2d4ac5..655ce7a59 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ImportExportAction.java
@@ -198,6 +198,10 @@ implements ServletRequestAware, ServletResponseAware {
ConfigurationDBUtils.closeSession();
}
+ //set new formID
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
log.info("Legacy Configuration load is completed.");
addActionMessage(LanguageHelper.getGUIString("webpages.inportexport.success"));
return Constants.STRUTS_SUCCESS;
@@ -285,6 +289,11 @@ implements ServletRequestAware, ServletResponseAware {
ConfigurationDBUtils.closeSession();
}
+
+ //set new formID
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
return Constants.STRUTS_SUCCESS;
} else {
log.info("No access to Import/Export for User with ID" + authUser.getUserID());
@@ -317,15 +326,20 @@ implements ServletRequestAware, ServletResponseAware {
+ authUser.getFamilyName() + authUser.getGivenName() + authUser.getUserID());
return Constants.STRUTS_ERROR;
}
+
session.setAttribute(Constants.SESSION_FORMID, null);
if (authUser.isAdmin()) {
if (fileUpload == null) {
addActionError(LanguageHelper.getErrorString("errors.importexport.nofile"));
+
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
return Constants.STRUTS_ERROR_VALIDATION;
}
-
+
log.info("Load configuration from MOA-ID 2.x XML configuration");
try {
@@ -367,6 +381,10 @@ implements ServletRequestAware, ServletResponseAware {
ConfigurationDBUtils.closeSession();
}
+ //set new formID
+ formID = Random.nextRandom();
+ session.setAttribute(Constants.SESSION_FORMID, formID);
+
log.info("XML Configuration load is completed.");
addActionMessage(LanguageHelper.getGUIString("webpages.inportexport.success"));
return Constants.STRUTS_SUCCESS;
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java
index a51709e04..8004ab520 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/IndexAction.java
@@ -278,6 +278,18 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
Response samlResponse = (Response) messageContext.getInboundMessage();
+ //ckeck InResponseTo matchs requestID
+ if (MiscUtil.isEmpty(authID)) {
+ log.info("NO AuthRequestID");
+ return Constants.STRUTS_ERROR;
+ }
+
+ if (!authID.equals(samlResponse.getInResponseTo())) {
+ log.warn("PVPRequestID does not match PVP2 Assertion ID!");
+ return Constants.STRUTS_ERROR;
+
+ }
+
Signature sign = samlResponse.getSignature();
if (sign == null) {
log.info("Only http POST Requests can be used");
@@ -352,29 +364,9 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
saml2assertions = samlResponse.getAssertions();
}
-
-
- if (MiscUtil.isEmpty(authID)) {
- log.info("NO AuthRequestID");
- return Constants.STRUTS_ERROR;
- }
-
+
for (org.opensaml.saml2.core.Assertion saml2assertion : saml2assertions) {
-
- Subject subject = saml2assertion.getSubject();
- List<SubjectConfirmation> subjectconformlist = subject.getSubjectConfirmations();
- for (SubjectConfirmation el : subjectconformlist) {
- if (el.getMethod().equals(SubjectConfirmation.METHOD_BEARER)) {
- SubjectConfirmationData date = el.getSubjectConfirmationData();
-
- if (!authID.equals(date.getInResponseTo())) {
- log.warn("PVPRequestID does not match PVP2 Assertion ID!");
- return Constants.STRUTS_ERROR;
-
- }
- }
- }
-
+
Conditions conditions = saml2assertion.getConditions();
DateTime notbefore = conditions.getNotBefore();
DateTime notafter = conditions.getNotOnOrAfter();
@@ -383,6 +375,13 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
return Constants.STRUTS_ERROR;
}
+
+ Subject subject = saml2assertion.getSubject();
+ if (subject == null) {
+ log.warn("Assertion has no Subject element");
+ return Constants.STRUTS_ERROR;
+
+ }
NameID nameID = subject.getNameID();
if (nameID == null) {
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
index d3a2241d3..637500c1e 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
@@ -172,14 +172,29 @@ public class OAGeneralConfigValidation {
boolean businessservice = form.isBusinessService();
-
- if (businessservice) {
+ boolean storkservice = form.isStorkService();
+
+ if (storkservice) {
+ check = form.getStorkSPTargetCountry();
+ if ((check==null)||(check.length() < 1)) {
+ log.warn("Stork target country is not known");
+ errors.add(LanguageHelper.getErrorString("validation.general.stork.sptarget"));
+ }
+
+ if (check.length() > 10) {
+ log.warn("Incorrect size of Stork target country, too many characters");
+ errors.add(LanguageHelper.getErrorString("validation.general.stork.sptargetsize"));
+ }
+
+
+
+ } else if (businessservice) {
//check identification type
check = form.getIdentificationType();
if (!form.getIdentificationTypeList().contains(check)) {
log.info("IdentificationType is not known.");
- errors.add(LanguageHelper.getErrorString("validation.general.identificationtype.valid"));
+ errors.add(LanguageHelper.getErrorString("validation.general.stork.sptarget"));
}
//check identification number
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
index f72999020..554aa9ff0 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
@@ -27,8 +27,11 @@ import java.util.List;
import org.apache.log4j.Logger;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
import at.gv.egovernment.moa.id.configuration.data.oa.OASTORKConfig;
import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper;
+import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper;
+import at.gv.egovernment.moa.util.MiscUtil;
public class OASTORKConfigValidation {
@@ -45,6 +48,33 @@ public class OASTORKConfigValidation {
errors.add(LanguageHelper.getErrorString("validation.stork.qaa.outofrange",
new Object[] {qaa} ));
}
+
+ if (oageneral.isVidpEnabled()) {
+ for(AttributeProviderPlugin current : oageneral.getAttributeProviderPlugins()) {
+ if (MiscUtil.isEmpty(current.getUrl()) || !ValidationHelper.validateURL(current.getUrl())) {
+ log.info("AttributeProviderPlugin URL has no valid form.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.url.valid"));
+ }
+ if (MiscUtil.isEmpty(current.getName())) {
+ log.info("AttributeProviderPlugin Name is empty.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.empty"));
+
+ } else {
+ if (!oageneral.getAvailableAttributeProviderPlugins().contains(current.getName())) {
+ log.info("AttributeProviderPlugin Name is not supported.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.valid"));
+ }
+ }
+
+ if (MiscUtil.isEmpty(current.getAttributes()) || !current.getAttributes().matches("[a-zA-Z]+(, ?[a-zA-Z]+)*")) {
+ log.info("AttributeProviderPlugin attributes are empty or do not match csv format.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.attributes.valid"));
+ }
+ }
+
+ } else {
+ oageneral.setAttributeProviderPlugins(null);
+ }
return errors;
}
diff --git a/id/ConfigWebTool/src/main/resources/applicationResources.properties b/id/ConfigWebTool/src/main/resources/applicationResources.properties
index 914c4cd62..34d2bc81f 100644
--- a/id/ConfigWebTool/src/main/resources/applicationResources.properties
+++ b/id/ConfigWebTool/src/main/resources/applicationResources.properties
@@ -5,6 +5,7 @@ config.01=Configfile is not found.
config.02=Configfile is not readable.
config.03=Hibernate Database connector can not be initialized
config.04=OpenSAML (PVP2 Login) can not be initialized
+config.05=Configuration file not defined
error.title=Fehler:
error.general.text=W\u00E4hrend der Verarbeitung ist ein interner Fehler auftetreten. Bitte Versuchen Sie es nocheinmal oder kontaktieren Sie den Administrator.
@@ -107,7 +108,7 @@ webpages.moaconfig.certificates.trustmanagerrev=TrustManagerRevocationChecking
webpages.moaconfig.certificates.trustCACerts=TrustedCACertificates
webpages.moaconfig.certificates.chainingmode=ChainingMode
webpages.moaconfig.timeout.header=Session TimeOuts
-webpages.moaconfig.timeout.assertion=Assertion [sec]
+webpages.moaconfig.timeout.assertion=Anmeldedaten [sec]
webpages.moaconfig.timeout.MOASessionCreated=SSO Session authentifiziert [sec]
webpages.moaconfig.timeout.MOASessionUpdated=SSO Session letzter Zugriff [sec]
webpages.moaconfig.moasp.header=MOA-SP Konfiguration
@@ -184,7 +185,10 @@ webpages.oaconfig.general.mandate.profiles=Profile
webpages.oaconfig.general.mandate.usemandate=Vollmachten (ja/nein)
webpages.oaconfig.general.friendlyname=Name der Online-Applikation
webpages.oaconfig.general.isbusinessservice=Privatwirtschaftliche Applikation
+webpages.oaconfig.general.isstorkservice=Stork Applikation
webpages.oaconfig.general.public.header=&Ouml;ffentlicher Bereich
+webpages.oaconfig.general.stork.header=STORK Bereich
+webpages.oaconfig.general.stork.countrycode=Landesvorwahl
webpages.oaconfig.general.target.friendlyname=Bezeichnung des Bereichs (Frei w\u00E4hlbar)
webpages.oaconfig.general.target.admin.checkbox=Anderen Bereich frei definieren
webpages.oaconfig.general.target.admin=Bereich (Frei w\u00E4hlbar)
@@ -209,7 +213,8 @@ webpages.oaconfig.menu.pvp2.show=PVP2 Konfiguration einblenden
webpages.oaconfig.menu.pvp2.hidden=PVP2 Konfiguration ausblenden
webpages.oaconfig.menu.oauth20.show=OAuth 2.0 Konfiguration einblenden
webpages.oaconfig.menu.oauth20.hidden=OAuth 2.0 Konfiguration ausblenden
-
+webpages.oaconfig.menu.vidp.show=VIDP Konfiguration einblenden
+webpages.oaconfig.menu.vidp.hidden=VIDP Konfiguration ausblenden
webpages.oaconfig.menu.stork=STORK Konfiguration
@@ -239,6 +244,11 @@ webpages.oaconfig.sso.useauthdataframe=Zus\u00E4tzliche Userabfrage
webpages.oaconfig.sso.usesso=Single Sign-On verwenden
webpages.oaconfig.stork.header=Secure idenTity acrOss boRders linKed
+webpages.oaconfig.stork.enabledcpeps=aktivierte Ziell&auml;nder
+webpages.oaconfig.stork.attributes.header=angeforderte Attribute
+webpages.oaconfig.stork.attributes.used=anfordern?
+webpages.oaconfig.stork.attributes.name=Attributname
+webpages.oaconfig.stork.attributes.mandatory=obligatorisch?
webpages.oaconfig.stork.usestork=STORK Logon aktivieren
webpages.moaconfig.stork.pepslist=C-PEPS Konfiguration
webpages.moaconfig.stork.newpeps=Neuen PEPS konfigurieren
@@ -272,6 +282,12 @@ webpages.oaconfig.oauth20.clientId=Client ID
webpages.oaconfig.oauth20.clientSecret=Client Passwort
webpages.oaconfig.oauth20.redirectUri=Redirect Uri
+webpages.oaconfig.vidp.enabled=VIDP interface aktiv
+webpages.oaconfig.vidp.requireconsent=Zustimmung f\u00FCr das Ausliefern der Attribute vom Benutzer einholen?
+webpages.oaconfig.vidp.ap.new=Neuen Attribut Provider erstellen
+webpages.oaconfig.vidp.ap.remove=Entfernen
+webpages.oaconfig.vidp.ap.list=Liste der konfigurierten Attribut Provider
+
message.title=Meldung:
webpages.oaconfig.success=Die Online-Applikation {0} konnte erfolgreich gespeichert werden.
@@ -395,7 +411,8 @@ validation.general.identificationnumber.fn.valid=Die Firmenbuchnummer hat kein g
validation.general.oaidentifier.empty=Es wurde kein eindeutiger Identifier f\u00FCr die Online-Applikation angegeben.
validation.general.oaidentifier.valid=Der eindeutige Identifier f\u00FCr die Online-Applikation ist keine g\u00FCltige URL.
validation.general.oaidentifier.notunique=Der gew\u00E4hlte eindeutige Identifier ist bereits vorhanden. Eine Eintragung der Online-Applikation ist nicht m\u00F6glich.
-
+validation.general.stork.sptarget=Der STORK SP-Target ist leer.
+validation.general.stork.sptargetsize=Die Definition von STORK SP-Target ist nicht korrekt: zu viele Buchstaben.
validation.general.bkuselection.filename.valid=Der Dateiname des BKU-Selektion Templates enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
validation.general.bkuselection.file.valid=Das BKU-Selektion Templates konnte nicht geladen werden.
validation.general.bkuselection.file.selected=Es kann nur EIN BKU-Selektion Template angegeben werden.
@@ -410,6 +427,10 @@ validation.stork.cpeps.url=CPEPS URL ist ung\u00FCltig
validation.stork.requestedattributes=STORK Attribute sind fehlerhaft. Bsp.: attr1, attr2
validation.stork.qaa.outofrange=G\u00FCltige QAA Werte sind 1, 2, 3, und 4
validation.stork.attributes.empty=Es muss mindestens ein Attribut definiert sein
+validation.stork.ap.url.valid=Ung\u00FCltige AttributProvider Url
+validation.stork.ap.name.empty=Ung\u00FCltiger AttributProvider Name
+validation.stork.ap.name.valid=Ung\u00FCltiger AttributProvider Name
+validation.stork.ap.attributes.valid=Ung\u00FCltige Attributconfiguration f\u00FCr ein Attribut Provider Plugin. Feld darf nicht leer sein und ist als csv anzugeben.
validation.pvp2.metadataurl.empty=Keine Metadaten URL angegeben.
validation.pvp2.metadataurl.valid=Die Metadaten URL wei\u00DFt kein g\u00FCltiges URL Format auf.
@@ -436,4 +457,4 @@ validation.general.form.button.color.front=Die Vordergrundfarbe der BKU-Auswahlb
validation.general.form.appletredirecttarget=Der RedirectTarget beinhaltet einen ung\\u00FCltiten Wert.
validation.general.form.fonttype=Der BKU-Auswahl Schrifttyp enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
validation.general.form.applet.width=Die Appleth\u00F6he ist keine g\\u00FCltige Zahl.
-validation.general.form.applet.height=Die Appletbreite ist keine g\\u00FCltige Zahl. \ No newline at end of file
+validation.general.form.applet.height=Die Appletbreite ist keine g\\u00FCltige Zahl.
diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties
new file mode 100644
index 000000000..c66572969
--- /dev/null
+++ b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties
@@ -0,0 +1,459 @@
+title=MOA-ID 2.x Configuration Tool
+
+
+config.01=Configfile is not found.
+config.02=Configfile is not readable.
+config.03=Hibernate Database connector can not be initialized
+config.04=OpenSAML (PVP2 Login) can not be initialized
+config.05=Configuration file not defined
+
+error.title=Fehler:
+error.general.text=W\u00E4hrend der Verarbeitung ist ein interner Fehler auftetreten. Bitte Versuchen Sie es nocheinmal oder kontaktieren Sie den Administrator.
+errors.listOAs.noOA=Es wurden keine Online-Applikationen in der Datenbank gefunden.
+errors.edit.oa.oaid=Es wurde keine g\u00FCtige Online-Applikations-ID \u00FCbergeben.
+errors.edit.oa.oaid.allowed=Sie besitzen nicht die ben\u00F6tigen Rechte um auf diese Online-Applikation zuzugreifen.
+error.oa.pvp2.certificate=Das hinterlegte PVP2 Zertifikat konnte nicht gelesen werden.
+error.db.oa.store=Die Konfiguration konnte nicht in der Datenbank gespeichert werden.
+errors.notallowed=Sie besitzen nicht die n\u00F6tigen Rechte um diese Funktion zu benutzen.
+errors.importexport.nofile=Es wurde keine Datei angegeben.
+errors.importexport.legacyimport=Der Importvorgang der Legacy-Konfiguration wurde mit einem Fehler abgebrochen (Fehler={0}).
+errors.importexport.export=Die MOA-ID 2.x Konfiguration konnte nicht in ein XML File exportiert werden. (Fehler={0})
+errors.importexport.import=Der Importvorgang der XML Konfiguration wurde mit einem Fehler abgebrochen (Fehler={0}).
+errors.importexport.export.noconfig=Die Konfiguration kann nicht exportiert werden da keine MOA-ID Konfiguration vorhanden ist.
+errors.edit.user.userid=Es wurde keine g\u00FCtige User ID \u00FCbergeben.
+errors.edit.user.save=Der Benutzer konnte nicht in die Datenbank eingetragen werden.
+errors.edit.user.notallowed=Das Bearbeiten fremder Benutzereinstellungen ist nur dem Admin erlaubt.
+error.login=Der Anmeldevorgang wurde abgebrochen. Bitte Versuchen sie es noch einmal.
+error.mail.send=An die angegebene Mailadresse konnte keine Nachticht versendet werden.
+error.mail.verification=Der Verifikationsvorgang wurde durch einen internen Fehler unterbrochen. Bitte Versuchen sie es noch einmal.
+error.editoa.mailverification=Die Verwaltung von Online-Applikationen ist vor\u00FCbergehend deaktiviert, da die Mailadresse des Benutzeraccounts noch nicht verifiziert wurde.
+error.bkuformpreview.notpossible="Die Vorschau konnte nicht generiert werden da ein interner Fehler auftreten ist."
+error.oa.oauth.redirecturi=Redirect URL ist keine richtige URL
+error.oa.oauth.clientSecret=Client-Secret darf nicht leer sein
+error.oa.oauth.keyname=Key-Name darf nicht leer sein
+error.oa.oauth.keystore=Keystore darf nicht leer sein und muss eine richtige URL sein.
+
+mail.userrequest.subject=Accountanforderung MOA-ID 2.x Konfigurationstool
+
+
+webpages.error.header=Es ist ein Fehler aufgetreten
+webpages.index.header=Welcome to MOA-ID 2.x Configuration
+webpages.index.desciption.head=Um dieses Service nutzen zu k\u00F6nnen m\u00FCssen sie sich einloggen.
+webpages.index.login=Login
+webpages.index.logout=Logout
+webpages.index.login.pvp2=Anmeldung mit B\u00FCrgerkarte oder Handy-Signature
+webpages.index.login.notallowed=Entweder sind Benutzername oder Passwort sind nicht korrekt oder der Account wurde noch nicht aktiviert.
+webpages.index.username.unkown=Der Benutzer ist nicht bekannt.
+webpages.index.username.notactive=Der Benutzer wurde durch den Administrator noch nicht freigeschalten.
+webpages.index.password.false=Das Passwort stimmt nicht.
+
+webpages.inportexport.header=Konfiguration Importieren/Exportieren
+webpages.inportexport.success=Die Konfiguration konnte erfolgreich importiert werden.
+webpages.inportexport.legacyimport.header=Legacy Konfiguration importieren (MOA-ID < 2.0)
+webpages.inportexport.legacyimport.upload=Legacy Konfiguration
+webpages.edit.import=Importieren
+webpages.edit.export=Exportieren
+webpages.inportexport.import.header=MOA-ID 2.x Konfiguration
+webpages.inportexport.import.upload=Konfiguration importieren
+webpages.inportexport.import.download=Konfiguration exportieren
+webpages.inportexport.descripten=ACHTUNG\: Die importierte Konfiguration ersetzt eine aktuell vorhandene Konfiguration vollst\u00E4ndig\!
+
+webpages.usermanagement.newuser=Neuen Benutzer erstellen
+webpages.usermanagement.header=Benutzerverwaltung
+webpages.listUsers.list.header=Liste aller vorhandenen Benutzer
+webpages.listUsers.list.first=Familien-/Firmenname
+webpages.listUsers.list.second=Vorname
+webpages.listUsers.list.third=Benutzername
+webpages.edituser.header=Benutzerdaten
+webpages.edituser.givenname=Vorname
+webpages.edituser.familyName=Familienname
+webpages.edituser.institut=Organisation
+webpages.edituser.phone=Telefonnummer
+webpages.edituser.mail=EMail Adresse
+webpages.edituser.access.header=Zugangsdaten
+webpages.edituser.username=Username
+webpages.edituser.password=Password
+webpages.edituser.password_second=Kennwort wiederholen
+webpages.edituser.bpk=BPK
+webpages.edituser.role.header=Rechte und Role
+webpages.edituser.active=Benutzer ist aktiviert
+webpages.edituser.admin=Benutzer ist Admin
+webpages.edit.delete.user=Benutzer l\u00F6schen
+webpages.edit.newUser=Neuen Benutzer anfordern
+webpages.edituser.isusernamepasswordallowed=Benutzername/Passwort erlauben
+webpages.edituser.changemailaddress.verify=Bevor Sie Online-Applikationen verwalten k\u00F6nnen muss Ihre Mailadresse verifzieren werden. Eine entsprechende Mail wurde bereits an Ihr angegebenes Postfach versendet.
+webpages.edituser.verify.mail.button=Mailadresse pr\u00FCfen
+webpages.edituser.verify.mail.message=Es wurde eine Verifikationsmail an Ihr Postfach versendet
+
+webpages.mainpage.menu.oa.insert=Neue Applikation anlegen
+webpages.mainpage.menu.oa.display=Meine Applikationen
+webpages.mainpage.menu.oa.search=Applikation suchen
+webpages.mainpage.menu.general.user=Meine Daten
+webpages.mainpage.menu.general.importexport=Importieren/Exportieren
+webpages.mainpage.menu.general.config.moaid=Allgemeine Konfiguration
+webpages.mainpage.menu.general.usermanagement=Benutzerverwaltung
+webpages.mainpage.menu.general.adminrequests=Offene Anfragen
+
+webpages.moaconfig.save.success=Die MOA-ID Konfiguration wurde erfolgreich gespeichert.
+webpages.moaconfig.header=Allgemeine Konfiguration
+webpages.oaconfig.general.publicURLPreFix=Public URL Prefix
+webpages.moaconfig.defaultbkus.header=Default BKUs
+webpages.moaconfig.slrequesttemplates.header=SecurtiyLayer Request Templates
+webpages.moaconfig.slrequesttemplates.local=Locale BKU
+webpages.moaconfig.slrequesttemplates.handy=Handy BKU
+webpages.moaconfig.slrequesttemplates.online=Online BKU
+webpages.moaconfig.certificates.header=Zertifikatspr\u00FCfung
+webpages.moaconfig.certificates.certstore=CertStoreDirecorty
+webpages.moaconfig.certificates.trustmanagerrev=TrustManagerRevocationChecking
+webpages.moaconfig.certificates.trustCACerts=TrustedCACertificates
+webpages.moaconfig.certificates.chainingmode=ChainingMode
+webpages.moaconfig.timeout.header=Session TimeOuts
+webpages.moaconfig.timeout.assertion=Assertion [sec]
+webpages.moaconfig.timeout.MOASessionCreated=SSO Session authentifiziert [sec]
+webpages.moaconfig.timeout.MOASessionUpdated=SSO Session letzter Zugriff [sec]
+webpages.moaconfig.moasp.header=MOA-SP Konfiguration
+webpages.moaconfig.moasp.idltrustprofile=Personenbindung Trustprofil
+webpages.moaconfig.moasp.authtrustprofile=Authentfizierungsblock Trustprofil
+webpages.moaconfig.moasp.authblocktransform=Authentfizierungsblock Transformationen
+webpages.moaconfig.moasp.url=URL zum MOA-SP Service
+webpages.moaconfig.identitylinksigners=IdentityLinkSigners
+webpages.moaconfig.services.header=Externe Services
+webpages.moaconfig.services.mandates=Online-Vollmachten Service URL
+webpages.moaconfig.services.szrgw=SZR Gateway Service URL
+webpages.moaconfig.sso.header=Single Sign-On
+webpages.moaconfig.sso.PublicUrl=SSO Service URL-Prefix
+webpages.moaconfig.sso.FriendlyName=SSO Service Name
+webpages.moaconfig.services.sso.Target=SSO Service Target
+webpages.moaconfig.services.sso.SpecialText=SSO AuthBlockText
+webpages.moaconfig.protocols.header=Protokolle
+webpages.moaconfig.protocols.allowed.header=Protokolle aktivieren
+webpages.moaconfig.protocols.legacy.header=Legacy Modus aktivieren
+webpages.moaconfig.protocols.legacy.saml1=SAML1
+webpages.moaconfig.protocols.legacy.pvp2=PVP2.1
+webpages.moaconfig.protocols.oauth=OpenID Connect
+webpages.moaconfig.protocols.saml1.header=SAML1 Konfiguration
+webpages.moaconfig.protocols.saml1.sourceID=SourceID
+webpages.moaconfig.protocols.pvp2.header=PVP2 Konfiguration
+webpages.moaconfig.protocols.pvp2.PublicUrlPrefix=PVP2 Service URL-Prefix
+webpages.moaconfig.protocols.pvp2.IssuerName=PVP Service Name
+webpages.moaconfig.protocols.pvp2.org.header=Organisation
+webpages.moaconfig.protocols.pvp2.org.name=Kurzbezeichnung
+webpages.moaconfig.protocols.pvp2.org.displayname=Vollst\u00E4ndiger Name
+webpages.moaconfig.protocols.pvp2.org.url=URL der Organisation
+webpages.moaconfig.protocols.pvp2.contact.header=Kontaktdaten
+webpages.moaconfig.protocols.pvp2.contact.surename=Familienname
+webpages.moaconfig.protocols.pvp2.contact.givenname=Vorname
+webpages.moaconfig.protocols.pvp2.contact.email=Mailadresse
+webpages.moaconfig.protocols.pvp2.contact.company=Unternehmen
+webpages.moaconfig.protocols.pvp2.contact.phone=Telefonnummer
+webpages.moaconfig.protocols.pvp2.contact.type=Type des Kontakts
+webpages.moaconfig.sl.transormations.header=SecurityLayer Transformationen
+webpages.moaconfig.sl.transormations.filename=Dateiname
+webpages.moaconfig.sl.transormations.upload=Neue Transformation hochladen
+
+webpages.listOAs.list.first=Eindeutige Kennung
+webpages.listOAs.list.second=Name der Online-Applikation
+
+webpages.searchoa.header=Online-Applikation suchen
+webpages.searchoa.search.friendlyname=Name der Online-Applikation
+webpages.searchoa.butten.search=Suchen
+
+webpages.oaconfig.header=Konfiguration der Onlineapplikation
+webpages.oaconfig.general.isActive=Online-Applikation ist aktiviert
+webpages.oaconfig.general.bku.header=BKU Konfiguration
+webpages.oaconfig.general.bku.local=Locale BKU
+webpages.oaconfig.general.bku.online=Online BKU
+webpages.oaconfig.general.bku.handy=Handy BKU
+webpages.oaconfig.general.bku.slversion=SecurityLayer Version
+webpages.oaconfig.general.bku.keyboxidentifier=KeyBoxIdentifier
+webpages.oaconfig.general.bku.legacy=SecurityLayerTemplates (Legacy Request)
+webpages.oaconfig.general.bku.sltemplate.first=SecurityLayer Template
+webpages.oaconfig.general.bku.sltemplate.second=SecurityLayer Template (WhiteList)
+webpages.oaconfig.general.bku.sltemplate.third=SecurityLayer Template (WhiteList)
+
+webpages.oaconfig.general.bku.delete=L\u00F6schen
+webpages.oaconfig.general.bku.bkuselection.header=BKU-Selection Template
+webpages.oaconfig.general.bku.bkuselection.filename=Dateiname
+webpages.oaconfig.general.bku.bkuselection.upload=Neues Template hochladen
+webpages.oaconfig.general.bku.sendassertion.header=Send-Assertion Template
+webpages.oaconfig.general.bku.sendassertion.filename=Dateiname
+webpages.oaconfig.general.bku.sendassertion.upload=Neues Template hochladen
+
+webpages.oaconfig.general.identification=Eindeutiger Identifikatior (PublicURLPrefix)
+webpages.oaconfig.general.mandate.header=Vollmachten
+webpages.oaconfig.general.mandate.profiles=Profile
+webpages.oaconfig.general.mandate.usemandate=Vollmachten (ja/nein)
+webpages.oaconfig.general.friendlyname=Name der Online-Applikation
+webpages.oaconfig.general.isbusinessservice=Privatwirtschaftliche Applikation
+webpages.oaconfig.general.isstorkservice=Stork Applikation
+webpages.oaconfig.general.public.header=&Ouml;ffentlicher Bereich
+webpages.oaconfig.general.stork.header=STORK Bereich
+webpages.oaconfig.general.stork.countrycode=Landesvorwahl
+webpages.oaconfig.general.target.friendlyname=Bezeichnung des Bereichs (Frei w\u00E4hlbar)
+webpages.oaconfig.general.target.admin.checkbox=Anderen Bereich frei definieren
+webpages.oaconfig.general.target.admin=Bereich (Frei w\u00E4hlbar)
+webpages.oaconfig.general.target.friendlyname.disabled=Bezeichnung des Bereichs (vom Administrator eingestellt)
+webpages.oaconfig.general.target.admin.disabled=Bereich (vom Administrator eingestellt)
+webpages.oaconfig.general.target=Bereich (Target)
+webpages.oaconfig.general.target.subsector=Sub-Bereich
+webpages.oaconfig.general.target.subsector.checkbox=Target verfeinern
+webpages.oaconfig.general.business.header=Privatwirtschaftlicher Bereich
+webpages.oaconfig.general.business.value=Identifikationsnummer
+webpages.oaconfig.general.business.type=Type der Identifikationsnummer
+webpages.oaconfig.general.aditional.header=Zus&auml;tzliche allgemeine Einstellungen
+webpages.oaconfig.general.aditional.authblocktext=AuthblockText
+webpages.oaconfig.general.aditional.iframe=B\u00FCrgerkartenauswahl im IFrame
+webpages.oaconfig.general.aditional.useUTC=UTC Zeit verwenden
+webpages.oaconfig.general.aditional.calculateHPI="TODO!"
+webpages.oaconfig.general.isHideBPKAuthBlock=bPK/wbPK im AuthBlock ausblenden
+
+webpages.oaconfig.menu.saml1.show=SAML1 Konfiguration einblenden
+webpages.oaconfig.menu.saml1.hidden=SAML1 Konfiguration ausblenden
+webpages.oaconfig.menu.pvp2.show=PVP2 Konfiguration einblenden
+webpages.oaconfig.menu.pvp2.hidden=PVP2 Konfiguration ausblenden
+webpages.oaconfig.menu.oauth20.show=OAuth 2.0 Konfiguration einblenden
+webpages.oaconfig.menu.oauth20.hidden=OAuth 2.0 Konfiguration ausblenden
+webpages.oaconfig.menu.vidp.show=VIDP Konfiguration einblenden
+webpages.oaconfig.menu.vidp.hidden=VIDP Konfiguration ausblenden
+
+webpages.oaconfig.menu.stork=STORK Konfiguration
+
+webpages.oaconfig.protocols.header=Authentifizierungsprotokolle
+
+webpages.oaconfig.general.BKUSelection.button.show=Login-Fenster Konfiguration einblenden
+webpages.oaconfig.general.BKUSelection.button.hidden=Login-Fenster Konfiguration ausblenden
+webpages.oaconfig.general.BKUSelection.header=Formularkonfiguration
+webpages.oaconfig.general.BKUSelection.isOnlyMandateLoginAllowed=Nur Vollmachtenanmeldung erlauben
+webpages.oaconfig.general.BKUSelection.backgroundcolor=Hintergrundfarbe der BKU-Auswahl
+webpages.oaconfig.general.BKUSelection.frontcolor=Vordergrundfarbe der BKU-Auswahl
+webpages.oaconfig.general.BKUSelection.header.backgroundcolor=Hintergrundfarbe der \u00DCberschrift
+webpages.oaconfig.general.BKUSelection.header.frontcolor=Vordergrundfarbe der \u00DCberschrift
+webpages.oaconfig.general.BKUSelection.header.text=\u00DCberschriftstext
+webpages.oaconfig.general.BKUSelection.header.button.background=Hintergrundfarbe der Schaltfl\u00E4chen
+webpages.oaconfig.general.BKUSelection.header.button.background.focus=Hintergrundfarbe der Schaltfl\u00E4chen (Focus)
+webpages.oaconfig.general.BKUSelection.header.button.front=Vordergrundfarbe der Schaltfl\u00E4chen
+webpages.oaconfig.general.BKUSelection.redirectTarget=Targetparameter
+webpages.oaconfig.general.BKUSelection.fonttype=Formularschrifttyp
+webpages.oaconfig.general.BKUSelection.fonttype.list=Formularschrifttypen
+webpages.oaconfig.general.BKUSelection.header.applet.height=Appleth\u00F6he
+webpages.oaconfig.general.BKUSelection.header.applet.width=Appletbreite
+
+webpages.oaconfig.sso.header=Single Sign-On
+webpages.oaconfig.sso.singlelogouturl=Single Log-Out URL
+webpages.oaconfig.sso.useauthdataframe=Zus\u00E4tzliche Userabfrage
+webpages.oaconfig.sso.usesso=Single Sign-On verwenden
+
+webpages.oaconfig.stork.header=Secure idenTity acrOss boRders linKed
+webpages.oaconfig.stork.usestork=STORK Logon aktivieren
+webpages.oaconfig.stork.attributes.header=angeforderte Attribute
+webpages.oaconfig.stork.attributes.used=anfordern?
+webpages.oaconfig.stork.attributes.name=Attributname
+webpages.oaconfig.stork.attributes.mandatory=obligatorisch?
+webpages.oaconfig.stork.enabledcpeps=aktivierte Ziell&auml;nder
+webpages.moaconfig.stork.pepslist=C-PEPS Konfiguration
+webpages.moaconfig.stork.newpeps=Neuen PEPS konfigurieren
+webpages.moaconfig.stork.removepeps=l\u00F6schen
+webpages.moaconfig.stork.qaa.default=Standard QAA-Level ausw\u00E4hlen
+webpages.moaconfig.stork.attributes.heading=Attributkonfiguration
+webpages.moaconfig.stork.attributes.new=Neues Attribut hinzuf\u00FCgen
+webpages.moaconfig.stork.attributes.heading.name=Attributname
+webpages.moaconfig.stork.attributes.heading.mandatory=zwingend
+webpages.moaconfig.stork.attributes.remove=l\u00F6schen
+webpages.moaconfig.stork.qaa=Mindest-QAA-Level f\u00FCr diese OA ausw\u00E4hlen
+
+webpages.oaconfig.protocols.saml1.header=SAML1 Konfiguration
+webpages.oaconfig.saml1.isActice=SAML1 aktivieren
+webpages.oaconfig.saml1.provideStammZahl=Stammzahl \u00FCbertragen
+webpages.oaconfig.saml1.provideAuthBlock=Authentifizierungsblock \u00FCbertragen
+webpages.oaconfig.saml1.provideIdentityLink=Personenbindung \u00FCbertragen
+webpages.oaconfig.saml1.provideCertificate=Zertifikat \u00FCbertragen
+webpages.oaconfig.saml1.provideFullMandateData=Vollst\u00E4ndige Vollmacht \u00FCbertragen
+webpages.oaconfig.saml1.useCondition=Usecondition
+webpages.oaconfig.saml1.conditionLength=ConditionLength
+
+webpages.oaconfig.protocols.pvp2.header=PVP2.x Konfiguration
+webpages.oaconfig.pvp2.reload=PVP2.x konfiguration neu laden
+webpages.oaconfig.pvp2.metaDataURL=URL zu den Metadaten
+webpages.oaconfig.pvp2.certifcate=Zertifikat hochladen
+webpages.oaconfig.pvp2.certifcate.info=Infos zum Zertifikat
+
+webpages.oaconfig.protocols.oauth20.header=OAuth 2.0 Konfiguration
+webpages.oaconfig.oauth20.clientId=Client ID
+webpages.oaconfig.oauth20.clientSecret=Client Passwort
+webpages.oaconfig.oauth20.redirectUri=Redirect Uri
+
+webpages.oaconfig.vidp.enabled=VIDP interface aktiv
+webpages.oaconfig.vidp.requireconsent=Zustimmung f\u00FCr das Ausliefern der Attribute vom Benutzer einholen?
+webpages.oaconfig.vidp.ap.new=Neuen Attribut Provider erstellen
+webpages.oaconfig.vidp.ap.remove=Entfernen
+webpages.oaconfig.vidp.ap.list=Liste der konfigurierten Attribut Provider
+
+
+message.title=Meldung:
+webpages.oaconfig.success=Die Online-Applikation {0} konnte erfolgreich gespeichert werden.
+webpages.oaconfig.success.admin=Die Online-Applikation {0} konnte erfolgreich gespeichert werden. Es ist jedoch eine Aktivierung durch den Administrator erforderlich.
+webpages.oaconfig.cancle=Die Bearbeitung der Online-Applikation {0} wurde abgebrochen.
+
+webpages.oaconfig.delete.message=Die Online-Applikation {0} wurde erfolgreich gel\u00F6scht.
+webpages.oaconfig.delete.error=Die Online-Applikation {0} konnte nicht gel\u00F6scht werden.
+
+webpages.edit.save=\u00C4nderungen Speichern
+webpages.edit.back=Zur\u00FCck und \u00C4nderungen verwerfen
+webpages.edit.delete=Online-Applikation l\u00F6schen
+
+webpages.header.info=Sie sind angemeldet als:
+webpages.header.lastlogin=Letzte Anmeldung am:
+
+webpages.openadminrequests.header=Offene Antr\u00E4ge
+webpages.openadminrequests.users.header=Benutzeraccounts
+webpages.openadminrequests.oas.header=Online-Applikationen
+
+
+validation.newuser.mailaddress=Die Validierung der Mailadresse konnte erfolgreich durchgef\u00FChrt werden.
+
+validation.edituser.familyname.empty=Der Familienname ist leer.
+validation.edituser.familyname.valid=Der Familienname enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.edituser.givenname.empty=Der Vorname ist leer.
+validation.edituser.givenname.valid=Der Vorname enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.edituser.institut.empty=Die Organisation ist leer.
+validation.edituser.institut.valid=Die Organisation enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.edituser.mail.empty=Die EMail Adresse ist leer.
+validation.edituser.mail.valid=Die EMail Adresse hat kein g\u00FCltiges Format.
+validation.edituser.phone.empty=Die Telefonnummer ist leer.
+validation.edituser.phone.valid=Die Telefonnummer hat kein g\u00FCltiges Form
+validation.edituser.username.empty=Der Benutzername ist leer.
+validation.edituser.username.valid=Der Benutzername enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.edituser.username.duplicate=Der Benutzername ist bereits vergeben
+validation.edituser.password.empty=Das Passwort ist leer.
+validation.edituser.password.valid=Das Passwort konnte nicht in einen g\u00FCltigen Schl\u00FCssel transferiert werden.
+validation.edituser.password.equal=Die Passw\u00F6rter sind nicht identisch.
+validation.edituser.bpk.valid=Die BPK enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+
+validation.general.SAML1SourceID=Die SAML1SourceID enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.publicURLprefix.empty=Public URL Prefix Feld ist leer.
+validation.general.publicURLprefix.valid=Public URL Prefix hat kein g\u00F6ltiges Format.
+validation.general.certStoreDirectory.empty=CertStoreDirectory Feld ist leer.
+validation.general.certStoreDirectory.valid=Das CertStoreDirectory Feld enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.Defaultchainigmode.empty=Es wurde kein DefaultChainingMode gew\u00E4hlt.
+validation.general.Defaultchainigmode.valid=Der DefaultChainingMode enth\u00E4lt einen ung\u00F6ltigen Wert.
+validation.general.IdentityLinkSigners.empty=Es wurde kein IdentityLinkSigner angegeben
+validation.general.IdentityLinkSigners.valid=Der IdentityLinkSigner in der Zeile {0} enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {1}
+validation.general.mandateservice.valid=Die URL zum Online-Vollmachten Service hat kein g\u00F6ltiges Format.
+validation.general.moasp.auth.transformation.empty=Die Transformation f\u00F6r den Authentfizierungsblock ist leer.
+validation.general.moasp.auth.transformation.valid=Die Transformation f\u00F6r den Authentfizierungsblock in der Zeile {0} enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {1}
+validation.general.moasp.auth.trustprofile.empty=Das TrustProfile zur Pr\u00F6fung des Authentfizierungsblock ist leer.
+validation.general.moasp.auth.trustprofile.valid=Das TrustProfile zur Pr\u00F6fung des Authentfizierungsblock enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.moasp.idl.trustprofile.empty=Das TrustProfile zur Pr\u00F6fung der Personenbindung ist leer.
+validation.general.moasp.idl.trustprofile.valid=Das TrustProfile zur Pr\u00F6fung der Personenbindung enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.moaspss.url.valid=Die URL zum MOA-SP/SS Service hat kein g\u00F6ltiges Format.
+validation.general.protocol.pvp2.issuername.valid=PVP2\: Service Name enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.org.displayname.valid=PVP2 Organisation\: Vollst\u00E4ndiger Name enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.org.name.valid=PVP2 Organisation\: Kurzbezeichnung enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.org.url.valid=PVP2 Organisation\: URL hat kein g\u00F6ltiges Format.
+validation.general.protocol.pvp2.serviceurl.valid=PVP2\: Service URL-Prefix hat kein g\u00F6ltiges Format.
+validation.general.protocol.pvp2.contact.company.valid=PVP2 Kontaktdaten\: Der Firmenname enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.contact.givenname.valid=PVP2 Kontaktdaten\: Der Familienname enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.contact.surename.valid=PVP2 Kontaktdaten\: Der Vorname enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.protocol.pvp2.contact.type.valid=PVP2 Kontaktdaten: Der angegebene Kontakttyp existiert nicht.
+validation.general.protocol.pvp2.contact.mail.valid=PVP2 Kontaktdaten\: Die EMail Adresse ist nicht g\u00FCltig.
+validation.general.protocol.pvp2.contact.phone.valid=PVP2 Kontaktdaten\: Die Telefonnummer ist nicht g\u00FCltig.
+validation.general.timeouts.assertion.valid=Das Feld Assertion TimeOut hat keinen g\u00F6ltigen Wert.
+validation.general.timeouts.moasessioncreated.valid=Das Feld MOASessionCreated TimeOut hat keinen g\u00FCltigen Wert.
+validation.general.timeouts.moasessionupdated.valid=Das Feld MOASessionUpdated TimeOut hat keinen g\u00FCltigen Wert.
+
+validation.general.slrequest.handy.empty=Die URL zum SecurityLayer Template f\u00F6r die Handy-BKU ist leer.
+validation.general.slrequest.handy.valid=Die URL zum SecurityLayer Template f\u00F6r die Handy-BKU hat kein g\u00F6ltiges Format.
+validation.general.slrequest.local.empty=Die URL zum SecurityLayer Template f\u00F6r die locale BKU ist leer.
+validation.general.slrequest.local.valid=Die URL zum SecurityLayer Template f\u00F6r die locale BKU hat kein g\u00F6ltiges Format.
+validation.general.slrequest.online.empty=Die URL zum SecurityLayer Template f\u00F6r die Online-BKU ist leer.
+validation.general.slrequest.online.valid=Die URL zum SecurityLayer Template f\u00F6r die Online-BKU hat kein g\u00F6ltiges Format.
+validation.general.sso.friendlyname.valid=Der SSO Service Name enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.sso.identificationnumber.valid=Die SSO IdentificationNumber enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.sso.publicurl.valid=Der SSO Service URL-Prefix hat kein g\u00F6ltiges Format.
+validation.general.sso.specialauthtext.valid=Der SSO AuthBlockText enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.sso.target.empty=Das SSO Target Feld ist leer.
+validation.general.sso.target.valid=Das SSO Target Feld enth\u00E4lt ein ung\u00FCltiges Target.
+validation.general.szrgw.url.valid=Die URL des SZR Gateways hat kein g\u00F6ltiges Format.
+validation.general.trustedcacerts.empty=Das Feld TrustedCACertificates ist leer.
+validation.general.trustedcacerts.valid=Das Feld TrustedCACertificates enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.slrequest.filename.valid=Der Dateiname der angegebenen SecurtityLayer Transformation enth\u00E4lt ein ung\u00FCltiges Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.slrequest.file.valid=Die angegebenen SecurtityLayer Transformation konnte nicht geladen werden.
+
+validation.general.aditionalauthblocktext=Der Zusatztext f\u00FCr den AuthBlock enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.bku.handy.empty=Die URL f\u00FCr die Handy-BKU ist leer.
+validation.general.bku.handy.valid=Die URL f\u00FCr die Handy-BKU hat kein g\u00FCltiges Format.
+validation.general.bku.local.empty=Die URL f\u00FCr die lokale BKU ist leer.
+validation.general.bku.local.valid=Die URL f\u00FCr die locale BKU hat kein g\u00FCltiges Format.
+validation.general.bku.online.empty=Die URL f\u00FCr die Online-BKU ist leer.
+validation.general.bku.online.valid=Die URL f\u00FCr die Online-BKU hat kein g\u00FCltiges Format.
+validation.general.oafriendlyname.empty=Es wurde kein Name f\u00FCr die Online-Applikation angegeben.
+validation.general.oafriendlyname.valid=Der Name der Online-Applikation enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.keyboxidentifier.empty=Es wurde kein KeyBoxIdentifier ausgew\u00E4hlt.
+validation.general.keyboxidentifier.valid=Der KeyBoxIdentifier hat ein ung\u00FCltiges Format.
+validation.general.sltemplates.empty=Wenn der Legacymodus verwendet werden soll muss zumindest ein SecurityLayer Template angegeben werden.
+validation.general.sltemplate1.valid=Die erste SecurityLayer Template URL hat kein g\u00FCltiges Format.
+validation.general.sltemplate2.valid=Die zweite SecurityLayer Template URL hat kein g\u00FCltiges Format.
+validation.general.sltemplate3.valid=Die dritte SecurityLayer Template URL hat kein g\u00FCltiges Format.
+validation.general.mandate.profiles=Die Liste von Vollmachtsprofilen enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.mandate.usemandate=Die Konfiguration von Vollmachtsprofile ist nur mit aktivierten Vollmachten m\u00F6glich.
+validation.general.target.empty=Der Target f\u00FCr die Online-Applikation ist leer.
+validation.general.target.valid=Der Target f\u00FCr die Online-Applikation hat kein g\u00FCltiges Format.
+validation.general.target.subsector.valid=Der Target-Subsektor hat kein g\u00FCltiges Format.
+validation.general.target.admin.valid=Der Admin-Target f\u00FCr die Online-Applikation hat kein g\u00FCltiges Format.
+validation.general.target.publicserviceurl=Die Domain des eindeutigen Identifiers f\u00FCr die Online-Applikation erlaubt nur Applikationen aus dem privatwirtschaftlichen Bereich.
+validation.general.slversion=Die SecurtiyLayer Version ist kein Zahlenformat.
+validation.general.slversion.business=Im privatwirtschaftlichen Bereich muss die SecurityLayerversion mindestes 1.2 betragen. Die SLVersion wurde auf 1.2 ge\u00E4ndert.
+validation.general.targetfriendlyname=Der Name des Bereichs (Target) enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.identificationtype.valid=Der Identifikationstype wird nicht unterst\u00FCtzt.
+validation.general.identificationnumber.empty=Im privatwirtschaftlichen Bereich ist eine Identifikationsnummer erforderlich.
+validation.general.identificationnumber.valid=Die Identifikationsnummer f\u00FCr den privatwirtschaftlichen Bereich enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.identificationnumber.fn.valid=Die Firmenbuchnummer hat kein g\u00FCltiges Format.
+validation.general.oaidentifier.empty=Es wurde kein eindeutiger Identifier f\u00FCr die Online-Applikation angegeben.
+validation.general.oaidentifier.valid=Der eindeutige Identifier f\u00FCr die Online-Applikation ist keine g\u00FCltige URL.
+validation.general.oaidentifier.notunique=Der gew\u00E4hlte eindeutige Identifier ist bereits vorhanden. Eine Eintragung der Online-Applikation ist nicht m\u00F6glich.
+validation.general.stork.sptarget=Der STORK SP-Target ist leer.
+validation.general.stork.sptargetsize=Die Definition von STORK SP-Target ist nicht korrekt: zu viele Buchstaben.
+validation.general.bkuselection.filename.valid=Der Dateiname des BKU-Selektion Templates enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.bkuselection.file.valid=Das BKU-Selektion Templates konnte nicht geladen werden.
+validation.general.bkuselection.file.selected=Es kann nur EIN BKU-Selektion Template angegeben werden.
+validation.general.sendassertion.filename.valid=Der Dateiname des Send-Assertion Templates enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.sendassertion.file.valid=Das Send-Assertion Templates konnte nicht geladen werden.
+validation.general.sendassertion.file.selected=Es kann nur EIN Send-Assertion Template angegeben werden.
+
+
+validation.stork.cpeps.cc=CPEPS L\u00E4ndercode folgt nicht ISO 3166-2
+validation.stork.cpeps.empty=CPEPS Konfiguration ist unvollst\u00E4ndig
+validation.stork.cpeps.url=CPEPS URL ist ung\u00FCltig
+validation.stork.requestedattributes=STORK Attribute sind fehlerhaft. Bsp.: attr1, attr2
+validation.stork.qaa.outofrange=G\u00FCltige QAA Werte sind 1, 2, 3, und 4
+validation.stork.attributes.empty=Es muss mindestens ein Attribut definiert sein
+validation.stork.ap.url.valid=Ung\u00FCltige AttributProvider Url
+validation.stork.ap.name.valid=Ung\u00FCltiger AttributProvider Name
+validation.stork.ap.attributes.valid=Ung\u00FCltige Attributconfiguration f\u00FCr ein Attribut Provider Plugin. Feld darf nicht leer sein und ist als csv anzugeben.
+
+validation.pvp2.metadataurl.empty=Keine Metadaten URL angegeben.
+validation.pvp2.metadataurl.valid=Die Metadaten URL wei\u00DFt kein g\u00FCltiges URL Format auf.
+validation.pvp2.metadataurl.read=Unter der angegebenen Metadaten URL konnten keine Informationen abgerufen werden.
+validation.pvp2.metadata.verify=Die Metadaten konnten nicht mit dem angegebenen Zertifikat verifziert werden.
+validation.pvp2.certificate.format=Das angegebene PVP2 Zertifikat wei\u00DFt kein g\u00FCltiges Format auf.
+validation.pvp2.certificate.notfound=Kein PVP2 Zertifikat eingef\u00FCgt.
+
+validation.sso.logouturl.empty=Eine URL zum Single Log-Out Service ist erforderlich.
+validation.sso.logouturl.valid=Die URL zum Single Log-Out Service wei\u00DFt kein g\u00FCltiges Format auf.
+
+validation.saml1.providestammzahl=ProvideStammZahl kann nicht mit Applikationen aus dem privatwirtschaftlichen Bereich kombiniert werden.
+
+validation.general.bkuselection.specialfeatures.valid=Die speziellen Einstellungen f\u00FCr die BKU Auswahl (Vollmachtsanmeldung ausblenden / zwingend voraussetzen) k\u00F6nnen nicht in Kombination mit SSO verwendet werden.
+validation.general.bkuselection.specialfeatures.combination=Eine zwingend erforderliche Vollmachtenanmeldung in Kombination mit einer ausgeblendeten Vollmachtenauswahlcheckbox ist nicht m\u00F6glich.
+validation.general.form.color.background=Die Hintergrundfarbe f\\u00FCr die BKU Auswahl enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.color.front=Die Vordergrundfarbe f\\u00FCr die BKU Auswahl enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.header.color.back=Die Hintergrundfarbe der BKU-Auswahl\\u00FCberschrift enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.header.color.front=Die Vordergrundfarbe der BKU-Auswahl\\u00FCberschrift enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.header.text=Die BKU-Auswahl\\u00FCberschrift enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.form.button.color.back.focus=Die Hintergrundfarbe f\\u00FCr Focus der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.button.color.back=Die Hintergrundfarbe der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.button.color.front=Die Vordergrundfarbe der BKU-Auswahlbuttons enth\\u00E4lt keinen g\\u00FCltigen Hexadezimalwert. (z.B. \\\#FFFFFF)
+validation.general.form.appletredirecttarget=Der RedirectTarget beinhaltet einen ung\\u00FCltiten Wert.
+validation.general.form.fonttype=Der BKU-Auswahl Schrifttyp enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0}
+validation.general.form.applet.width=Die Appleth\u00F6he ist keine g\\u00FCltige Zahl.
+validation.general.form.applet.height=Die Appletbreite ist keine g\\u00FCltige Zahl.
diff --git a/id/ConfigWebTool/src/main/webapp/css/index.css b/id/ConfigWebTool/src/main/webapp/css/index.css
index e3d2763c2..4f497faaa 100644
--- a/id/ConfigWebTool/src/main/webapp/css/index.css
+++ b/id/ConfigWebTool/src/main/webapp/css/index.css
@@ -183,6 +183,11 @@ body {
margin-left: 10px;
}
+.oa_protocol_area >h5 {
+ clear: both;
+ margin-left: 10px;
+ padding-top: 10px;
+}
.oa_config_block {
padding-left: 15px;
@@ -218,6 +223,12 @@ body {
padding-top: 25px;
}
+.oa_config_block h4 {
+ clear: both;
+ padding-top: 20px;
+ margin-bottom: 10px;
+}
+
#loadOA_webpages_oaconfig_pvp2_certifcate_info{
width: 100%;
}
diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js
index 384e40509..d31a65d87 100644
--- a/id/ConfigWebTool/src/main/webapp/js/common.js
+++ b/id/ConfigWebTool/src/main/webapp/js/common.js
@@ -22,17 +22,33 @@
*******************************************************************************/
function oaBusinessService() {
if ($('#OAisbusinessservice').attr('checked') == 'checked') {
-
- $('#oa_config_businessservice').css('display', "block");
+ $('#OAisstorkservice').attr('checked',false);
+ $('#oa_config_storkservice').css('display', "none");
+ $('#oa_config_businessservice').css('display', "block");
$('#oa_config_publicservice').css('display', "none");
} else {
-
- $('#oa_config_businessservice').css('display', "none");
+ $('#oa_config_storkservice').css('display', "none");
+ $('#oa_config_businessservice').css('display', "none");
$('#oa_config_publicservice').css('display', "block");
}
}
+function oaStorkService() {
+ if ($('#OAisstorkservice').attr('checked') == 'checked') {
+ $('#OAisbusinessservice').attr('checked',false);
+ $('#oa_config_storkservice').css('display', "block");
+ $('#oa_config_businessservice').css('display', "none");
+ $('#oa_config_publicservice').css('display', "none");
+
+ } else {
+ $('#oa_config_storkservice').css('display', "none");
+ $('#oa_config_businessservice').css('display', "none");
+ $('#oa_config_publicservice').css('display', "block");
+
+ }
+}
+
function oaSSOService() {
if ($('#OAuseSSO').attr('checked') == 'checked') {
@@ -45,12 +61,23 @@ function oaSSOService() {
}
}
function oaStork() {
- if ($('#OAuseSTORKLogon').attr('checked') == 'checked') {
+ if ($('#OAuseSTORKLogon').is(':checked')) {
$('#stork_block').css('display', "block");
} else {
$('#stork_block').css('display', "none");
}
}
+function oaVIDP() {
+ if ($('#oa_vidp_area').css('display') == "none") {
+ $('#oa_vidp_area').css('display', "block");
+ $('#button_vidp_show').css('display', "none");
+ $('#button_vidp_hidden').css('display', "block");
+ } else {
+ $('#oa_vidp_area').css('display', "none");
+ $('#button_vidp_show').css('display', "block");
+ $('#button_vidp_hidden').css('display', "none");
+ }
+}
function oaSAML1() {
if ($('#oa_saml1_area').css('display') == "block") {
$('#oa_saml1_area').css('display', "none");
@@ -187,12 +214,16 @@ function userOnLoad() {
return true;
}
function oaOnLoad() {
+ oaStorkService();
oaBusinessService();
oaSSOService();
oaLegacyService();
+ oaStork();
AdminTarget();
oaTargetSubSector();
+ oaVIDP();
+
$(".colorfield").each(
function() {
$(this).ColorPicker({
@@ -210,7 +241,12 @@ function oaOnLoad() {
function newPeps() {
var target = $(document.getElementById("stork_pepslist").getElementsByTagName("tr")).last()[0];
var clone = target.cloneNode(true);
- var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]);
+ try {
+ var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]);
+ } catch (err) {
+
+ var lastindex = 1;
+ }
var nextindex = lastindex + 1;
clone.innerHTML = clone.innerHTML.replace(/name="storkconfig.cpepslist\[\d/g, 'name="storkconfig.cpepslist[' + nextindex);
clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2');
@@ -224,4 +260,13 @@ function newStorkAttribute() {
clone.innerHTML = clone.innerHTML.replace(/name="storkconfig.attributes\[\d/g, 'name="storkconfig.attributes[' + nextindex);
clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2');
target.parentNode.appendChild(clone);
+}
+function newAp() {
+ var target = $(document.getElementById("stork_aplist").getElementsByTagName("tr")).last()[0];
+ var clone = target.cloneNode(true);
+ var lastindex = parseInt(clone.innerHTML.match(/name="storkOA.attributeProviderPlugins\[(\d)/)[1]);
+ var nextindex = lastindex + 1;
+ clone.innerHTML = clone.innerHTML.replace(/name="storkOA.attributeProviderPlugins\[\d/g, 'name="storkOA.attributeProviderPlugins[' + nextindex);
+ clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2');
+ target.parentNode.appendChild(clone);
} \ No newline at end of file
diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
index 9f89f9a9d..945d4b0b5 100644
--- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
+++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
@@ -248,14 +248,19 @@
key="webpages.moaconfig.stork.qaa.default"
labelposition="left" />
<h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.pepslist", request) %></h4>
- <table id="stork_pepslist">
+ <table id="stork_pepslist">
<tr><th>Country Shortcode</th><th>PEPS URL</th>
<s:iterator value="storkconfig.cpepslist" status="stat">
<tr><td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].countryCode" value="%{countryCode}" cssClass="textfield_short"/></td>
<td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].URL" value="%{URL}" cssClass="textfield_long"/></td>
<td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr>
</s:iterator>
- </table>
+ <s:if test="%{storkconfig.cpepslist == null}">
+ <tr><td><s:textfield name="storkconfig.cpepslist[0].countryCode" value="CC" cssClass="textfield_short"/></td>
+ <td><s:textfield name="storkconfig.cpepslist[0].URL" value="http://" cssClass="textfield_long"/></td>
+ <td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr>
+ </s:if>
+ </table>
<input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' />
<h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.attributes.heading", request) %></h4>
<table id="stork_attributelist">
diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp
index e182fd805..d5396d06e 100644
--- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp
+++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp
@@ -59,16 +59,29 @@
key="webpages.oaconfig.general.friendlyname"
cssClass="textfield_long">
</s:textfield>
-
- <s:checkbox name="generalOA.businessService"
- value="%{generalOA.businessService}"
- labelposition="left"
- key="webpages.oaconfig.general.isbusinessservice"
- cssClass="checkbox"
- onclick="oaBusinessService();"
- id="OAisbusinessservice"
- disabled="%{isOnlyBusinessService()}">
- </s:checkbox>
+
+ <s:checkbox name="generalOA.businessService"
+ value="%{generalOA.businessService}"
+ labelposition="left"
+ key="webpages.oaconfig.general.isbusinessservice"
+ cssClass="checkbox"
+ onclick="oaBusinessService();"
+ id="OAisbusinessservice"
+ >
+ </s:checkbox>
+
+ <s:if test="authUser.isAdmin()">
+ <s:checkbox name="generalOA.storkService"
+ value="%{generalOA.storkService}"
+ labelposition="left"
+ key="webpages.oaconfig.general.isstorkservice"
+ cssClass="checkbox"
+ onclick="oaStorkService();"
+ id="OAisstorkservice"
+ disabled="%{isOnlyStorkService()}">
+ </s:checkbox>
+ </s:if>
+
</div>
<div id="oa_config_businessservice" class="oa_config_block">
@@ -89,6 +102,19 @@
disabled="%{isDeaktivededBusinessService()}">
</s:textfield>
</div>
+
+ <s:if test="authUser.isAdmin()">
+ <div id="oa_config_storkservice" class="oa_config_block">
+ <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.general.stork.header", request) %></h3>
+ <s:textfield name="generalOA.storkSPTargetCountry"
+ labelposition="left"
+ key="webpages.oaconfig.general.stork.countrycode"
+ value="%{generalOA.storkSPTargetCountry}"
+ cssClass="textfield_middle"
+ disabled="%{isDeactivatedStorkService()}">
+ </s:textfield>
+ </div>
+ </s:if>
<s:if test="!isOnlyBusinessService()">
<div id="oa_config_publicservice" class="oa_config_block">
@@ -362,9 +388,11 @@
name="storkOA.qaa"
key="webpages.moaconfig.stork.qaa"
labelposition="left" />
- <h4>Attributes</h4>
+ <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.header", request) %></h4>
<table>
- <tr><th>verwendet</th><th>Attributname</th><th>mandatory</th></tr>
+ <tr><th><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.used", request) %></th>
+ <th><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.name", request) %></th>
+ <th><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.mandatory", request) %></th></tr>
<s:iterator value="storkOA.helperAttributes" status="stat">
<tr><td><s:checkbox name="storkOA.helperAttributes[%{#stat.index}].used" value="%{used}" disabled="%{readOnly}" /></td>
<td><s:property value="%{name}" /><s:hidden name="storkOA.helperAttributes[%{#stat.index}].name" value="%{name}" /></td>
@@ -384,6 +412,13 @@
<button type="button" class="oa_buttons" onclick="oaSAML1();" id="button_saml1_hidden">
<%=LanguageHelper.getGUIString("webpages.oaconfig.menu.saml1.hidden", request) %>
</button>
+
+ <button type="button" class="oa_buttons" onclick="oaVIDP();" id="button_vidp_show">
+ <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.vidp.show", request) %>
+ </button>
+ <button type="button" style="display:none" class="oa_buttons" onclick="oaVIDP();" id="button_vidp_hidden">
+ <%=LanguageHelper.getGUIString("webpages.oaconfig.menu.vidp.hidden", request) %>
+ </button>
</s:if>
<button type="button" class="oa_buttons" onclick="oaPVP2();" id="button_pvp2_show">
@@ -496,6 +531,36 @@
cssClass="textfield_long">
</s:textfield>
</div>
+
+
+ <div id="oa_vidp_area" class="oa_protocol_area">
+ <h4><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.header", request) %></h4>
+
+ <p><s:checkbox name="storkOA.vidpEnabled"
+ value="%{storkOA.vidpEnabled}"
+ labelposition="left"
+ key="webpages.oaconfig.vidp.enabled"
+ cssClass="checkbox"
+ id="OAuseVidp" /></p>
+ <p><s:checkbox name="storkOA.requireConsent"
+ value="%{storkOA.requireConsent}"
+ labelposition="left"
+ key="webpages.oaconfig.vidp.requireconsent"
+ cssClass="checkbox"
+ id="OArequireConsent" /></p>
+ <h5><%=LanguageHelper.getGUIString("webpages.oaconfig.vidp.ap.list", request) %></h5>
+ <table id="stork_aplist">
+ <tr><th>AP Plugin</th><th>URL</th><th>Attribute (CSV)</th></tr>
+ <s:iterator value="storkOA.attributeProviderPlugins" status="stat">
+ <tr><td><s:select name="storkOA.attributeProviderPlugins[%{#stat.index}].name" value="%{name}" list="%{storkOA.availableAttributeProviderPlugins}"/></td>
+ <td><s:textfield name="storkOA.attributeProviderPlugins[%{#stat.index}].url" value="%{url}" cssClass="textfield_mail"/></td>
+ <td><s:textfield name="storkOA.attributeProviderPlugins[%{#stat.index}].attributes" value="%{attributes}" cssClass="textfield_mail"/></td>
+ <td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.oaconfig.vidp.ap.remove", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr>
+ </s:iterator>
+ </table>
+ <input type="button" value="<%=LanguageHelper.getGUIString("webpages.oaconfig.vidp.ap.new", request) %>" onclick='newAp();' />
+
+ </div>
</div>
diff --git a/id/assembly-auth.xml b/id/assembly-auth.xml
index 9fa082ac2..4bb12dbab 100644
--- a/id/assembly-auth.xml
+++ b/id/assembly-auth.xml
@@ -3,8 +3,8 @@
<formats>
<format>dir</format>
-<!-- <format>zip</format>
- <format>tar.gz</format> -->
+ <format>zip</format>
+ <!-- <format>tar.gz</format> -->
</formats>
<baseDirectory>moa-id-auth-${project.version}</baseDirectory>
@@ -64,7 +64,7 @@
<binaries>
<includeDependencies>true</includeDependencies>
<outputDirectory>/</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
<dependencySets>
<dependencySet>
<includes>
@@ -110,7 +110,7 @@
<binaries>
<includeDependencies>false</includeDependencies>
<outputDirectory>/</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
<unpack>false</unpack>
</binaries>
</moduleSet>
@@ -123,7 +123,7 @@
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>../</outputDirectory>
<includeModuleDirectory>true</includeModuleDirectory>
- <outputDirectoryMapping>/source/${module.artifactId}/src</outputDirectoryMapping>
+ <outputDirectoryMapping>/source/${artifactId}/src</outputDirectoryMapping>
<excludes>
<exclude>**/target/**</exclude>
<exclude>**/bin/**</exclude>
@@ -137,8 +137,18 @@
<binaries>
<includeDependencies>false</includeDependencies>
<outputDirectory>/</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
<unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>iaik:commons-iaik</include>
+ <include>MOA:moa-common</include>
+ </includes>
+ <outputDirectory>/source/repositority</outputDirectory>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
+ </dependencySet>
+ </dependencySets>
</binaries>
</moduleSet>
diff --git a/id/assembly-proxy.xml b/id/assembly-proxy.xml
index 3f70474b6..12ff534c2 100644
--- a/id/assembly-proxy.xml
+++ b/id/assembly-proxy.xml
@@ -4,7 +4,7 @@
<formats>
<format>dir</format>
<format>zip</format>
- <format>tar.gz</format>
+ <!-- <format>tar.gz</format> -->
</formats>
<baseDirectory>moa-id-proxy-${project.version}</baseDirectory>
@@ -51,7 +51,7 @@
<binaries>
<includeDependencies>true</includeDependencies>
<outputDirectory>/</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
<dependencySets>
<dependencySet>
<includes>
@@ -61,7 +61,7 @@
<include>xalan-bin-dist:serializer</include>
</includes>
<outputDirectory>/endorsed</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
</dependencySet>
<dependencySet>
<includes>
@@ -71,7 +71,7 @@
<include>iaik.prod:iaik_Pkcs11Wrapper:jar</include>
</includes>
<outputDirectory>/ext</outputDirectory>
- <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>
<unpack>false</unpack>
diff --git a/id/history.txt b/id/history.txt
index 394436f65..f70fe56ae 100644
--- a/id/history.txt
+++ b/id/history.txt
@@ -2,29 +2,37 @@ Dieses Dokument zeigt die Veränderungen und Erweiterungen
von MOA-ID auf.
History MOA-ID:
+Version MOA-ID Pre-Release 2.0-RC2: Änderungen seit Version MOA-ID 2.0-RC1
+- Änderungen:
+ - Speicherung von applikationsspezifischen Vollmachtsprofilen angepasst
+ - Anpassungen für den Betrieb von MOA-ID-Auth im Cluster.
+ Diese Version benötigt keine applikationsserverspezifische Session Replication.
+ - Weitere kleine Bug-Fixes
+
+- Neuerungen:
+ - PVP2 unterstützt nun auch transiente Identifier.
+
=====
-Version MOA-ID Pre-Release 2.0.0: Änderungen seit Version MOA-ID 1.5.1
+Version MOA-ID Pre-Release 2.0-RC1: Änderungen seit Version MOA-ID 1.5.1
- Neuerungen:
- Unterstützung der Authentifizierungsprotokolle PVP 2.1 und OpenID Connect
- Unterstützung von Single-Sign On
- Erweitertes Statisik-Logging in Datenbank
- Monitoring der internen Funktionalität
- - Konfiguration mittels webbasierter Applikation
+ - Konfiguration mittels webbasierter Applikation
+ - Anmeldung ausländischer Bürger mittels STORK 2
- Änderungen:
- Umstellung der Konfiguration auf textuelle Basiskonfiguration in Kombination
einer datenbankbasierten Konfiguration
- Unterstützung paralleler Authentifizerungsvorgänge aus einem Browser
- Zentrale durch MOA-ID zur Verfügung gestellte BKU Auswahl
- Sessionverwaltung in Datenbank ausgelagert
- - Targetpa
-
-
-
-
-
+ - Fehlerrückgabe via Authentifizierungsprotokoll bei allen unterstützten Protokollen
+ - Modulares Interface zur Implementierung zusätzlicher Protokolle
+- Fixed Bug http://mail-archives.apache.org/mod_mbox/www-announce/201402.mbox/%3C52F373FC.9030907@apache.org%3E
=====
diff --git a/id/oa/pom.xml b/id/oa/pom.xml
index 621c428bd..cc2bff4b0 100644
--- a/id/oa/pom.xml
+++ b/id/oa/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>MOA</groupId>
<artifactId>id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -24,10 +24,25 @@
<name>Internet2</name>
<url>https://build.shibboleth.net/nexus/content/groups/public/</url>
</repository>
+ <repository>
+ <id>IAIK Local</id>
+ <name>iaik/libs</name>
+ <url>http://nexus.iaik.tugraz.at/nexus/content/repositories/iaik/</url>
+ </repository>
</repositories>
<build>
<finalName>oa</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
<dependencies>
@@ -53,8 +68,13 @@
<artifactId>xmltooling</artifactId>
<version>1.4.0</version>
</dependency>
-
- <dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
@@ -84,4 +104,5 @@
</dependency>
</dependencies>
+
</project>
diff --git a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/Configuration.java b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/Configuration.java
index c143d050b..85f16e11f 100644
--- a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/Configuration.java
+++ b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/Configuration.java
@@ -40,6 +40,7 @@ import java.util.Timer;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.httpclient.HttpClient;
+import org.apache.log4j.Logger;
import org.opensaml.DefaultBootstrap;
import org.opensaml.saml2.metadata.provider.HTTPMetadataProvider;
import org.opensaml.xml.parse.BasicParserPool;
@@ -52,6 +53,8 @@ import at.iaik.commons.util.MiscUtil;
public class Configuration {
+ private static final Logger log = Logger.getLogger(Configuration.class);
+
private Properties props;
private static final String SYSTEM_PROP_CONFIG = "moa.id.demoOA";
@@ -216,6 +219,8 @@ public class Configuration {
//load OpenSAML library
DefaultBootstrap.bootstrap();
+ log.info("Demo Application initializaten finished.");
+
} catch ( FileNotFoundException e) {
throw new ConfigurationException("DemoOA configuration is not found at " + configFileName);
@@ -259,6 +264,8 @@ public class Configuration {
pvp2logininitialzied = true;
+ log.info("Load IDP Metadata finished.");
+
} catch (Exception e) {
throw new ConfigurationException("PVP2 authentification can not be initialized.", e);
}
diff --git a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/Authenticate.java b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/Authenticate.java
index 5bf9c4970..00d82296c 100644
--- a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/Authenticate.java
+++ b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/Authenticate.java
@@ -129,10 +129,11 @@ public class Authenticate extends HttpServlet {
authReq.setSubject(subject);
issuer.setFormat(NameIDType.ENTITY);
authReq.setIssuer(issuer);
+
NameIDPolicy policy = SAML2Utils
.createSAMLObject(NameIDPolicy.class);
- policy.setAllowCreate(true);
- policy.setFormat(NameID.PERSISTENT);
+ policy.setAllowCreate(true);
+ policy.setFormat(NameID.PERSISTENT);
authReq.setNameIDPolicy(policy);
String entityname = config.getPVP2IDPMetadataEntityName();
diff --git a/id/pom.xml b/id/pom.xml
index db4ee137e..6b96451fa 100644
--- a/id/pom.xml
+++ b/id/pom.xml
@@ -9,12 +9,12 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>id</artifactId>
<packaging>pom</packaging>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
<name>MOA ID</name>
<modules>
<module>oa</module>
- <module>templates</module>
+<!-- <module>templates</module> -->
<module>server</module>
<module>ConfigWebTool</module>
</modules>
@@ -24,4 +24,41 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>enforce-banned-dependencies</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <searchTransitive>true</searchTransitive>
+ <excludes>
+ <!-- <exclude>commons-logging</exclude> -->
+ <exclude>org.slf4j:1.5*</exclude>
+ <exclude>org.slf4j:1.6*</exclude>
+ <exclude>SamlEngine:1.1*</exclude>
+ <exclude>SamlEngine:1.2*</exclude>
+ <exclude>Commons:1.1*</exclude>
+ <exclude>Commons:1.2*</exclude>
+
+ <!-- <exclude>org.springframework:2.*</exclude>
+ <exclude>org.springframework:3.0.*</exclude> -->
+ </excludes>
+ </bannedDependencies>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
diff --git a/id/server/auth/moa-id-auth.iml b/id/server/auth/moa-id-auth.iml
new file mode 100644
index 000000000..67a88ff74
--- /dev/null
+++ b/id/server/auth/moa-id-auth.iml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ <root url="file://$MODULE_DIR$/src/main/wsdl" relative="WEB-INF/classes/resources/wsdl" />
+ </webroots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.6" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.tuckey:urlrewritefilter:4.0.3" level="project" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ <orderEntry type="module" module-name="moa-id-lib" />
+ <orderEntry type="library" name="Maven: eu.stork:oasis-dss-api:1.0.0-RELEASE" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
+ <orderEntry type="module" module-name="moa-id-commons" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-c3p0:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:maven-hyperjaxb3-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.annox:annox:0.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-tools:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-testing:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: xmlunit:xmlunit:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-persistence:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-customizations:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring:2.0.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.org.apache.xml.internal:resolver:20050927" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-project:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-model:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:1.5.15" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.11" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
+ <orderEntry type="library" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-profile:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact-manager:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6" level="project" />
+ <orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-registry:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jfrog.maven.annomojo:maven-plugin-anno:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-xjc:2.2.4-1" level="project" />
+ <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
+ <orderEntry type="module" module-name="Commons" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.6.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.4.0" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.5.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xml-apis:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xercesImpl:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:serializer:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
+ <orderEntry type="module" module-name="SamlEngine" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-tools:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-rt:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3" level="project" />
+ <orderEntry type="library" name="Maven: dav4j:dav4j:0.1" level="project" />
+ <orderEntry type="library" name="Maven: httpsclient:httpsclient:JSSE-1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_X509TrustManager:0.3" level="project" />
+ <orderEntry type="library" name="Maven: regexp:regexp:1.3" level="project" />
+ <orderEntry type="library" name="Maven: com.googlecode.jsontoken:jsontoken:1.0" level="project" />
+ <orderEntry type="library" name="Maven: com.google.code.gson:gson:1.4" level="project" />
+ <orderEntry type="library" name="Maven: com.google.collections:google-collections:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/auth/pom.xml b/id/server/auth/pom.xml
index 987ae1951..1f8417ea2 100644
--- a/id/server/auth/pom.xml
+++ b/id/server/auth/pom.xml
@@ -2,7 +2,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -79,8 +79,13 @@
<groupId>MOA.id.server</groupId>
<artifactId>moa-id-lib</artifactId>
</dependency>
-
- <!-- transitive dependencies we don't want to include into the war -->
+ <dependency>
+ <groupId>eu.stork</groupId>
+ <artifactId>oasis-dss-api</artifactId>
+ <version>1.0.0-RELEASE</version>
+ </dependency>
+
+ <!-- transitive dependencies we don't want to include into the war -->
<dependency>
<groupId>iaik.prod</groupId>
<artifactId>iaik_jce_full</artifactId>
diff --git a/id/server/auth/src/main/webapp/BKAuswahl-MOA-Template-Howto.pdf b/id/server/auth/src/main/webapp/BKAuswahl-MOA-Template-Howto.pdf
deleted file mode 100644
index 857fcc1dd..000000000
--- a/id/server/auth/src/main/webapp/BKAuswahl-MOA-Template-Howto.pdf
+++ /dev/null
Binary files differ
diff --git a/id/server/auth/src/main/webapp/Blockdiagramm.png b/id/server/auth/src/main/webapp/Blockdiagramm.png
new file mode 100644
index 000000000..f5bdb9e3a
--- /dev/null
+++ b/id/server/auth/src/main/webapp/Blockdiagramm.png
Binary files differ
diff --git a/id/server/auth/src/main/webapp/WEB-INF/urlrewrite.xml b/id/server/auth/src/main/webapp/WEB-INF/urlrewrite.xml
index 2f17c7d98..6f451ec79 100644
--- a/id/server/auth/src/main/webapp/WEB-INF/urlrewrite.xml
+++ b/id/server/auth/src/main/webapp/WEB-INF/urlrewrite.xml
@@ -52,7 +52,37 @@
<to type="forward">/dispatcher?mod=id_pvp2x&amp;action=Soap</to>
</rule>
- <rule match-type="regex">
+ <rule match-type="regex">
+ <from>^/stork2/StartAuthentication$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=AuthenticationRequest&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/ResumeAuthentication$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=AttributeCollector&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/CompleteAuthentication$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=ConsentEvaluator&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/SendPEPSAuthnRequest$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=AuthenticationRequest&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/ServiceProvider$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=AuthenticationRequest&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/SendPEPSAuthnRequest$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=AuthenticationRequest&amp;%{query-string}</to>
+ </rule>
+ <rule match-type="regex">
+ <from>^/stork2/RetrieveMandate$</from>
+ <to type="forward">/dispatcher?mod=id_stork2&amp;action=MandateRetrievalRequest&amp;%{query-string}</to>
+ </rule>
+
+
+ <rule match-type="regex">
<from>^/oauth2/auth\\?(.*)$</from>
<to type="forward">/dispatcher?mod=id_oauth20&amp;action=AUTH&amp;%{query-string}</to>
</rule>
diff --git a/id/server/auth/src/main/webapp/anmeldeablauf.png b/id/server/auth/src/main/webapp/anmeldeablauf.png
new file mode 100644
index 000000000..a6af21c5f
--- /dev/null
+++ b/id/server/auth/src/main/webapp/anmeldeablauf.png
Binary files differ
diff --git a/id/server/doc/moa_id/common/LogoBKA.png b/id/server/auth/src/main/webapp/common/LogoBKA.png
index 6a92647fd..6a92647fd 100644
--- a/id/server/doc/moa_id/common/LogoBKA.png
+++ b/id/server/auth/src/main/webapp/common/LogoBKA.png
Binary files differ
diff --git a/id/server/doc/moa_id/common/LogoEGIZ.png b/id/server/auth/src/main/webapp/common/LogoEGIZ.png
index 39f05d131..39f05d131 100644
--- a/id/server/doc/moa_id/common/LogoEGIZ.png
+++ b/id/server/auth/src/main/webapp/common/LogoEGIZ.png
Binary files differ
diff --git a/id/server/doc/moa_id/common/MOA.css b/id/server/auth/src/main/webapp/common/MOA.css
index 6c0009932..b7a2b9280 100644
--- a/id/server/doc/moa_id/common/MOA.css
+++ b/id/server/auth/src/main/webapp/common/MOA.css
@@ -14,7 +14,6 @@ body
-
p
{
margin-top: 0pt;
diff --git a/id/server/auth/src/main/webapp/css/index.css b/id/server/auth/src/main/webapp/css/index.css
deleted file mode 100644
index 622f6c255..000000000
--- a/id/server/auth/src/main/webapp/css/index.css
+++ /dev/null
@@ -1,451 +0,0 @@
- @charset "utf-8";
-
- @media screen and (min-width: 650px) {
-
- body {
- margin:0;
- padding:0;
- color : #000;
- background-color : #fff;
- font-family : Verdana, Geneva, Arial, sans-serif;
- font-size:76%;
- text-align: center;
- background-color: #6B7B8B;
- }
-
- #page {
- display: block;
- border: 2px solid rgb(0,0,0);
- width: 650px;
- height: 440px;
- margin: 0 auto;
- margin-top: 5%;
- position: relative;
- border-radius: 25px;
- background: rgb(255,255,255);
- }
-
- #page1 {
- text-align: center;
- }
-
- #main {
- /* clear:both; */
- position:relative;
- margin: 0 auto;
- width: 250px;
- text-align: center;
- }
-
- .OA_header {
- /* background-color: white;*/
- font-size: 20pt;
- margin-bottom: 25px;
- margin-top: 25px;
- }
-
- #leftcontent {
- /*float:left; */
- width:250px;
- margin-bottom: 25px;
- text-align: left;
- border: 1px solid rgb(0,0,0);
- }
-
- h2#tabheader.full {
- padding:5px;
- font-size:20px;
- color:#fff;
- border-bottom:2px solid #fff;
- }
-
- #selectArea.full {
- font-size: 15px;
- padding-bottom: 65px;
- }
-
- #leftcontent.full {
- width: 400px;
- margin-top: 30px;
- }
-
- #main.full {
- width: 400px;
- }
-
- .setAssertionButton_full {
- background: #efefef;
- cursor: pointer;
- margin-top: 15px;
- width: 100px;
- height: 30px
- }
-
- #leftbutton.full {
- width: 30%;
- float:left;
- margin-left: 40px;
- }
-
- #rightbutton.full {
- width: 30%;
- float:right;
- margin-right: 45px;
- text-align: right;
- }
-
- }
-
- @media screen and (max-width: 649px) {
-
- body {
- margin:0;
- padding:0;
- color : #000;
- background-color : #fff;
- font-family : Verdana, Geneva, Arial, sans-serif;
- font-size:76%;
- text-align: center;
- background-color: #FFFFFF;
- }
-
- #page {
- visibility: hidden;
- margin-top: 0%;
-
- }
-
- #page1 {
- visibility: hidden;
- }
-
- #main {
- visibility: hidden;
- }
-
- .OA_header {
- margin-bottom: 0px;
- margin-top: 0px;
- font-size: 0pt;
- visibility: hidden;
- }
-
- #leftcontent {
- visibility: visible;
- margin-bottom: 0px;
- text-align: left;
- border:none;
- width:250px;
- }
-
- .setAssertionButton_full {
- background: #efefef;
- cursor: pointer;
- margin-top: 15px;
- width: 70px;
- height: 25px;
- }
- }
-
- * {
- margin:0;
- padding:0;
- border:0;
- }
-
-
- /* skiplink */
-
- #skiplinks {
- position:relative;
- }
-
- p#skiplinks a {
-
- position: absolute;
- top: -999em;
- left: -999em;
- height: 0;
- width: 0;
- overflow: hidden;
- }
-
- p#skiplinks a:focus,
- p#skiplinks a:hover,
- p#skiplinks a:active {
- height: auto;
- width:auto;
- left: 0;
- top: 0;
- padding: 4px;
- position: absolute;
- overflow: visible;
- text-decoration: none;
- z-index: 100;
- }
-
- /*layout */
-
- #wrapper {
- min-width:746px;
- max-width:1258px;
- padding: 0 10px;
- }
-
- #banner {
- width:100%;
- min-height:100px;
- padding-top:20px;
- position:relative;
- }
-
- #bannerleft {
- float:left;
- }
-
- #bannerleft h1 {
- font-size:2em;
- padding-top:10px;
- }
-
- #bannerright {
- float:right;
- }
-
- /* left */
-
- .iframebkuselection {
- text-align: center;
- padding-bottom: 25px;
- background-color : #DDDDDD;
- }
-
- h2#tabheader, h2#contentheader {
- padding-bottom: 2px;
- padding-right: 2px;
- padding-top: 2px;
- padding-left: 5px;
- font-size:1.1em;
- color:#fff;
- border-bottom:2px solid #fff;
- }
-
- #selectArea {
- padding-top: 10px;
- padding-bottom: 55px;
- padding-left: 10px;
- }
-
- .setAssertionButton {
- background: #efefef;
- cursor: pointer;
- margin-top: 15px;
- width: 70px;
- height: 25px;
- }
-
- #leftbutton {
- width: 35%;
- float:left;
- margin-left: 15px;
- }
-
- #rightbutton {
- width: 35%;
- float:right;
- margin-right: 25px;
- text-align: right;
- }
-
- #stork {
- margin-bottom: 10px;
- margin-top: 5px;
- }
-
- #bkulogin {
- overflow:hidden;
- width:250px;
- padding-top: 10px;
- }
-
- #bkukarte {
- float:left;
- background: url(../img/karte.gif) no-repeat top center;
- padding: 90px 10px 10px 10px;
- text-align:center;
- width:40%;
- }
-
- #bkuhandy {
- float:right;
- background: url(../img/handy.gif) no-repeat top center;
- padding: 90px 10px 10px 10px;
- text-align:center;
- width:40%;
- }
-
- #mandate{
- text-align:center;
- padding : 5px 5px 5px 5px;
- }
-
- button {
- background: #efefef;
- border:1px solid #000;
- cursor: pointer;
- }
-
- input {
- background: #efefef;
- border:1px solid #000;
- cursor: pointer;
- }
-
- #installJava, #BrowserNOK {
- clear:both;
- font-size:0.8em;
- padding:4px;
- }
-
- #localBKU {
- padding:4px;
- }
-
- .selectText{
-
- }
-
- .selectTextHeader{
-
- }
-
- .sendButton {
- background-color: DarkGray;
- border-style: solid;
- border-width: 1px;
- border-color: black;
- }
-
-
- #tab {
- margin-top:2px;
- padding:2px;
- clear:both;
- }
-
- #leftcontent a {
- text-decoration:none;
- color: #000;
- /* display:block;*/
- padding:4px;
- }
-
- #leftcontent a:hover, #leftcontent a:focus, #leftcontent a:active {
- text-decoration:underline;
- color: #000;
- }
-
- #navlist {
- margin-top:20px;
- }
-
- #navlist ul {
- list-style: none;
- margin-left: 0;
- }
-
- #navlist li {
- border-bottom:1px solid #fff;
- }
-
- iframe {
- width:250px;
- height: 180px
- }
-
- /* right */
-
- #rightcontent {
- float:right;
- width:220px;
- }
-
- #centercontent {
- width:auto;
- margin: 0 230px;
- }
-
- /* center */
-
- #content {
- padding:20px;
- }
-
- #content a {
- text-decoration:underline;
- color: #000;
- }
-
- #content a:hover, #content a:focus, #content a:active {
- text-decoration:underline;
- color: #000;
- }
-
- p {
- margin-bottom:1em;
- }
-
- .lightblock{
- text-align : left;
- padding : 5px 5px 5px 5px;
- }
-
-
- #mandateLogin {
- vertical-align: middle;
- }
-
-
- .infobutton {
- background-color: #005a00;
- color: white;
- font-family: serif;
- text-decoration: none;
- padding-top: 2px;
- padding-right: 4px;
- padding-bottom: 2px;
- padding-left: 4px;
- font-weight: bold;
- }
-
-
- /* [OPTIONAL] Geben Sie hier die Farbe fuer den hellen Hintergrund an */
- .hell {
- background-color : #DDDDDD;
- }
-
- /* [OPTIONAL] Geben Sie hier die Farbe fuer den dunklen Hintergrund an */
- .dunkel {
- background-color: #A02D2D;
- }
-
- /* [OPTIONAL] Geben Sie hier die Farbe fuer Links an */
- #leftcontent a, #content a {
- color: white;
- }
-
- .main_header {
- color: black;
- font-size: 32pt;
- position: absolute;
- right: 10%;
- top: 40px;
-
- }
-
- @media print {
- #wrapper { width:100%;}
- #banner {width:640px;}
- #rightcontent {display: none;}
- #centercontent {width:400px; margin-right:0;}
- }
diff --git a/id/server/auth/src/main/webapp/iframeHandyBKU.html b/id/server/auth/src/main/webapp/iframeHandyBKU.html
deleted file mode 100644
index b5936679f..000000000
--- a/id/server/auth/src/main/webapp/iframeHandyBKU.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="de">
- <head>
- <title>iFrame Handy BKU</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
- <meta http-equiv="PRAGMA" content="NO-CACHE">
- <script type="text/javascript">
- // [MUSS] Geben Sie hier die URL zum Aufruf von MOA-ID an
- // z.B.: https://yoururl.at/moa-id-auth/StartAuthentication?Target=IT&OA=https://youronlineapplication.at
- var MOA_ID_STARTAUTHENTICATION = "https://localhost:8443/moa-id-auth/StartAuthentication?Target=ZU&OA=https://localhost:8443/TestMOAID_OA/LoginServletExample";
-
- // [MUSS] Geben Sie hier die URL zum MOA-ID Template fuer die Handy Signatur an -->
- <!-- z.B.: value="https://yoururl.at/moa-id-auth/template_handyBKU.html"-->
- var URL_TO_HANDYSIGNATUR_TEMPLATE = "https://localhost:8443/moa-id-auth/template_handyBKU.html";
-
-
- window.onload=function() {
-
- document.getElementById('moaidform').action = MOA_ID_STARTAUTHENTICATION;
- document.getElementById('Template').value = URL_TO_HANDYSIGNATUR_TEMPLATE;
-
- var useMandate = gup("useMandate");
-
- if (useMandate == "true")
- document.getElementById('useMandate').value = "true";
- else
- document.getElementById('useMandate').value = "false";
-
-
- document.moaidform.submit();
- return;
- }
-
- function gup(name) {
- name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
- var regexS = "[\\?&]"+name+"=([^&#]*)";
- var regex = new RegExp( regexS );
- var results = regex.exec( window.location.href );
- if( results == null )
- return "";
- else
- return results[1];
- }
-
- </script>
- </head>
- <body>
- Bitte warten...
- <form name="moaidform" method="post" id="moaidform">
- <input type="hidden" name="Template" id="Template">
- <!-- <input type="hidden" name="bkuURI" value="https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx"> -->
- <input type="hidden" name="bkuURI" value="https://test1.a-trust.at/https-security-layer-request/default.aspx">
- <input type="hidden" name="useMandate" id="useMandate">
- </form>
- <hr>
- </body>
-</html> \ No newline at end of file
diff --git a/id/server/auth/src/main/webapp/iframeOnlineBKU.html b/id/server/auth/src/main/webapp/iframeOnlineBKU.html
deleted file mode 100644
index 0b6e7d71f..000000000
--- a/id/server/auth/src/main/webapp/iframeOnlineBKU.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="de">
- <head>
- <title>iFrame Online BKU</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
- <meta http-equiv="PRAGMA" content="NO-CACHE">
- <script type="text/javascript">
- // [MUSS] Geben Sie hier die URL zum Aufruf von MOA-ID an
- // z.B.: https://yoururl.at/moa-id-auth/StartAuthentication?Target=IT&OA=https://youronlineapplication.at
- //var MOA_ID_STARTAUTHENTICATION = "https://localhost:8443/moa-id-auth/StartAuthentication?Target=ZU&OA=https://localhost:8443/TestMOAID_OA/LoginServletExample?locale=de&test=123";
- // OA URL encoded (um parameter in OA URL zu uebergeben)
- var MOA_ID_STARTAUTHENTICATION = "https://localhost:8443/moa-id-auth/StartAuthentication?Target=ZU&OA=https%3A%2F%2Flocalhost%3A8443%2FTestMOAID_OA%2FLoginServletExample%3Flocale%3Dde%26test%3D123";
-
-
- // [MUSS] Geben Sie hier die URL zum MOA-ID Template fuer die Online BKU an
- // z.B.: "https://yoururl.at/moa-id-auth/template_onlineBKU.html"
- var URL_TO_ONLINEBKU_TEMPLATE = "https://localhost:8443/moa-id-auth/template_onlineBKU.html";
-
- // [MUSS] Geben Sie hier die URL zur Online BKU an
- // z.B.: value="https://yoururl.at/bkuonline/https-security-layer-request"
- // Hinweis: Diese URL muss auch bei den vertrauenswürdigen BKUs in der MOA-ID Konfiguration angegeben werden (siehe Element MOA-IDConfiguration/TrustedBKUs/BKUURL)
- var URL_TO_ONLINEBKU = "https://localhost:8444/bkuonline/https-security-layer-request";
-
- window.onload=function() {
- document.getElementById('moaidform').action = MOA_ID_STARTAUTHENTICATION;
- document.getElementById('Template').value = URL_TO_ONLINEBKU_TEMPLATE;
- document.getElementById('bkuURI').value = URL_TO_ONLINEBKU;
-
- var useMandate = gup("useMandate");
-
- if (useMandate == "true")
- document.getElementById('useMandate').value = "true";
- else
- document.getElementById('useMandate').value = "false";
-
- var ccc = gup("ccc");
- if (ccc != null)
- document.getElementById('ccc').value = ccc;
-
- document.moaidform.submit();
- return;
- }
-
- function gup(name) {
- name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
- var regexS = "[\\?&]"+name+"=([^&#]*)";
- var regex = new RegExp( regexS );
- var results = regex.exec( window.location.href );
- if( results == null )
- return "";
- else
- return results[1];
- }
- </script>
- </head>
- <body>
- Bitte warten...
- <form method="POST" name="moaidform" id="moaidform">
- <input type="hidden" name="Template" id="Template">
- <input type="hidden" name="bkuURI" id="bkuURI">
- <input type="hidden" name="useMandate" id="useMandate">
- <input type="hidden" name="CCC" id="ccc">
- </form>
- <hr>
- </body>
-</html> \ No newline at end of file
diff --git a/id/server/auth/src/main/webapp/index.html b/id/server/auth/src/main/webapp/index.html
index eee3cd69a..05605388c 100644
--- a/id/server/auth/src/main/webapp/index.html
+++ b/id/server/auth/src/main/webapp/index.html
@@ -1,14 +1,102 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="de">
- <head>
- <!-- [OPTIONAL] Aendern Sie hier den Titel der Seite -->
- <title>
- MOA-ID 2.0 Mainpage
- </title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="Content-Style-Type" content="text/css">
-
- </head>
- <body>
- </body>
-</html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
+ <title>MOA-ID 2.0 RC1</title>
+ <link rel="stylesheet" href="./common/MOA.css" type="text/css">
+</head>
+<body link="#990000">
+ <table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
+ <tr>
+ <td align="center" class="logoTitle" width="267"><img src="./common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
+ <td align="center" class="logoTitle">&nbsp;</td>
+ <td align="center" class="logoTitle" width="123"><img src="./common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
+ </tr>
+ </table>
+ <hr/>
+ <p class="title"><a href="../index.html">MOA-ID 2.0 RC1 </a></p>
+ <hr/>
+ <h1>Inhalt</h1>
+ <ol>
+ <li><a href="#allgemeines">Allgemeines</a>
+ <ol>
+ <li><a href="#allgemeines_service">Externe Services</a></li>
+ </ol>
+ </li>
+ <li><a href="#ss">MOA-ID-Auth </a>
+ <ol>
+ <li><a href="#ablauf">Ablauf einer Anmeldung</a></li>
+ </ol>
+ </li>
+ <li><a href="#sp">MOA-ID-Configuration</a></li>
+ </ol>
+<hr/>
+ <h1><a name="allgemeines"></a>1 Allgemeines</h1>
+ <p> Das Module MOA-ID-Auth kann von Anwendungen zur Identifizierung und Authentifizierung im Rahmen eines Anmeldeprozesses an einer Online-Applikation verwendet werden. Die Konfiguration des Modules MOA-ID-Auth erfolgt mit Hilfe des Zusatzmodules MOA-ID-Configuration welches eine web-basierte Konfigurationsschnittstelle zur Verf&uuml;gung stellt.</p>
+ <p>Das nachfolgende Blockdiagramm zeigt Struktur von MOA-ID und gibt eine kurze Beschreibung der einzelnen Komponenten.</p>
+ <p><img src="Blockdiagramm.png" alt="Architektur MOA-ID" width="1000" height="678"></p>
+ <p>&nbsp;</p>
+<p>MOA-ID besteht aus folgenden Kernkomponenten:</p>
+ <ol>
+ <li><u>CORE LOGIC</u>: Diese Komponente ist die zentrale Logik zur Steuerung der einzelnen Prozesse innerhalb MOA-ID 2.x.</li>
+ <li><u>Protocol Adapter</u>: Stellt die in MOA-ID 2.x unterst&uuml;tzten Authentifizierungsprotokolle f&uuml;r die Anbindung von Service Providern zur Verf&uuml;gung.</li>
+ <li><u>Auth Sources</u>: Stellt die von MOA-ID 2.x unterst&uuml;tzte Identifikationsmechanismen zur Verf&uuml;gung. Dies sind die &ouml;sterreichische B&uuml;rgerkarte oder Handy-Signatur sowie die Anmeldung ausl&auml;ndischer Personen mit Hilfe des STORK Protokoll.</li>
+ <li><u>Template Generator</u>: Der Template Generator erzeugt f&uuml;r Service Provider die entsprechenden Login-Masken f&uuml;r die Integration in die eigene Web-Applikation.</li>
+ <li><u>SSO Module</u>: Das Single Sign-On (SSO) Modul verwaltet die zus&auml;tzlichen Operationen die sich aus der Umsetzung von SSO ergeben. Dies umfasst im Besonderen das SSO Session-Management.</li>
+ <li><u>Statistic Module</u>: Dieses Modul dient zur Generierung von anonymisierten Statistikdaten aus den Anmeldeinformationen. </li>
+ <li><u>Monitoring &amp; Testing Module</u>: Dieses Modul implementiert Methoden mit deren Hilfe einzelne funktionale Bereiche aus MOA-ID-Auth getestet werden k&ouml;nnen. Somit dient dieses Modul als Schnittstellte zu einem externen Monitoring-Service.</li>
+ <li><u>Configuration</u><u> Modul</u>: Dieses Modul stellt die Schnittstelle zur MOA-ID-Auth Konfiguration dar welche in einer Datenbank abgelegt wird. </li>
+ <li><u>Konfigurationstool</u>: Oberfl&auml;che, mit deren Hilfe MOA-ID konfiguriert werden kann. Dies umfasst sowohl allgemeine Konfigurationsteile als auch die Konfiguration der einzelnen bei MOA-ID-Auth registrierten Online-Applikationen. Service Provider k&ouml;nnen sich am Konfigurationstool mittels B&uuml;rgerkarte oder Handy-Signatur anmelden und ihre Online-Applikationen verwalten.</li>
+ </ol>
+ <h2><a name="allgemeines_service" id="allgemeines_service"></a>1.1 Externe Services</h2>
+<p>F&uuml;r die Anmeldung in Vertretung und die Anmeldung ausl&auml;ndischer Personen werden zus&auml;tzliche externe Services verwendet.</p>
+ <h3><a name="allgemeines_service_ovs" id="allgemeines_service2"></a>1.1.1 Online-Vollmachten</h3>
+<p>Ab der MOA-ID Release 1.5.0 werden Online-Vollmachten (f&uuml;r Anwendungen aus dem &ouml;ffentlichen Bereich) unterst&uuml;tzt. Hierzu werden diese Vollmachten &uuml;ber eine Online-Vollmachten-Service ausgew&auml;hlt. Der Zugang zu diesem Online-Vollmachten Service ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
+ <h3><a name="allgemeines_service_szrgw" id="allgemeines_service3"></a>1.1.2 Ausl&auml;ndische B&uuml;rger</h3>
+ <p> Ab der MOA-ID Release 1.4.7 ist es m&ouml;glich, dass sich auch ausl&auml;ndische B&uuml;rger mittels MOA-ID einloggen k&ouml;nnen. Hierzu wird eine Verbindung zu einem sogenannten Stammzahlenregister-Gateway aufgebaut, dass basierend auf den Zertifikatsdaten des ausl&auml;ndischen B&uuml;rgers eine Eintragung im Erg&auml;nzungsregister f&uuml;r nat&uuml;rliche Personen gem&auml;&szlig; E-Government Gesetz &sect;6(5) vornimmt. Somit ist es m&ouml;glich, dass eine Personenbindung ausgestellt werden kann, die in weitere Folge an MOA-ID weitergeleitet wird. Der Zugang zu diesem Stammzahlenregister-Gateway ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
+<h1><a name="moaidauth" id="moaidauth"></a>2 MOA-ID-Auth</h1>
+<p>Das Modul MOA-ID-Auth dient der Identifizierung und Authentifizierung im Rahmen eines Anmeldevorgangs an einer Online-Applikation. Die Identifizierung und Authentifizierung erfolgt mit B&uuml;rgerkartem, Handy-Signatur oder f&uuml;r aus&auml;ndische Personen mittels STORK.</p>
+<p>Die Funktionalit&auml;t und der Aufbau der Schnittstellen des Modules MOA-ID-Auth in Richtung Online-Applikation wird im Kapitel Protokolle beschriebe.
+<p>F&uuml;r den Betrieb von MOA-ID-Auth ist der Einsatz von MOA-Signaturpr&uuml;fung (MOA-SP) erforderlich.</p>
+<h2><a name="ablauf" id="ablauf"></a> 2.1 Ablauf einer Anmeldung</h2>
+<p>Die nachfolgende Grafik beschreibt den Ablauf eines Abmeldevorgangs an einer Online-Applikation mit Hilfe von MOA-ID-Auth unter Verwendung der B&uuml;rgerkarte oder der Handy-Signatur.</p>
+<p><img src="anmeldeablauf.png" width="947" height="881" alt="Sequenzdiagramm eines Anmeldevorgangs mit MOA-ID-Auth"></p>
+<p>&nbsp;</p>
+<ol>
+ <li>Der Benutzer verbindet sich zu einem Web-Portal (Service Provider) &uuml;ber das die Online-Applikation erreichtbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang ausgel&ouml;st.</li>
+ <li>Der Benutzer wird zur Identifizierung und Authentifizierung an MOA-ID-Auth weitergeleitet. </li>
+ <li>MOA-ID-Auth validiert die Authentifizierungsanfrage des Service Providers</li>
+ <li>MOA-ID-Auth bietet dem Benutzer eine Auswahl von verf&uuml;gbaren Authentifizierungsmethoden (B&uuml;rgerkarte, Handy-Signatur, STORK) an.</li>
+ <li>Der Benutzer w&auml;hlt die gew&uuml;nschte Authentifizierungsmethode und sendet diese an MOA-ID-Auth.</li>
+ <li>MOA-ID-AUTH erzeugt eine HTML-Seite mit einem &lt;InfoboxReadRequest&gt; zum Auslesen der Personenbindung. Diese HTML-Seite wird an den Browser geschickt.</li>
+ <li>Der Browser schickt den &lt;InfoboxReadRequest&gt; an die ausgew&auml;hlte Bürgerkartenumgebung unter Verwendung des Security-Layer. Die Bürgerkartenumgebung liest die Personenbindung von der B&uuml;rgerkarte und sendet diese an MOA-ID-AUTH. MOA-ID-Auth prüft die Signatur der Personenbindung durch einen Aufruf von MOA-SP.</li>
+ <li>MOA-ID-AUTH erstellt den AUTH-Block. Der AUTH-Block enth&auml;lt Vor- und Nachname aus der Personenbindung, URL von MOA-ID-AUTH, URL und Gesch&auml;ftsbereich der Online-Applikation oder im Falle einer SSO Anmeldung die URL und den Gesch&auml;ftsbereich der MOA-ID-Auth Instanz, die aktuelle Zeit, das aktuelle Datum und einen Zufallswert f&uuml;r diesen Anmeldevorgang. Anschlie&szlig;end wird eine XML Antwortseite, die das Kommando zum Signieren (&lt;CreateXMLSignatureRequest&gt;) des generierten AUTH-Blocks enth&auml;lt, an die ausgew&auml;hlte Bürgerkartenumgebung, unter Verwendung des Security-Layers, gesendet.</li>
+ <li>Der Request wird von der Bürgerkartenumgebung verarbeitet. Die signierten Daten werden an MOA-ID-AUTH zur&uuml;ckgesendet.</li>
+ <li>MOA-ID-Auth &uuml;berpr&uuml;ft den signierten AUTH-Block und generiert Information f&uuml;r weitere Anmeldungen mittels Single Sign-On.</li>
+ <li>MOA-ID-Auth generiert die Anmeldedaten (Assertion) welche folgende Information enthalten:
+ <ul>
+ <li>die bereichsspezifischen Personenkennzeichen (bPK / wbPK)</li>
+ <li>Vorname, Nachname und Geburtsdatum (optional)</li>
+ <li>den signierten AUTH-Block (optional)</li>
+ <li>die Personenbindung (optional)</li>
+ <li>das Zertifikat mit dem die Signatur erzeugt wurde (optional)</li>
+ <li>informationen zum Vertreten im Falle einer Anmeldung in Vertretung (optional)</li>
+ <li>die elektronische Vollmacht im Falle einer Anmeldung in Vertretung (optional)</li>
+ <li>informationen aus dem STORK Protokoll im Falle einer Anmeldung mittels STORK (optional)</li>
+ </ul>
+ </li>
+ <li> MOA-ID-Auth sendet die Anmeldedaten an den Service-Provider und setzt im Browser des Benutzers ein SSO Session-Tokken welches f&uuml;r weitere Anmeldevorg&auml;nge verwendet werden kann.</li>
+ <li>Die Anmeldedaten werden vom Service-Provider verarbeitet und der Benutzer wird vom Service-Provider an die Online-Applikation weitergeleitet. </li>
+</ol>
+<h1><a name="config" id="config"></a>3 MOA-ID-Configuration </h1>
+<p>Das Modul MOA-ID-Configuration stellt eine web-basierte Benutzerschnittstelle zur Konfiguration des Moduls MOA-ID-Auth zur Verf&uuml;gung, wobei sich die Konfiguration in zwei Teilbereiche unterteilt ist. Eine detailierte Aufstellung der einzelnen Konfigurationspunkte befindet sich im Kapitel <a href="../config/config.html">Konfiguration</a>.</p>
+<ol>
+ <li>Allgemeine Konfiguration<br>
+ In diesem Bereich sind alle Basiseinstellungen der MOA-ID-Auth Instanz hinterlegt. Beispiele hierf&uuml;r sind Single Sign-On, unterst&uuml;tze Authentifizierungsprotokolle, Informationen zu MOA-ID-Auth, URLs zu externen Services, ... Eine &Auml;nderung der Basiseinstellung erfordert besondere Benutzerrechte am Konfigurationstool.</li>
+ <li>Online-Applikationen<br>
+ In diesem Abschnitt erfolgt die Konfiguration der einzelnen bei MOA-ID-Auth registrierten Service-Provider. Hierbei handelt es sich um authentifizierungsprotkollspezifische Einstellungen, Bereich des Service-Providers (&ouml;ffentlich / Privatwirtschaftlich), Konfiguration der BKU Auswahl, .... Wobei sich die Konfigurationsm&ouml;glichkeiten je nachdem welche Benutzerrechten vergeben sind, unterscheiden k&ouml;nnen.</li>
+</ol>
+<p>Zus&auml;tzlich unterst&uuml;tzt das Module MOA-ID-Configuration auch eine einfache Bentzerverwaltung mit Rechtevergabe mit deren Hilfe die Verwaltung von Online-Applikatioen an den jeweiligen Service-Provider ausgelagert werden kann. Die Anmeldung am Konfigurationstool erfolgt mittels B&uuml;rgerkarte, Handy-Signature oder STORK, wobei optional auch eine Anmeldung mittels Benutzername und Passwort zur Verf&uuml;gung steht.</p>
+<p>&nbsp;</p>
+</body>
+</html>
diff --git a/id/server/auth/src/main/webapp/message-auth.jsp b/id/server/auth/src/main/webapp/message-auth.jsp
deleted file mode 100644
index 0c28c1ba7..000000000
--- a/id/server/auth/src/main/webapp/message-auth.jsp
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<%@ page contentType="text/html; charset=UTF-8" %>
-<html>
-<head>
-<title>MOA-ID AUTH</title>
-</head>
-<% String message = (String)request.getAttribute("Message");
-%>
-
-<body>
-<h1>MOA-ID AUTH</h1>
-
-<% if (message != null) { %>
-<p>
-<%= message%><br>
-</p>
-<% } %>
-
-</body>
-</html> \ No newline at end of file
diff --git a/id/server/data/deploy/conf/moa-id-configuration/htmlTemplates/loginFormFull.html b/id/server/data/deploy/conf/moa-id-configuration/htmlTemplates/loginFormFull.html
index 9d6ad4085..b9d3eafa7 100644
--- a/id/server/data/deploy/conf/moa-id-configuration/htmlTemplates/loginFormFull.html
+++ b/id/server/data/deploy/conf/moa-id-configuration/htmlTemplates/loginFormFull.html
@@ -628,6 +628,10 @@
document.getElementById("localBKU").style.display="block";
return;
}
+ function bkuLocalClicked() {
+ setMandateSelection();
+ }
+
function bkuOnlineClicked() {
if (isMetro())
document.getElementById("metroDetected").style.display="block";
@@ -796,9 +800,11 @@
type="hidden" name="CCC" id="ccc"> <input type="hidden"
name="MODUL" value="#MODUL#"> <input type="hidden"
name="ACTION" value="#ACTION#"> <input type="hidden"
- name="MOASessionID" value="#SESSIONID#"> <input
- type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
- role="button" class="hell">
+ name="MOASessionID" value="#SESSIONID#">
+ <input type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
+ role="button" class="hell"
+ onclick="setMandateSelection();"
+ >
<!--p>
<small>Alternativ können Sie eine lokal installierte BKU verwenden.</small>
</p-->
diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html b/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html
index 9d6ad4085..b9d3eafa7 100644
--- a/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html
+++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html
@@ -628,6 +628,10 @@
document.getElementById("localBKU").style.display="block";
return;
}
+ function bkuLocalClicked() {
+ setMandateSelection();
+ }
+
function bkuOnlineClicked() {
if (isMetro())
document.getElementById("metroDetected").style.display="block";
@@ -796,9 +800,11 @@
type="hidden" name="CCC" id="ccc"> <input type="hidden"
name="MODUL" value="#MODUL#"> <input type="hidden"
name="ACTION" value="#ACTION#"> <input type="hidden"
- name="MOASessionID" value="#SESSIONID#"> <input
- type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
- role="button" class="hell">
+ name="MOASessionID" value="#SESSIONID#">
+ <input type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
+ role="button" class="hell"
+ onclick="setMandateSelection();"
+ >
<!--p>
<small>Alternativ können Sie eine lokal installierte BKU verwenden.</small>
</p-->
diff --git a/id/server/data/deploy/conf/moa-id/stork/SamlEngine.xml b/id/server/data/deploy/conf/moa-id/stork/SamlEngine.xml
index 563196604..166a48ff8 100644
--- a/id/server/data/deploy/conf/moa-id/stork/SamlEngine.xml
+++ b/id/server/data/deploy/conf/moa-id/stork/SamlEngine.xml
@@ -17,5 +17,54 @@
<parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
</configuration>
</instance>
+
+ <instance name="incoming">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_incoming.xml" />
+ </configuration>
+
+ <!-- Settings module signature-->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_incoming.xml" />
+ </configuration>
+ </instance>
+
+
+ <instance name="incoming_attr">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_incoming_attr.xml" />
+ </configuration>
+
+ <!-- Settings module signature-->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_incoming_attr.xml" />
+ </configuration>
+ </instance>
+
+
+ <instance name="VIDP">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_VIDP.xml" />
+ </configuration>
+
+ <!-- Settings module signature-->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_incoming.xml" />
+ </configuration>
+ </instance>
+
+
-</instances> \ No newline at end of file
+</instances>
diff --git a/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming.xml b/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming.xml
new file mode 100644
index 000000000..68b15e667
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">/home/stork/repos/moa-idspss/id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties>
diff --git a/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming_attr.xml b/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming_attr.xml
new file mode 100644
index 000000000..68b15e667
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/SignModule_incoming_attr.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">/home/stork/repos/moa-idspss/id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties>
diff --git a/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_VIDP.xml b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_VIDP.xml
new file mode 100644
index 000000000..fb786529a
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_VIDP.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+ <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
+ <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
+
+</properties>
diff --git a/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming.xml b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming.xml
new file mode 100644
index 000000000..fb786529a
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+ <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
+ <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
+
+</properties>
diff --git a/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming_attr.xml b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming_attr.xml
new file mode 100644
index 000000000..fb786529a
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/StorkSamlEngine_incoming_attr.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+ <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
+ <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
+
+</properties>
diff --git a/id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jks b/id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jks
new file mode 100644
index 000000000..f9baad202
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-id/stork/storkDemoKeysPT.jks
Binary files differ
diff --git a/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks b/id/server/data/deploy/conf/moa-id/stork/storkDemoKeys_minividp_old.jks
index efaeac86c..efaeac86c 100644
--- a/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks
+++ b/id/server/data/deploy/conf/moa-id/stork/storkDemoKeys_minividp_old.jks
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer
new file mode 100644
index 000000000..33e776369
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/a-sign-SSL-03.cer b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/a-sign-SSL-03.cer
new file mode 100644
index 000000000..a699436ca
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/a-sign-SSL-03.cer
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/atrust_OCSP_Responder_03-1.crt b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/atrust_OCSP_Responder_03-1.crt
new file mode 100644
index 000000000..ebfbce9a0
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/certstore/toBeAdded/atrust_OCSP_Responder_03-1.crt
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer b/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
Binary files differ
diff --git a/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer b/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/id/server/data/deploy/conf/moa-spss/trustProfiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
Binary files differ
diff --git a/id/server/doc/MOA-ID PreRelease-1.9.98.pdf b/id/server/doc/MOA-ID PreRelease-1.9.98.pdf
deleted file mode 100644
index 4ee41f513..000000000
--- a/id/server/doc/MOA-ID PreRelease-1.9.98.pdf
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/handbook/additional/additional.html b/id/server/doc/handbook/additional/additional.html
new file mode 100644
index 000000000..25da0e095
--- /dev/null
+++ b/id/server/doc/handbook/additional/additional.html
@@ -0,0 +1,199 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
+ <title>MOA-ID - Zusatzinformationen</title>
+ <link rel="stylesheet" href="../common/MOA.css" type="text/css">
+</head>
+<body link="#990000">
+ <table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
+ <tr>
+ <td align="center" class="logoTitle" width="267"><img src="../common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
+ <td align="center" class="logoTitle">Dokumentation</td>
+ <td align="center" class="logoTitle" width="123"><img src="../common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
+ </tr>
+ </table>
+ <hr/>
+ <p class="title"><a href="../index.html">MOA-ID (Identifikation) </a></p>
+<p class="subtitle">Zusatzinformationen</p>
+<hr/>
+ <h1>Inhalt</h1>
+ <ol>
+ <li><a href="#allgemeines">Datenmanagement</a>
+ <ol>
+ <li><a href="#sessiondata">Sessiondaten</a>
+ <ol>
+ <li><a href="#sessiondata_general">Allgemein</a></li>
+ <li><a href="#sessiondata_sso">Single Sign-On</a></li>
+ </ol>
+ </li>
+ <li><a href="#statisticdata">Logging von Statistikdaten</a></li>
+ </ol>
+ </li>
+ </ol>
+<hr/>
+ <h1><a name="allgemeines"></a>1 Datenmanagement</h1>
+ <p>Dieser Abschnitt spezifiziert jene Datens&auml;tze die w&auml;hrend eines Anmeldevorgangs durch das Modul MOA-ID-Auth tempor&auml;r oder permanent gespeichert werden. Hierbei handelt es sich sowohl um tempor&auml;re Sessiondaten als auch um dauerhaft gespeicherte Statistikdaten.</p>
+ <h2><a name="sessiondata" id="sessiondata"></a>1.1 Sessiondaten</h2>
+ <p>Dieser Abschnitt behandelt jene Informationen die das Modul MOA-ID-Auth w&auml;hrend eines Authentifizierungsvorgangs oder w&auml;hrend einer aktiven Single Sign-On Session im Speicher h&auml;lt. Diese Datens&auml;tze werden nach Beendigung des Anmeldevorgangs, bei einfacher Anmeldung, oder nach Beendigung der Single Sign-On Session gel&ouml;scht. Die nachfolgenden Unterkapitel geben eine Aufstellung jener Daten die von MOA-ID im jeweiligen Falle gespeichert werden.</p>
+ <h3><a name="sessiondata_general" id="sessiondata2"></a>1.1.1 Allgemein</h3>
+ <p>Folgende Daten m&uuml;ssen mindestens von MOA-ID gecached werden um einen korrekten Anmeldevorgang zu erm&ouml;glichen.</p>
+ <table border="1" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="160" valign="top"><p><strong>Element</strong></p></td>
+ <td width="764" valign="top"><p><strong>Beschreibung</strong></p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>Authentication Request</p></td>
+ <td width="764" valign="top"><p>Dieser wird von der Online-Applikation als Start des Anmeldevorgangs &uuml;bertragen.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>Session ID</p></td>
+ <td width="764" valign="top"><p>Wird von MOA-ID generiert und dient zur Identifikation von Datens&auml;tzen.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>Personenbindung</p></td>
+ <td width="764" valign="top"><p>Die Personenbindung der BenutzerIn oder des Benutzers.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>AuthBlock</p></td>
+ <td width="764" valign="top"><p>Der Authentifizierungsblock, welcher im Rahmen des Anmeldevorgangs vom der BenutzerIn oder dem Benutzer signiert wird.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>Signaturzertifikat</p></td>
+ <td width="764" valign="top"><p>Das Signaturzertifikat, welches zur Signierung des Authentifizierungsblocks verwendet wurde.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>Vollmacht</p></td>
+ <td width="764" valign="top"><p>Die Online-Vollmacht, welche bei einer Anmeldung in Vertretung ausgew&auml;hlt wurde.</p></td>
+ </tr>
+ <tr>
+ <td width="160" valign="top"><p>STORK</p></td>
+ <td width="764" valign="top"><p>Alle Attribute, welche bei einer Anmeldung mittels STORK &uuml;bertragen werden.</p></td>
+ </tr>
+ <tr>
+ <td valign="top">AuthTimeStamp</td>
+ <td valign="top">Zeitpunkt an dem sich die BenutzerIn oder der Benutzer an MOA-ID-Auth authentifiziert hat.</td>
+ </tr>
+ </table>
+<h3><a name="sessiondata_sso" id="sessiondata3"></a>1.1.2 Single Sign-On</h3>
+<p>Im Falle einer Anmeldung mit Single Sign-In werden zus&auml;tzlich zu den oben genannten Elementen noch weitere Datens&auml;tze gecached.</p>
+<table border="1" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="159" valign="top"><p><strong>Element</strong></p></td>
+ <td width="760" valign="top"><p><strong>Beschreibung</strong></p></td>
+ </tr>
+ <tr>
+ <td width="159" valign="top"><p>SSO Session Token</p></td>
+ <td width="760" valign="top"><p>Das SSO Session Token dient zur Identifizierung einer aktuell bestehenden Single Sign-On Session.</p></td>
+ </tr>
+ <tr>
+ <td valign="top">UpdateTimeStamp</td>
+ <td valign="top">Zeitpunkt des letzten Zugriffs der BenutzerIn oder des Benutzers mittels SSO.</td>
+ </tr>
+ <tr>
+ <td width="159" valign="top"><p>Liste: ung&uuml;ltige SSO Token</p></td>
+ <td width="760" valign="top"><p>Eine Liste aller in dieser Single Sign-On Session bereits vergebenen und verwendeten SSO Session Token. </p></td>
+ </tr>
+ <tr>
+ <td width="159" valign="top"><p>Liste:&nbsp; Online-Applikationen</p></td>
+ <td width="760" valign="top"><p>Eine Liste aller Onlineapplikationen an denen im Rahmen dieser SSO Session eine Anmeldung stattgefunden hat.</p></td>
+ </tr>
+</table>
+<h2><a name="statisticdata" id="statisticdata"></a>1.2 Logging von Statistikdaten</h2>
+<p align="left">Zus&auml;tzlich zu den Daten aus den tempor&auml;ren Sessiondaten werden vom Modul MOA-ID-Auth auch Logging- und Statistikdaten generiert, welche nicht automatisiert gel&ouml;scht werden. Diese Daten dienen der Statuskontrolle und zur Protokollierung von Anmeldevorg&auml;ngen an MOA-ID-Auth. Von MOA-ID-Auth werden folgende <a href="./../config/config.html#basisconfig_moa_id_auth_param_database_info">Statistikdaten</a> je Anmeldevorgang gespeichert, wobei je nach Art der Anmeldung nicht alle Datenelemente gef&uuml;llt werden. Die nachstehende Tabelle beschreibt den maximalen Umfang der Loggingdaten, wobei keine Informationen zur anmeldenden Person gespeichert werden.</p>
+<table border="1" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="163" valign="top"><p><strong>Element</strong></p></td>
+ <td width="757" valign="top"><p><strong>Beschreibung</strong></p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>timestamp</p></td>
+ <td width="757" valign="top"><p>Datum und Uhrzeit des Eintrags.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>OAID</p></td>
+ <td width="757" valign="top"><p>Eindeutige Datenbank ID der Online-Applikation.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>OAURLPrefix</p></td>
+ <td width="757" valign="top"><p>Publik URL Prefix der Online-Applikation</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>OAFriendlyName</p></td>
+ <td width="757" valign="top"><p>Bezeichnung der Online-Applikation</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>isBusinessService</p></td>
+ <td width="757" valign="top"><p>&bdquo;True&ldquo; wenn die Online-Applikation aus dem privatwirtschaftlichen Bereich stammt.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>OATarget</p></td>
+ <td width="757" valign="top"><p>Bereichskennzeichen der Online-Applikation (Target oder privatwirtschaftlicher Bereich)</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>BKUType</p></td>
+ <td width="757" valign="top"><p>Art der B&uuml;rgerkartenumgebung die f&uuml;r den Anmeldevorgang verwendet wurde. (online, local, handy)</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>BKUURL</p></td>
+ <td width="757" valign="top"><p>URL der verwendeten B&uuml;rgerkartenumgebung</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>isSSOLogin</p></td>
+ <td width="757" valign="top"><p>&bdquo;True&ldquo; wenn die die Anmeldung als Teil einer SSO Anmeldung erfolgt ist.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>isMandateLogin</p></td>
+ <td width="757" valign="top"><p>&bdquo;True&ldquo; wenn die Anmeldung in Vertretung erfolgt ist.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>MandateType</p></td>
+ <td width="757" valign="top"><p>Art der verwendeten Vollmacht (Einzelprofile des Vollmachtenservice oder OID des Organwalters / berufsm&auml;&szlig;igen Parteienvertreters)</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>MandatorType</p></td>
+ <td width="757" valign="top"><p>&bdquo;jur&ldquo; / &bdquo;nat&ldquo; je nach Art der vertretenen juristischen oder nat&uuml;rlichen Person</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>isPV</p></td>
+ <td width="757" valign="top"><p>&bdquo;True&ldquo; wenn die Anmeldung in Vertretung durch einen Organwalter oder berufsm&auml;&szlig;igen Parteienvertreter erfolgt ist.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>PVOID</p></td>
+ <td width="757" valign="top"><p>OID des Organwalter oder berufsm&auml;&szlig;igen Parteienvertreter</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>ProtocolType</p></td>
+ <td width="757" valign="top"><p>Type des f&uuml;r die Anmeldung verwendeten Authentifizierungsprotokolls. (PVP21, OpenID, SAML1)</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>ProtocolSubType</p></td>
+ <td width="757" valign="top"><p>N&auml;here Spezifizierung des Protokolltypes. (Im Falle von PVP 2.1: POST oder Redirect)</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>ExceptionType</p></td>
+ <td width="757" valign="top"><p>Typ des Fehlers der w&auml;hrend des Anmeldevorgangs aufgetreten ist. Aktuell werden folgende Typen unterschieden:</p>
+ <ul>
+ <li><strong>bku</strong>: Fehler w&auml;hrend der Kommunikation mit der B&uuml;rgerkartenumgebung.</li>
+ <li> <strong>moa-sp</strong>: Fehler bei der Kommunikation mit MOA-SP oder der Signaturpr&uuml;fung.</li>
+ <li> <strong>mandate</strong>: Fehler beim Zugriff auf das Online-Vollmachten Service.</li>
+ <li> <strong>moa-id</strong>: Fehler w&auml;hrend des Authentifizierungsvorgangs.</li>
+ <li><strong>unknow</strong>n: f&uuml;r allgemeine Fehler die keinem der oben genannten Typen entsprechen.</li>
+ </ul> </td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>ExceptionCode</p></td>
+ <td width="757" valign="top"><p>Fehlercode des aufgetretenen Fehlers falls vorhanden.</p></td>
+ </tr>
+ <tr>
+ <td width="163" valign="top"><p>ExceptionMessage</p></td>
+ <td width="757" valign="top"><p>Fehlermeldung in textueller Form (max. 255 Zeichen lang)</p></td>
+ </tr>
+</table>
+<p align="left">&nbsp;</p>
+<p>&nbsp;</p>
+ <p>&nbsp;</p>
+<p>&nbsp;</p>
+</body>
+</html>
diff --git a/id/server/doc/handbook/application/application.html b/id/server/doc/handbook/application/application.html
new file mode 100644
index 000000000..83e301089
--- /dev/null
+++ b/id/server/doc/handbook/application/application.html
@@ -0,0 +1,212 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
+ <title>MOA-ID - Anwendungen</title>
+ <link rel="stylesheet" href="../common/MOA.css" type="text/css">
+</head>
+<body link="#990000">
+ <table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
+ <tr>
+ <td align="center" class="logoTitle" width="267"><img src="../common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
+ <td align="center" class="logoTitle">Dokumentation</td>
+ <td align="center" class="logoTitle" width="123"><img src="../common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
+ </tr>
+ </table>
+ <hr/>
+ <p class="title"><a href="../index.html">MOA-ID (Identifikation) </a></p>
+<p class="subtitle">Anwendungen</p>
+ <hr/>
+ <h1>Inhalt</h1>
+ <ol>
+ <li><a href="#allgemeines">Allgemeines</a></li>
+ <li><a href="#bkuselection">Integration in bestehende Online-Applikationen</a>
+<ol>
+ <li><a href="#bkuselection">B&uuml;rgerkartenauswahl</a>
+<ol>
+<li><a href="#Request aus einem iFrame">Request aus einem iFrame</a></li>
+ <li><a href="#Request aus dem Hauptframe">Request aus dem Hauptframe</a></li>
+ </ol>
+ </li>
+ <li><a href="#Single Sign-On Anmeldeabfrage">Single Sign-On Anmeldeabfrage</a></li>
+ </ol>
+ </li>
+ <li><a href="DemoApp">Demo Applikationen</a>
+ <ol>
+ <li><a href="#DemoApp_pvp21">PVP 2.1 Demo</a>
+ <ol>
+ <li><a href="#DemoApp_pvp21_install">Installation</a></li>
+ <li><a href="#DemoApp_pvp21_config">Konfiguration Demo Applikation</a></li>
+ <li><a href="#DemoApp_pvp21_config_moaidauth">Konfiguration von MOA-ID-Auth</a></li>
+ <li><a href="#DemoApp_pvp21_use">Anwendung</a></li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <hr/>
+ <h1><a name="allgemeines"></a>1 Allgemeines</h1>
+ <p>Das erste Kapitel behandelt die Integration der von MOA-ID-Auth generierten B&uuml;rgerkartenauswahl in bestehende Online-Applikationen. Zus&auml;tzlich zur Beschreibung ist MOA-ID auch eine PVP 2.1 Demo Applikation beigelegt. Die Konfiguration und Verwendung dieser Demo Applikation ist Inhalt des letzten Kapitels.</p>
+<h1><a name="bkuselection" id="allgemeines_zugangspunkte2"></a>2 Integration in bestehende Online-Applikationen</h1>
+ <p>Ab MOA-ID 2.0 wird die B&uuml;rgerkartenauswahl und die Single Sign-On Anmeldeabfrage standardm&auml;&szlig;ig vom Modul MOA-ID-Auth bereitgestellt und muss nicht mehr durch den Service Provider implementiert werden.</p>
+ <p>Die im Modul MOA-ID-Auth hinterlegten Standard Templates (<a href="./../config/config.html#import_template_bku">B&uuml;rgerkartenauswahl</a>, <a href="./../config/config.html#import_template_sso">Single Sign-On Anmeldeabfrage</a>) unterst&uuml;tzt Responsive Design und passen sich somit in einem weiten Bereich an die aktuelle Fenstergr&ouml;&szlig;e an, wodurch eine individuelle Integration der von MOA-ID-Auth erzeugten Formulare m&ouml;glich ist. Zus&auml;tzlich bietet das Konfigurationstool die M&ouml;glichkeit der <a href="./../config/config.html#konfigurationsparameter_oa_additional_formular">online-applikationsspezifischen Anpassung der Standard Templates</a>. Mit dieser Funktion k&ouml;nnen einzelne Parameter der Standard Templates an die Online-Applikation individualisiert werden um die Integration weiter zu verfeinern.</p>
+ <p><strong>Hinweis:</strong> Es besteht jedoch auch die M&ouml;glichkeit der Hinterlegung von vollst&auml;ndig benutzerdefinierten online-applikationsspezifischen Templates f&uuml;r die B&uuml;rgerkartenauswahl und die Single Sign-On Anmeldeabfrage (siehe <a href="./../config/config.html#konfigurationsparameter_oa_bku">hier</a>).</p>
+<h2><a name="bkuselection" id="allgemeines_zugangspunkte6"></a>2.1 B&uuml;rgerkartenauswahl</h2>
+<p>Die B&uuml;rgerkartenauswahl wird ab MOA-ID 2.0 standardm&auml;&szlig;ig von MOA-ID-Auth, als Antwort auf einen eingehenden Authentifizierungsrequest, bereitgestellt. Dem zu Folge m&uuml;ssen die aus MOA-ID 1.5.1 bekannten Parameter (target, bkuURL, template, usemandate) nicht mehr im Authentifizierungsrequest an MOA-ID-Auth &uuml;bergeben werden und es kann ein standardkonformer Protokollrequest verwendet werden. Die aus MOA-ID 1.5.1 bekannte Variante der B&uuml;rgerkartenauswahl in der Online-Applikation des Service Providers steht jedoch weiterhin als <a href="./../protocol/protocol.html#allgemeines_legacy">Legacy Variante</a> zur Verf&uuml;gung.</p>
+<p>Die Integration der von MOA-ID-Auth bereitgestellten B&uuml;rgerkartenauswahl in eine bestehende Online-Applikation kann auf zwei Arten erfolgen. Bei beiden Varianten erfolgt der Login Vorgang (senden des Authentifizierungsrequests an MOA-ID-Auth) durch den Klick auf einen Login Button. Die Auswahl der B&uuml;rgerkartenumgebung erfolgt somit erst im zweiten Schritt. Das Sequenzdiagramm eines solchen Anmeldevorgangs finden Sie <a href="./../intro/intro.html#ablauf">hier</a> und die nachfolgende Grafik zeigt ein Beispiel zur Integration eines Login Buttons.</p>
+<p><img src="login_button.PNG" width="853" height="683" alt="Integration Login Button"></p>
+<h3><a name="bkuselection_iframe" id="allgemeines_zugangspunkte5"></a>2.1.1 Request aus einem iFrame</h3>
+<p>Bei dieser Variante wird der Authentifizierungsrequests aus einem iFrame, welcher in die Online-Applikation eingebunden ist, abgesetzt. MOA-ID-Auth antwortet auf diesen Request mit der konfigurierten B&uuml;rgerkartenauswahl welche durch Verwendung des iFrame in die Online-Applikation eingebunden werden kann. Die nachfolgende Grafik zeigt ein Beispiel f&uuml;r die von MOA-ID-Auth bereitgestellte B&uuml;rgerkartenauswahl, welche nach Bet&auml;tigung des Login Buttons im iFrame dargestellt wird. </p>
+<p><img src="iframe.png" width="752" height="764" alt="B&uuml;rgerkartenauswahl im iFrame"></p>
+<p><strong>Hinweis:</strong> Bei dieser Variante wird die Assertion ebenfalls an den iFrame ausgeliefert wodurch der authentifizierte Bereich der Online-Applikation im iFrame dargestellt wird. Dieses Verhalten kann durch eine <a href="./../config/config.html#konfigurationsparameter_oa_additional_formular">online-applikationsspezifischen Anpassung der Standard Templates</a> und dem Parameter <em>Targetparameter</em> unterbunden werden.</p>
+<h3><a name="bkuselection_mainframe" id="allgemeines_zugangspunkte7"></a>2.1.2 Request aus dem Hauptframe</h3>
+<p>Bei dieser Variante wird der Authentifizierungsrequests direkt aus dem aktuell offenen Browserfenster an MOA-ID-Auth gesendet. In diesem Fall wird die B&uuml;rgerkartenauswahl fensterf&uuml;llend im Browser dargestellt und die BenutzerIn oder der Benutzer befindet sich nicht mehr in der Domain der Online-Applikation (Service Providera). Nach erfolgreicher Authentifizierung wird die BenutzerIn oder der Benutzer an die Online-Applikation zur&uuml;ckgeleitet. Die nachfolgende Grafik zeigt die B&uuml;rgerkartenauswahl im seitenf&uuml;llenden Layout.</p>
+<p><img src="mainframe.PNG" width="1330" height="822" alt="B&uuml;rgerkartenauswahl im seitenf&uuml;llenden Layout"></p>
+<h2><a name="ssoquestion" id="allgemeines_zugangspunkte3"></a> 2.2 Single Sign-On Anmeldeabfrage</h2>
+<p>Wird f&uuml;r die Integration in die Online-Applikation die Variante mit dem Login Button und der von MOA-ID-Auth bereitgestellten B&uuml;rgerkartenauswahl verwendet (<a href="#bkuselection_iframe">iFrame</a> oder <a href="#bkuselection_mainframe">Hauptframe</a>), ergeben sich f&uuml;r die Single Sign-On Anmeldeabfrage keine zus&auml;tzlichen Anforderungen. Im Falle einer aktiven Single Sign-On Session, w&uuml;rde MOA-ID-Auth mit der Single Sign-On Anmeldeabfrage anstatt der B&uuml;rgerkartenauswahl antworten. Auch in diesem Fall stehen beide M&ouml;glichkeiten der Integration, identisch zum Kapitel B&uuml;rgerkartenauswahl, zur Verf&uuml;gung. Die nachfolgende Grafik zeigt eine Single Sign-On Abfrage welche je nach verwendeter Variante die B&uuml;rgerkartenauswahl, in den zuvor gezeigten Beispielen, ersetzen w&uuml;rde.</p>
+<p><img src="sso_sendassertion.PNG" width="383" height="240" alt="Single Sign-On Anmeldeabfrage"></p>
+<p><strong>Hinweis:</strong> Wird f&uuml;r die Integration der B&uuml;rgerkartenauswahl jedoch die <a href="./../protocol/protocol.html#allgemeines_legacy">Legacy Variante</a> verwendet (direkte Integration der B&uuml;rgerkartenauswahl in die Online-Applikation) kann es zu Inkompatibilit&auml;ten mit der Single Sign-On Anmeldeabfrage kommen, da diese Abfrage von MOA-ID-Auth generiert werden muss und eine direkte Integration in eine Online-Applikation nicht m&ouml;glich ist. </p>
+<h2><a name="DemoApp" id="allgemeines_zugangspunkte4"></a>3 Demo Applikationen</h2>
+<p>Diese Abschnitt behandelt die Konfiguration und Verwendung der bei MOA-ID beigelegten Demo Applikationen.</p>
+<h2><a name="DemoApp_pvp21" id="allgemeines_zugangspunkte"></a>3.1 PVP 2.1 Demo</h2>
+<p>Die PVP 2.1 Demo stellt das Minimalbeispiel einer Online-Applikation dar, welche zur Authentifizierung das Protokoll PVP 2.1 verwendet. Die nachfolgenden Abschnitte beschreiben die Installation, Konfiguration und Verwendung der PVP 2.1 Demo Applikation.</p>
+<p><strong>Hinweis:</strong> Der Source Code der PVP 2.1 Demo Applikation ist im Order <code>$MOA_ID_AUTH_INST/source/moa-id-oa</code> verf&uuml;gbar. Jedoch ist die Validierung der PVP 2.1 Assertion in dieser Version nicht vollst&auml;ndig implementiert und m&uuml;sste bei Verwendung in einem Produktivsystem noch erweitert werden.</p>
+<h3><a name="DemoApp_pvp21_install" id="allgemeines_zugangspunkte9"></a>3.1.1 Installation</h3>
+<p>F&uuml;r die Installation der Demo Applikation wird ein Apache Tomcat ben&ouml;tigt. Die Konfiguration dieser Tomcat Instanz ist identisch zur <a href="./../install/install.html#webservice_basisinstallation">Konfiguration der Tomcat Instanz</a> der Module MOA-ID-Auth und MOA-ID-Configuration.</p>
+<h5><a name="DemoApp_pvp21_install_demooa" id="allgemeines_zugangspunkte10"></a>3.1.1.1 Einsatz der Demo Applikation in Tomcat</h5>
+<ul>
+ <li>Die Datei <code>$MOA_ID_AUTH_INST/moa-id_oa.war</code> enth&auml;lt das einsatzfertige Webarchiv der Demo Applikation und muss ins Verzeichnis <code>$CATALINA_HOME/webapps</code> kopiert werden. Dort wird sie beim ersten Start von Tomcat automatisch ins Verzeichnis <code>$CATALINA_HOME/webapps/moa-id-oa</code> entpackt. </li>
+ <li>Die Konfigurationsdatei mit der Basiskonfiguration f&uuml;r die Demo Applikation und die zugeh&ouml;rigen Verzeichnisse m&uuml;ssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. <code>$CATALINA_HOME/conf/moa-id-oa</code>). Eine funktionsf&auml;hige Konfiguration, die als Ausgangspunkt f&uuml;r die Basiskonfiguration der Demo Applikation dienen kann, finden Sie <a href="../../../conf/moa-id-oa/oa.properties">hier</a>. <br>
+ </li>
+ <li> Die Dateien <code>xalan.jar</code>, <code>xercesImpl.jar, serializer.jar </code> und <code>xml-apis.jar</code> aus dem Verzeichnis <code>$MOA_ID_AUTH_INST/endorsed</code> m&uuml;ssen in das Tomcat-Verzeichnis <code>$CATALINA_HOME/endorsed</code> (bzw. <code>$CATALINA_HOME/common/endorsed</code> bis Apache Tomcat Version 5.5) kopiert werden. Sind gleichnamige Dateien dort bereits vorhanden, m&uuml;ssen sie &uuml;berschrieben werden. Die ggf. in diesem Verzeichnis vorhandene Datei <code>xmlParserAPIs.jar</code> muss gel&ouml;scht werden. Sollte das Verzeichnis <code>endorsed</code> nicht vorhanden sein, dann muss dieses zuerst erstellt werden.</li>
+ <li>Folgende <span class="term">System Properties</span> k&ouml;nnen gesetzt werden (wird beim Starten von Tomcat der <span class="term">Java Virtual Machine</span> in der Umgebungsvariablen <code>CATALINA_OPTS</code> in der Form <code>-D&lt;name&gt;=&lt;wert&gt;</code> &uuml;bergeben):
+ <ul>
+ <li><code>moa.id.demoOA</code>: Pfad und Name der Basiskonfigurationsdatei f&uuml;r die Demo Applikation. Eine beispielhafte Konfigurationsdatei fnden Sie <a href="../../../conf/moa-id-oa/oa.properties">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
+ <li><code>log4j.configuration</code>: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie <a href="../../../conf/moa-spss/log4j.properties">hier</a>. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/classes</code> enthaltene Default-Konfiguration herangezogen.</li>
+ <li><code>javax.net.ssl.trustStore</code>: Pfad und Dateiname des <span class="term">Truststores</span> f&uuml;r vertrauensw&uuml;rdige SSL Client-Zertifikate (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Ein relativer Pfad werden relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
+ <li><code>javax.net.ssl.trustStorePassword</code>: Passwort f&uuml;r den <span class="term">Truststore</span> (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). </li>
+ <li><code>javax.net.ssl.trustStoreType</code>: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Je nach verwendetem Keystore-Typ muss <code>jks</code> (<span class="term">Java Key Store</span>) oder <code>pkcs12</code> (PKCS#12-Datei) angegeben werden.</li>
+ </ul>
+ </li>
+</ul>
+<h4><a name="DemoApp_pvp21_install_start" id="allgemeines_zugangspunkte11"></a>3.1.1.2 Einsatz der Demo Applikation in Tomcat</h4>
+<p>Das starten und stoppen der Demo Applikation erfolgt identisch zur Beschreibung f&uuml;r die Module MOA-ID-Auth und MOA-ID-Configuration.</p>
+<p>Ein erfolgreicher Start der Demo Applikation ist an folgender Log-Meldung ersichtlich:</p>
+<pre>INFO at.gv.egovernment.moa.id.demoOA.Configuration - Demo Application initializaten finished.</pre>
+<p>Nach dem Starten von Tomcat steht die Demo Applikation zur Verf&uuml;gung.</p>
+<pre>http://&lt;host&gt;:&lt;port&gt;/moa-id-oa/</pre>
+<p>bzw. </p>
+<pre>
+https://&lt;host&gt;:&lt;port&gt;/moa-id-oa/
+</pre>
+<h3><a name="DemoApp_pvp21_config" id="allgemeines_zugangspunkte8"></a>3.1.2 Konfiguration Demo Applikation</h3>
+<p>Die zentrale Konfigurationsdatei f&uuml;r die Demo Applikation wird der <span class="term">Java Virtual Machine</span>, in der die Demo Applikation l&auml;uft, durch eine <span class="term">System Property </span> mitgeteilt (wird beim Starten der <span class="term">Java Virtual Machine</span> in der Form <code>-D&lt;name&gt;=&lt;wert&gt;</code> gemacht). Der Name der <span class="term">System Property</span> lautet <code>moa.id.demoOA</code> als Wert der <span class="term">System Property</span> ist der Pfad sowie der Name der Konfigurationsdatei im Dateisystem anzugeben, z.B.</p>
+<pre>moa.id.demoOA=C:/Programme/apache/tomcat-4.1.30/conf/moa-id-oa/oa.properties</pre>
+<p>Dieses Konfigurationsdatei beinhaltet folgende Parameter. </p>
+<table width="1247" border="1">
+ <tr>
+ <th width="395" scope="col">Name</th>
+ <th width="271" scope="col">Beispielwert</th>
+ <th width="559" scope="col">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.idp.metadata.url</td>
+ <td>https://demo.egiz.gv.at/moa-id-auth/<br>
+ pvp2/metadata</td>
+ <td>URL unter der die PVP2.1 Metadaten des IDP abgeholt werden k&ouml;nnen.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.idp.metadata.certificate</td>
+ <td>keys/metadata.crt</td>
+ <td>Zertifikat mit dem die PVP2.1 Metadaten des IDP signiert sind. Dieser Zertifikat wird zur Pr&uuml;fung der IDP Metadaten verwendet.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.idp.metadata.entityID</td>
+ <td>https://demo.egiz.gv.at/moa-id-auth/</td>
+ <td>EntityID des IDP in den Metadaten (Details siehe PVP2.1 Spezifikation)</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.idp.sso.logout.url</td>
+ <td>https://demo.egiz.gv.at/moa-id-auth/LogOut?redirect=<br>
+ https://demo.egiz.gv.at/moa-id-oa</td>
+ <td>URL zum Single Log-Out (SLO) Service des IDP. Details zum SLO Service von MOA-ID-Auth finden Sie <a href="./protocol/protocol.html#allgemeines_ssologout">hier</a>.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.metadata.entities.name</td>
+ <td>PVP 2.1 Demo</td>
+ <td>Name der Applikation, welcher in den Metadaten der Applikation angegeben wird</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.url</td>
+ <td>keys/moa_idp.p12</td>
+ <td>Keystore mit Schl&uuml;ssel und Zertifikaten welche f&uuml;r das signieren und verschl&uuml;sseln der PVP2.1 Nachrichten verwendet werden sollen.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.password</td>
+ <td>123456</td>
+ <td>Passwort des Keystores</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.type</td>
+ <td>PKCS12</td>
+ <td><p>Type des Keystores. Aktuell werden folgene Keystore Typen unterst&uuml;tzt</p>
+ <ul>
+ <li>PKCS12: PKCS12 Keystor</li>
+ <li>JKS: Java-Keystore</li>
+ </ul></td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.metadata.key.alias</td>
+ <td>metadata</td>
+ <td>Name des Schl&uuml;ssels der zum Signieren der Metadaten des Modules MOA-ID-Configuration verwendet werden soll</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.metadata.key.password</td>
+ <td>123456</td>
+ <td>Passwort des Schl&uuml;ssels der zum Signieren der Metadaten verwendet werden soll.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.authrequest.encryption.key.alias</td>
+ <td>encryption</td>
+ <td>Name des Schl&uuml;ssels der zum Verschl&uuml;sseln der Anmeldeinformation, welche vom IDP an das Konfigurationstool &uuml;bermittelt, verwendet werden soll</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.authrequest.encryption.key.password</td>
+ <td>123456</td>
+ <td>Passwort des Schl&uuml;ssels zum Verschl&uuml;sseln der Anmeldeinformation.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.authrequest.key.alias</td>
+ <td>authrequest</td>
+ <td>Name des Schl&uuml;ssels zum Signieren des Authentifizierungsrequests der an den IDP gestellt wird.</td>
+ </tr>
+ <tr>
+ <td>general.login.pvp2.keystore.authrequest.key.password</td>
+ <td>123456</td>
+ <td>Passwort des Schl&uuml;ssels zum Signieren des Authentifizierungsrequests.</td>
+ </tr>
+</table>
+<p>&nbsp;</p>
+<p>Die Metadaten des Modules MOA-ID-Configuration werden dynamisch erstellt und stehen unter folgender URL zum Download bereit.</p>
+<pre>
+http://&lt;host&gt;:&lt;port&gt;/moa-id-oa/servlet/metadata</pre>
+<p>bzw. </p>
+<pre>
+https://&lt;host&gt;:&lt;port&gt;/moa-id-oa/servlet/metadata</pre>
+<p>Nach erfolgreicher Konfiguration muss die Tomcat Instanz neu gestartet werden.</p>
+<h3><a name="DemoApp_pvp21_config_moaidauth" id="allgemeines_zugangspunkte13"></a>3.1.3 Konfiguration von MOA-ID-Auth</h3>
+<p>Bevor ein Anmeldevorgang gestartet werden kann muss die Demo Applikation auch als Online-Applikation f&uuml;r das Modul MOA-ID-Auth konfiguriert werden. Hierf&uuml;r kann das Konfigurationstool (Modul MOA-ID-Configuration) verwendet werden. Tragen Sie die Demo Applikation als Online-Applikation bei Ihrer MOA-ID-Auth Instanz ein. Eine Beschreibung der einzelnen Konfigurationsparameter finden Sie <a href="./../config/config.html#konfigurationsparameter_oa">hier</a>.</p>
+<h3><a name="DemoApp_pvp21_use" id="allgemeines_zugangspunkte12"></a>3.1.4 Anwendung</h3>
+<p>Nach dem Starten von Tomcat steht die Demo Applikation zur Verf&uuml;gung.</p>
+<pre>http://&lt;host&gt;:&lt;port&gt;/moa-id-oa/</pre>
+<p>bzw. </p>
+<pre>
+https://&lt;host&gt;:&lt;port&gt;/moa-id-oa/
+</pre>
+<p>Die Startseite der Demo Applikation beinhaltet einen kurzen Beschreibungstext und den Login Button zum Start des Anmeldevorgangs. F&uuml;r die Integration der B&uuml;rgerkartenumgebung verwendet die Demo die im <a href="#bkuselection_iframe">Kapitel 2.1.1</a> beschriebenen iFrame Variante. Nach Bet&auml;tigung des Login Buttons wird der Anmeldevorgang gestartet. Der Protokollablauf ist identisch zu dem im Kapitel Protokolle beschiebenen Ablauf f&uuml;r das <a href="./../protocol/protocol.html#pvp21_sequenz">PVP 2.1 Protokoll</a>.</p>
+<p>Konnten die Metadaten und der Authentifizierungsrequest erfolgreich verifiziert werden, wird anschlie&szlig;end die B&uuml;rgerkartenauswahl in der Hauptseite der Demo Applikation dargestellt. W&auml;hlen Sie nur die gew&uuml;nschte Authentifizierungsvariante. Danach erfolgt die Authentifizierung mittels der gew&auml;hlten Variante. </p>
+<p>Nach erfolgreicher Authentifizierung werden Sie an die Demo Applikation zur&uuml;ckgeleite. Diese extrahiert einige Basisdaten aus der PVP 2.1 Assertion und stellt diese im Browser dar. Zus&auml;tzlich kann die gesamte &uuml;bertragene PVP 2.1 Assertion angezeigt werden.</p>
+<p>Wurde der Anmeldevorgang durch einen Fehler abgebrochen werden Sie ebenfalls an die Demo Applikation zur&uuml;ckgeleitet. In diesem Fall wird eine kurze Fehlerbeschreibung dargestellt. Eine ausf&uuml;hrliche Fehlerbeschreibung kann der PVP 2.1 Assertion entnommen werden.</p>
+<p>&nbsp;</p>
+</body>
+</html>
diff --git a/id/server/doc/handbook/application/iframe.png b/id/server/doc/handbook/application/iframe.png
new file mode 100644
index 000000000..dcc6a932d
--- /dev/null
+++ b/id/server/doc/handbook/application/iframe.png
Binary files differ
diff --git a/id/server/doc/handbook/application/login_button.PNG b/id/server/doc/handbook/application/login_button.PNG
new file mode 100644
index 000000000..36d8921ce
--- /dev/null
+++ b/id/server/doc/handbook/application/login_button.PNG
Binary files differ
diff --git a/id/server/doc/handbook/application/mainframe.PNG b/id/server/doc/handbook/application/mainframe.PNG
new file mode 100644
index 000000000..0e597d3fc
--- /dev/null
+++ b/id/server/doc/handbook/application/mainframe.PNG
Binary files differ
diff --git a/id/server/doc/handbook/application/sso_sendassertion.PNG b/id/server/doc/handbook/application/sso_sendassertion.PNG
new file mode 100644
index 000000000..1a2ca6a67
--- /dev/null
+++ b/id/server/doc/handbook/application/sso_sendassertion.PNG
Binary files differ
diff --git a/id/server/doc/handbook/config/config.html b/id/server/doc/handbook/config/config.html
index b3bea08cb..58214bb44 100644
--- a/id/server/doc/handbook/config/config.html
+++ b/id/server/doc/handbook/config/config.html
@@ -52,29 +52,30 @@
<li><a href="#uebersicht_bekanntmachung">Bekanntmachung der Konfigurationsdatei</a></li>
<li><a href="#basisconfig_moa_id_auth_param">Konfigurationsparameter</a>
<ol>
- <li><a href="#basisconfig_moa_id_auth_param_general">Allgemeine Konfigurationsparameter</a></li>
- <li><a href="#basisconfig_moa_id_auth_param_services">Externe Services</a>
-<ol>
- <li><a href="#basisconfig_moa_id_auth_param_services_moasp">MOA-SP</a></li>
- <li><a href="#basisconfig_moa_id_auth_param_services_mandates">Online-Vollmachen</a></li>
- <li><a href="#">Foreign Identities</a></li>
- </ol>
- </li>
- <li><a href="#basisconfig_moa_id_auth_param_protocol">Protokolle</a>
-<ol>
- <li><a href="#basisconfig_moa_id_auth_param_protocol_pvp21">PVP 2.1</a></li>
- <li><a href="#basisconfig_moa_id_auth_param_protocol_openid">OpenID Connect</a></li>
- </ol>
- </li>
- <li><a href="#basisconfig_moa_id_auth_param_database">Datenbank </a>
-<ol>
- <li><a href="#basisconfig_moa_id_auth_param_database_conf">Konfiguration</a></li>
- <li><a href="#basisconfig_moa_id_auth_param_database_session">Session Informationen</a></li>
- <li><a href="#basisconfig_moa_id_auth_param_database_info">Statistikdaten</a></li>
- </ol>
- </li>
- </ol>
- </li>
+ <li><a href="#basisconfig_moa_id_auth_param_general">Allgemeine Konfigurationsparameter</a></li>
+ <li><a href="#basisconfig_moa_id_auth_param_services">Externe Services</a>
+ <ol>
+ <li><a href="#basisconfig_moa_id_auth_param_services_moasp">MOA-SP</a></li>
+ <li><a href="#basisconfig_moa_id_auth_param_services_mandates">Online-Vollmachen</a></li>
+ <li><a href="#">Foreign Identities</a></li>
+ </ol>
+ </li>
+ <li><a href="#basisconfig_moa_id_auth_param_protocol">Protokolle</a>
+ <ol>
+ <li><a href="#basisconfig_moa_id_auth_param_protocol_pvp21">PVP 2.1</a></li>
+ <li><a href="#basisconfig_moa_id_auth_param_protocol_openid">OpenID Connect</a></li>
+ </ol>
+ </li>
+ <li><a href="#basisconfig_moa_id_auth_param_database">Datenbank </a>
+ <ol>
+ <li><a href="#basisconfig_moa_id_auth_param_database_conf">Konfiguration</a></li>
+ <li><a href="#basisconfig_moa_id_auth_param_database_session">Session Informationen</a></li>
+ <li><a href="#basisconfig_moa_id_auth_param_database_info">Statistikdaten</a></li>
+ </ol>
+ </li>
+ <li> <a href="#basisconfig_moa_id_auth_param_testing">Testing</a></li>
+</ol>
+</li>
</ol>
</li>
<li><a href="#uebersicht_logging">Konfiguration des Loggings</a></li>
@@ -145,10 +146,12 @@
<li><a href="#import_template_sltemplate">Security-Layer Request</a></li>
</ol>
</li>
+ <li><a href="#sp-config">Konfiguration von MOA-SP</a></li>
+ <li><a href="#security">Tomcat Security Manager</a></li>
</ol>
- <ol type="A">
+<ol type="A">
<li><a href="#referenzierte_spezifikation">Referenzierte Spezifikation</a></li>
- </ol>
+</ol>
<hr/>
<h1><a name="uebersicht" id="uebersicht"></a>1 &Uuml;bersicht </h1>
<p>Dieses Handbuch beschreibt detailliert die Konfigurationsm&ouml;glichkeiten f&uuml;r die Module MOA-ID-Auth und MOA-ID-Configuration. Wobei das zentrale Einsatzgebiet des Modules MOA-ID-Configuration die Konfiguration des Modules MOA-ID-Auth darstellt.</p>
@@ -270,7 +273,7 @@
<td>general.login.pvp2.idp.sso.logout.url</td>
<td>https://demo.egiz.gv.at/moa-id-auth/LogOut?redirect=<br>
https://demo.egiz.gv.at/moa-id-configuration</td>
- <td>URL zum Single Log-Out (SLO) Service des IDP. Details zum SLO Service von MOA-ID-Auth finden Sie <a href="./protocol/protocol.html">hier</a>.</td>
+ <td>URL zum Single Log-Out (SLO) Service des IDP. Details zum SLO Service von MOA-ID-Auth finden Sie <a href="./protocol/protocol.html#allgemeines_ssologout">hier</a>.</td>
</tr>
<tr>
<td>general.login.pvp2.metadata.entities.name</td>
@@ -606,7 +609,7 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/MonitoringServlet</pre>
<tr>
<td>service.moasp.acceptedServerCertificates</td>
<td>certs/moa-sp-server/</td>
- <td>Hier kann ein Verzeichnisname (relativ zur MOA-ID Konfigurationsdatei) angegeben werden, in dem die akzeptierten Zertifikate der TLS-Verbindung hinterlegt sind. In diesem Verzeichnis werden nur Serverzertifikate abgelegt. Fehlt dieser Parameter wird lediglich &uuml;berpr&uuml;ft ob ein Zertifikatspfad zu den im Element &lt;TrustedCACertificates&gt; TODO!! angegebenen Zertifikaten erstellt werden kann.</td>
+ <td>Hier kann ein Verzeichnisname (relativ zur MOA-ID Konfigurationsdatei) angegeben werden, in dem die akzeptierten Zertifikate der TLS-Verbindung hinterlegt sind. In diesem Verzeichnis werden nur Serverzertifikate abgelegt. Fehlt dieser Parameter wird lediglich &uuml;berpr&uuml;ft ob ein Zertifikatspfad zu den im Element &lt;TrustedCACertificates&gt; (siehe <a href="#konfigurationsparameter_allgemein_certvalidation">Kapitel 3.1.4</a>) angegebenen Zertifikaten erstellt werden kann.</td>
</tr>
</table>
<p>&nbsp;</p>
@@ -837,6 +840,27 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/MonitoringServlet</pre>
</table>
<p>&nbsp;</p>
<p>Die Beispielkonfiguration beinhaltet noch zus&auml;tzliche Konfigurationsparameter f&uuml;r den Datenbankzugriff der einzelnen Schema welche direkt aus der Beispielkonfiguration &uuml;bernommen werden k&ouml;nnen. Eine detaillierte Beschreibung der einzelnen Einstellungsparameter kann der <a href="http://docs.jboss.org/hibernate/core/4.2/manual/en-US/html/">Hibernate Dokumention</a> entnommen werden.</p>
+<h4><a name="basisconfig_moa_id_auth_param_testing" id="uebersicht_bekanntmachung15"></a>2.2.2.5 Testing</h4>
+ <p>Diese Parameter dienen auf Testsystemen zur Deaktivierung einzelner Verarbeitungs- oder Pr&uuml;fschritte. Standardm&auml;&szlig;ig ist jeweils die sichere Variante aktiviert.</p>
+ <table width="1247" border="1">
+ <tr>
+ <th width="281" scope="col">Name</th>
+ <th width="261" scope="col">Beispielwert</th>
+ <th width="683" scope="col">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>configuration.validation.certificate.QC.ignore</td>
+ <td><p>true / false</p></td>
+ <td><p>Deaktiviert die QC Pr&uuml;fung von Signaturzertifikaten. Da manche Testzertifikate oder Testkarten keine QC Erweiterung aufweisen und somit eine Anmeldung mit diesen Zertifikaten nicht m&ouml;glich ist, kann die QC Pr&uuml;fung je Instanz deaktiviert werden.</p>
+ <p><strong>Defaultwert:</strong> false</p></td>
+ </tr>
+ <tr>
+ <td>protocols.pvp2.assertion.encryption.active</td>
+ <td>true / false</td>
+ <td><p>Mit diesem Parameter kann die Verschl&uuml;sselung der PVP2.1 Assertion f&uuml;r diese MOA-ID-Auth Instanz vollst&auml;ndig deaktiviert werden.</p>
+ <p><strong>Defaultwert:</strong> true</p></td>
+ </tr>
+ </table>
<p>&nbsp;</p>
<h2><a name="uebersicht_logging" id="uebersicht_logging"></a>2.3 Konfiguration des Loggings</h2>
<p>Die Module MOA-ID-Auth und MOA-ID-Configuration verwendet als Framework f&uuml;r Logging-Information die Open Source Software <code>log4j</code>. Die Konfiguration der Logging-Information erfolgt nicht direkt durch die einzelnen Module, sondern &uuml;ber eine eigene Konfigurationsdatei, die der <span class="term">Java Virtual Machine</span> durch eine <span class="term">System Property </span> mitgeteilt wird. Der Name der <span class="term">System Property </span> lautet <code>log4j.configuration</code>; als Wert der <span class="term">System Property </span> ist eine URL anzugeben, die auf die <code>log4j</code>-Konfigurationsdatei verweist, z.B. </p>
@@ -872,7 +896,7 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/MonitoringServlet</pre>
</tr>
</table>
<h3><a name="konfigurationsparameter_allgemein_bku" id="konfigurationsparameter_allgemein_bku"></a>3.1.2 Default BKUs</h3>
-<p>Hiermit werden die URLs zu den Default B&uuml;rgerkartenumgebungen (BKUs) definiert die von MOA-ID-Auth f&uuml;r einen Anmeldevorgang verwendet werden, wenn die B&uuml;rgerkartenauswahl nicht bereits auf Seiten der Online-Applikation erfolgt ist (siehe Protokolle: TODO) oder in der Online-Applikationskonfiguration keine BKU URLs konfiguriert wurden (siehe <a href="#konfigurationsparameter_oa_bku">Kapitel 3.2.2</a>).</p>
+<p>Hiermit werden die URLs zu den Default B&uuml;rgerkartenumgebungen (BKUs) definiert die von MOA-ID-Auth f&uuml;r einen Anmeldevorgang verwendet werden, wenn die B&uuml;rgerkartenauswahl nicht bereits auf Seiten der Online-Applikation erfolgt ist (siehe <a href="./../protocol/protocol.html#allgemeines_legacy">Legacy Request</a>) oder in der Online-Applikationskonfiguration keine BKU URLs konfiguriert wurden (siehe <a href="#konfigurationsparameter_oa_bku">Kapitel 3.2.2</a>).</p>
<table width="1247" border="1">
<tr>
<th width="89" scope="col">Name</th>
@@ -958,9 +982,14 @@ Checking</td>
<th width="921" scope="col">Beschreibung</th>
</tr>
<tr>
- <td>Assertion</td>
+ <td>Anmeldedaten</td>
<td>300</td>
- <td>Gibt die Zeitspanne in Sekunden an, f&uuml;r die die Anmeldedaten in der Authentisierungskomponente (MOA-ID-Auth) zum Abholen durch die eine nachfolgende Applikation bereitstehen. Nach Ablauf dieser Zeitspanne werden die Anmeldedaten gel&ouml;scht.</td>
+ <td><p>Gibt die Zeitspanne in Sekunden an, f&uuml;r die Anmeldedaten, tempor&auml;re Sessiondaten oder Assertions in der Authentisierungskomponente (MOA-ID-Auth) vorr&auml;tig gehalten werden. Nach Ablauf dieser Zeitspanne werden diese Daten gel&ouml;scht oder der Anmeldevorgang abgebrochen. Dieser Parameter hat Einfluss auf folgende Funktionen:</p>
+ <ul>
+ <li>maximale Zeitspanne eines Anmeldevorgangs vom Authentification Request bis zur Authentification Response gerechnet.</li>
+ <li>maximale Zeitspanne welche einer Online-Applikation zum Abholen der Anmeldedaten zur Verf&uuml;gung steht. (SAML mit Artifact Binding und OpenID Connect)</li>
+ <li>maximale Zeitspanne zum Abholen zus&auml;tzlicher STORK2 Attribute (Zeitdauer je Attribut)</li>
+ </ul> </td>
</tr>
<tr>
<td>SSO Session authentifiziert</td>
@@ -975,7 +1004,7 @@ Checking</td>
</table>
<h3><a name="konfigurationsparameter_allgemein_moasp" id="konfigurationsparameter_allgemein_bku5"></a>3.1.6 MOA-SP</h3>
<p>Der Abschnitt MOA-SP Konfiguration enth&auml;lt Parameter zur Nutzung von MOA-SP. MOA-SP wird f&uuml;r die &Uuml;berpr&uuml;fung der Signatur der Personenbindung und des AUTH-Blocks verwendet.</p>
-<p>MOA-SP muss entsprechend konfiguriert werden - siehe hierzu Abschnitt <a href="http://joinup.ec.europa.eu/site/moa-idspss/moa-id-1.5.1/doc/moa_id/id-admin_2.htm#sp-config"> TODO: Konfiguration von MOA-SP</a>. Alle Details zur Konfiguration von MOA-SP finden sie in der Distribution von MOA-SP/SS beiliegenden Dokumentation im Abschnitt 'Konfiguration'. </p>
+<p>MOA-SP muss entsprechend konfiguriert werden - siehe hierzu Abschnitt <a href="#sp-config"> Konfiguration von MOA-SP</a>. Alle Details zur Konfiguration von MOA-SP finden sie in der Distribution von MOA-SP/SS beiliegenden Dokumentation im Abschnitt 'Konfiguration'. </p>
<table width="1247" border="1">
<tr>
<th width="164" scope="col">Name</th>
@@ -1008,9 +1037,9 @@ Checking</td>
<p>Hiermit werden die URLs zum Online-Vollmachten Service und zum SZR-Gateway konfiguriert. Die Konfiguration der f&uuml;r den Zugriff ben&ouml;tigen Client-Zertifikate wurden bereits im Abschnitt <a href="#basisconfig_moa_id_auth_param_services">2.2.2.2</a> behandelt.</p>
<table width="1247" border="1">
<tr>
- <th width="140" scope="col">Name</th>
- <th width="231" scope="col">Beispielwert</th>
- <th width="854" scope="col">Beschreibung</th>
+ <th width="147" scope="col">Name</th>
+ <th width="360" scope="col">Beispielwert</th>
+ <th width="718" scope="col">Beschreibung</th>
</tr>
<tr>
<td><span id="wwlbl_loadGeneralConfig_moaconfig_mandateURL">Online-Vollmachten Service</span></td>
@@ -1018,10 +1047,10 @@ Checking</td>
<td>URL zum Online-Vollmachten Service</td>
</tr>
<tr>
- <td><span id="wwlbl_loadGeneralConfig_moaconfig_szrgwURL">SZR Gateway Service</span></td>
- <td>https://szrgw.egiz.gv.at:8443/services/<br>
- IdentityLinkCreation</td>
- <td>URL zum Stammzahlen-Register Gateway</td>
+ <td><span id="wwlbl_loadGeneralConfig_moaconfig_szrgwURL">SZR-Gateway Service</span></td>
+ <td>https://szrgw.egiz.gv.at:8443/szr-gateway_2.0/services/IdentityLinkCreation</td>
+ <td><p>URL zum Stammzahlen-Register Gateway</p>
+ <p><strong>Hinweis:</strong> Der SZR-Gateway Service welcher in der MOA-ID 1.5.1 Konfiguration verwendet wurde ist nicht mehr kompatibel zu MOA-ID 2.0. Das aktualsierte Test SZR-Gateway Service f&uuml;r MOA-ID 2.x steht unter folgender URL zur Verf&uuml;gung. <em>https://szrgw.egiz.gv.at:8443/szr-gateway_2.0/services/IdentityLinkCreation</em></p></td>
</tr>
</table>
<h3><a name="konfigurationsparameter_allgemein_sso" id="konfigurationsparameter_allgemein_bku7"></a>3.1.8 Single-Sign On(SSO)</h3>
@@ -1082,45 +1111,102 @@ Checking</td>
</table>
<h3><a name="konfigurationsparameter_allgemein_stork" id="konfigurationsparameter_allgemein_bku8"></a>3.1.9 Secure idenTity acrOss boRders linKed (STORK)</h3>
<p>Dieser Abschnitt konfiguriert die Authentifizierung mittels STORK f&uuml;r das Modul MOA-ID-Auth.</p>
-<table width="1250" border="1">
+<table width="1241" border="1">
<tr>
- <th width="167" scope="col">Name</th>
- <th width="168" scope="col">Beispielwert</th>
- <th width="43" scope="col">Admin</th>
- <th width="57" scope="col">Optional</th>
- <th width="781" scope="col">Beschreibung</th>
+ <th width="139" scope="col">Name</th>
+ <th width="355" scope="col">Beispielwert</th>
+ <th width="725" scope="col">Beschreibung</th>
</tr>
<tr>
<td>QAA-Level</td>
<td>4</td>
- <td align="center">&nbsp;</td>
- <td align="center">X</td>
<td>Definiert den mindest QAA-Level den diese MOA-ID-Auth Instanz f&uuml;r die Authentifizierung verlangt.</td>
</tr>
<tr>
<td><p>PEPS Konfiguration</p></td>
<td>PT --&gt;
https://eu-id.teste.cartaodecidadao.gov.pt/PEPS/ColleagueRequest</td>
- <td align="center">&nbsp;</td>
- <td align="center">X</td>
<td>Definiert die URLs die PEPS Instanzen der jeweiligen L&auml;nder f&uuml;r welche eine Anmeldung mittels STORK unterst&uuml;tzt wird. Die Konfiguration erfolgt mit dem L&auml;ndercode (Bsp: PT, LU, ES, ...) und der URL auf den jeweiligen PEPS.</td>
</tr>
<tr>
<td><p>Attributkonfiguration</p></td>
<td>&nbsp;</td>
- <td align="center">&nbsp;</td>
- <td align="center">X</td>
<td><p>In diesem Bereich k&ouml;nnen einzelne STORK Attribute angefordert werden. Jede Attributkonfiguration besteht aus dem Attributnamen und der Information ob dieses Attribut verpflichtend (zwingend) &uuml;bermittelt werden muss.</p>
<p>Als Attributname muss der <em>Friendlyname</em> (Bsp: eIdentifier, nationalityCode, ...) des gew&uuml;nschten STORK Attributes angegeben werden. Die verf&uuml;gbaren Attribute k&ouml;nnen der STORK Spezifikation entnommen werden.</p></td>
</tr>
</table>
+<p>&nbsp;</p>
+<p>Folgende Attribute m&uuml;ssen jedoch mindestens angefordert werden, wobei die erforderlichen Attribute je nach Anmeldeart unterschiedlich sind. Eine Liste mit weiteren m&ouml;glichen Attribute finden Sie im Kapitel <a href="./../protocol/protocol.html#allgemeines_attribute">Protokolle</a> oder in der <a href="#referenzierte_spezifikation">STORK Spezifikation</a>.</p>
+<table width="1251" border="1">
+ <tr>
+ <th width="145" scope="col">Name</th>
+ <th width="106" scope="col">nat&uuml;rliche Person</th>
+ <th width="102" scope="col">Anmeldung in Vertretungl</th>
+ <th width="870" scope="col">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>eIdentifier</td>
+ <td align="center">X</td>
+ <td align="center">X</td>
+ <td>Eindeutiger Identifier der Person f&uuml;r die die Anmeldung erfolgt.</td>
+ </tr>
+ <tr>
+ <td><p>givenName</p></td>
+ <td align="center">X</td>
+ <td align="center">X</td>
+ <td>Vorname der Person f&uuml;r die die Anmeldung erfolgt.</td>
+ </tr>
+ <tr>
+ <td><p>surname</p></td>
+ <td align="center"><br>
+ X</td>
+ <td align="center">X</td>
+ <td><p>Familienname der Person f&uuml;r die die Anmeldung erfolgt.</p></td>
+ </tr>
+ <tr>
+ <td>dateOfBirth</td>
+ <td align="center">X</td>
+ <td align="center">X</td>
+ <td>Geburtsdatum der Person f&uuml;r die die Anmeldung erfolgt.</td>
+ </tr>
+ <tr>
+ <td>gender</td>
+ <td align="center">X</td>
+ <td align="center">X</td>
+ <td>Geschlecht der Person f&uuml;r die die Anmeldung erfolgt.</td>
+ </tr>
+ <tr>
+ <td>canonicalResidenceAddress</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">X</td>
+ <td>Addresse der Person f&uuml;r welche die Anmeldung erfolgt</td>
+ </tr>
+ <tr>
+ <td>mandateContent</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">X</td>
+ <td>Elektronische Vollmacht, welche die Vertretungsverh&auml;ltnisse widerspiegelt.</td>
+ </tr>
+ <tr>
+ <td>representative</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">X</td>
+ <td>Nat&uuml;rliche Person welche eine juristische oder nat&uuml;rliche Person im Rahmen einer Anmeldung mittels Vollmacht vertritt.</td>
+ </tr>
+ <tr>
+ <td>represented</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">X</td>
+ <td>Juristische oder nat&uuml;rliche Person welche im Rahmen einer Anmeldung mittels Vollmacht vertreten wird.</td>
+ </tr>
+</table>
<h3><a name="konfigurationsparameter_allgemein_protocol" id="konfigurationsparameter_allgemein_bku9"></a>3.1.10 Protokolle</h3>
<p>Hierbei handelt es ich um allgemeine Einstellungen zu den vom Modul MOA-ID-Auth unterst&uuml;tzen Authentifizierungsprotokollen.</p>
<h4><a name="konfigurationsparameter_allgemein_protocol_allowed" id="konfigurationsparameter_allgemein_bku10"></a>3.1.10.1 Protokolle aktivieren</h4>
<p>In diesem Abschnitt k&ouml;nnen die einzelnen von MOA-ID-Auth unterst&uuml;tzen Authentifizierungsprotokolle aktiviert oder deaktiviert werden. Diese Einstellung gilt f&uuml;r die gesamte MOA-ID-Auth Instanz.</p>
<h4><a name="konfigurationsparameter_allgemein_protocol_legacy" id="konfigurationsparameter_allgemein_bku11"></a>3.1.10.2 Legacy Modus</h4>
<p>Ab der Version 2.0 des Modules MOA-ID-Auth wird die B&uuml;rgerkartenauswahl standardm&auml;&szlig;ig von MOA-ID-Auth bereitgestellt und erfolgt im Kontext von MOA-ID-Auth. Dem zu Folge m&uuml;ssen die aus MOA-ID 1.5.1 bekannten StartAuthentication Parameter (target, bkuURL, template, usemandate) nicht mehr im StartAuthentication Request &uuml;bergeben werden.</p>
-Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der Online-Applikation erfolgen muss f&uuml;r das jeweilige Protokoll der Legacy Modus aktiviert werden. Wird der Legacy Modus verwendet m&uuml;ssen jedoch die bkuURL, das Security-Layer Template und der Target mit den bei MOA-ID-Auth hinterlegten Konfigurationsparametern der Online-Applikation &uuml;bereinstimmten. Detailinformationen hierzu finden Sie im Kapitel Protokolle. TODO:
+Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der Online-Applikation erfolgen muss f&uuml;r das jeweilige Protokoll der Legacy Modus aktiviert werden. Wird der Legacy Modus verwendet m&uuml;ssen jedoch die bkuURL, das Security-Layer Template und der Target mit den bei MOA-ID-Auth hinterlegten Konfigurationsparametern der Online-Applikation &uuml;bereinstimmten. Detailinformationen hierzu finden Sie im Kapitel <a href="./../protocol/protocol.html#allgemeines_legacy">Protokolle</a>.
<h4><a name="konfigurationsparameter_allgemein_protocol_saml1" id="konfigurationsparameter_allgemein_bku12"></a>3.1.10.3 SAML1 Konfiguration</h4>
<p>Die SourceID ist ein Teil des SAML1 Artifacts welches zur Abholung der SAML1 Assertion an die Online-Applikation zur&uuml;ckgegeben wird. Standardm&auml;&szlig;ig wird die SourceID aus der URL der jeweiligen Online-Applikation, an der die Anmeldung stattfinden, generiert. Optional kann jedoch eine SourceID f&uuml;r die gesamte MOA-ID-Auth Instanz vergeben werden, welche f&uuml;r alle Online-Applikationen verwendet wird.</p>
<table width="1247" border="1">
@@ -1213,7 +1299,7 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
</tr>
</table>
<h3><a name="konfigurationsparameter_allgemein_sltransform" id="konfigurationsparameter_allgemein_bku14"></a>3.1.11 Security-Layer Transformationen</h3>
-<p>Die Security-Layer (SL) Transformation, welche von MOA-ID-Auth f&uuml;r die Erstellung der Signatur des AuthBlock verwendet werden soll, muss hier angegeben werden. &Uuml;ber das Datei-Upload Feld kann die zu verwendende Transformation hochgeladen werden. Diese befindet sich in der MOA-ID-Auth Defaultkonfiguration im Ordner <em>/conf/moa-id/transforms/ TransformsInfoAuthBlockTable_DE_2.0.xml</em>. TODO: URL</p>
+<p>Die Security-Layer (SL) Transformation, welche von MOA-ID-Auth f&uuml;r die Erstellung der Signatur des AuthBlock verwendet werden soll, muss hier angegeben werden. &Uuml;ber das Datei-Upload Feld kann die zu verwendende Transformation hochgeladen werden. Diese befindet sich in der MOA-ID-Auth Defaultkonfiguration im Ordner <em><a href="./../../../conf/moa-id/transforms/TransformsInfoAuthBlockTable_DE_2.0.xml">/conf/moa-id/transforms/ TransformsInfoAuthBlockTable_DE_2.0.xml</a></em>.</p>
<h2><a name="konfigurationsparameter_oa" id="uebersicht_zentraledatei_aktualisierung3"></a>3.2 Online Applikationen</h2>
<p>Die Konfiguration von Online-Applikationen erfolgt ebenfalls mit Hilfe des Moduls MOA-ID-Configuration. Es k&ouml;nnen sowohl neue Online-Applikationen erstellt als auch bestehende Online-Applikationen bearbeitet oder gel&ouml;scht werden. Der erlaubte Konfigurationsumfang h&auml;ngt jedoch von Role des aktuellen Benutzers ab, wobei eine Konfiguration der gesamten Parameter nur einem Benutzer mit der Role <em>admin</em> m&ouml;glich ist. Alle Konfigurationsfelder die nur einem Benutzer mit der Role <em>admin</em> zur Verf&uuml;gung stehen sind gesondert gekennzeichnet.</p>
<h3><a name="konfigurationsparameter_oa_general" id="uebersicht_zentraledatei_aktualisierung17"></a>3.2.1 Informationen zur Online-Applikation (Service Provider)</h3>
@@ -1370,7 +1456,7 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
<td>&nbsp;</td>
<td align="center">X</td>
<td align="center">X</td>
- <td>&Uuml;ber diese Funktion k&ouml;nnen drei zus&auml;tzliche SecurtityLayer-Request Templates f&uuml;r diese Online-Applikation definiert werden. Diese hier definierten Templates dienen als zus&auml;tzliche WhiteList f&uuml;r Templetes welche im &bdquo;StartAuthentication&ldquo; Request mit dem Parameter &bdquo;template&ldquo; &uuml;bergeben werden. Sollte im &bdquo;StartAuthentication&ldquo; Request der Parameter &bdquo;template&ldquo; fehlen, es wurde jedoch eine &bdquo;bkuURL&ldquo; &uuml;bergeben, dann wird f&uuml;r den Authentifizierungsvorgang das erste Template in dieser Liste verwendet. Detailinformationen zum legacy Request finden Sie im Kapitel Protokolle. TODO:</td>
+ <td>&Uuml;ber diese Funktion k&ouml;nnen drei zus&auml;tzliche SecurtityLayer-Request Templates f&uuml;r diese Online-Applikation definiert werden. Diese hier definierten Templates dienen als zus&auml;tzliche WhiteList f&uuml;r Templetes welche im &bdquo;StartAuthentication&ldquo; Request mit dem Parameter &bdquo;template&ldquo; &uuml;bergeben werden. Sollte im &bdquo;StartAuthentication&ldquo; Request der Parameter &bdquo;template&ldquo; fehlen, es wurde jedoch eine &bdquo;bkuURL&ldquo; &uuml;bergeben, dann wird f&uuml;r den Authentifizierungsvorgang das erste Template in dieser Liste verwendet. Detailinformationen zum <a href="./../protocol/protocol.html#allgemeines_legacy">Legacy Request</a> finden Sie im Kapitel Protokolle.</td>
</tr>
<tr>
<td>BKU-Selection Template</td>
@@ -1416,11 +1502,11 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
<td>&nbsp;</td>
<td align="center">&nbsp;</td>
<td align="center">X</td>
- <td>Definiert ob eine Online-Applikation ausschlie&szlig;lich Anmeldungen mittels Online-Vollmachten unterst&uuml;tzt. Wenn ja, wird in w&auml;hrend der BKU-Auswahl die Option <em>in Vertretung</em> f&uuml;r eine Anmeldung in Vertretung standardm&auml;&szlig;ig aktiviert und diese Einstellung kann durch die BenutzerIn oder den Benutzer nicht ge&auml;ndert werden..</td>
+ <td>Definiert ob eine Online-Applikation ausschlie&szlig;lich Anmeldungen mittels Online-Vollmachten unterst&uuml;tzt. Wenn ja, wird in w&auml;hrend der BKU-Auswahl die Option <em>in Vertretung</em> f&uuml;r eine Anmeldung in Vertretung standardm&auml;&szlig;ig aktiviert und diese Einstellung kann durch die BenutzerIn oder den Benutzer nicht ge&auml;ndert werden. </td>
</tr>
</table>
<p>&nbsp;</p>
-<p><strong>Hinweis:</strong> Werden f&uuml;r die Online-Applikation eigene Templates f&uuml;r die B&uuml;rgerkartenauswahl oder die zus&auml;tzliche Anmeldeabfrage im SSO Fall (siehe <a href="#konfigurationsparameter_oa_bku">Abschnitt 3.2.2</a>) verwendet, stehen alle Konfigurationsparameter die Einfluss auf die BKU-Auswahl haben nicht zur Verf&uuml;gung.</p>
+<p><strong>Hinweis:</strong> Werden f&uuml;r die Online-Applikation eigene Templates f&uuml;r die B&uuml;rgerkartenauswahl oder die zus&auml;tzliche Anmeldeabfrage im SSO Fall (siehe <a href="#konfigurationsparameter_oa_bku">Abschnitt 3.2.2</a>) verwendet, stehen alle Konfigurationsparameter die Einfluss auf die BKU-Auswahl haben nicht zur Verf&uuml;gung. Die Funktionalit&auml;t der entsprechenden Parameter hat jedoch weiterhin Einfluss auf den Anmeldevorgang.</p>
<h3><a name="konfigurationsparameter_oa_sso" id="uebersicht_zentraledatei_aktualisierung22"></a>3.2.4 Single Sign-On (SSO)</h3>
<p>Dieser Abschnitt behandelt online-applikationsspezifische Einstellungen zu Single Sign-On</p>
<table width="1248" border="1">
@@ -1484,7 +1570,7 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
<p>&nbsp;</p>
<p><strong>Hinweis:</strong> Werden f&uuml;r die Online-Applikation eigene Templates f&uuml;r die B&uuml;rgerkartenauswahl oder die zus&auml;tzliche Anmeldeabfrage im SSO Fall (siehe <a href="#konfigurationsparameter_oa_bku">Abschnitt 3.2.2</a>) verwendet, stehen alle Konfigurationsparameter die Einfluss auf die BKU-Auswahl haben nicht zur Verf&uuml;gung.</p>
<h3><a name="konfigurationsparameter_oa_protocol" id="uebersicht_zentraledatei_aktualisierung24"></a>3.2.6 Authentifizierungsprotokolle</h3>
-<p>Dieser Abschnitt behandelt online-applikationsspezifische Einstellungen zu den von der Online-Applikation unterst&uuml;tzen Authentifizierungsprotokollen. Eine Verwendung aller zur Verf&uuml;gung stehender Authentifizierungsprotokolle durch die Online-Applikation ist ebenfalls m&ouml;glich. Hierf&uuml;r muss nur alle ben&ouml;tigten Protokolle konfiguriert werden. N&auml;here Informationen zu den unterst&uuml;tzten Protokollen finden sie im Kapitel Protokolle. TODO:</p>
+<p>Dieser Abschnitt behandelt online-applikationsspezifische Einstellungen zu den von der Online-Applikation unterst&uuml;tzen Authentifizierungsprotokollen. Eine Verwendung aller zur Verf&uuml;gung stehender Authentifizierungsprotokolle durch die Online-Applikation ist ebenfalls m&ouml;glich. Hierf&uuml;r m&uuml;ssen nur alle ben&ouml;tigten Protokolle konfiguriert werden. N&auml;here Informationen zu den unterst&uuml;tzten Protokollen finden sie im Kapitel <a href="./../protocol/protocol.html">Protokolle</a>.</p>
<p>Aus gr&uuml;nden der &Uuml;bersichtlichkeit kann der Konfigurationsbereich f&uuml;r jeden Protokoll, in der Web-Oberfl&auml;che des Konfigurationstools, ein- oder ausgeblendet werden.</p>
<h4><a name="konfigurationsparameter_oa_protocol_saml1" id="uebersicht_zentraledatei_aktualisierung25"></a>3.2.6.1 SAML1</h4>
<p>F&uuml;r das Protokoll SAML1 stehen folgende Konfigurationsparameter zur Verf&uuml;gung.</p>
@@ -1556,14 +1642,14 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
<td>&nbsp;</td>
<td align="center">&nbsp;</td>
<td align="center">X</td>
- <td>Wird diese Option gew&auml;hlt erfolgt nach dem Speicher der Konfiguration eine Neu-initialisierung der PVP 2.1 Metadaten der Online-Applikation durch die MOA-ID-Auth Instanz. </td>
+ <td>Wird diese Option gew&auml;hlt erfolgt nach dem Speicher der Konfiguration eine Neuinitialisierung der PVP 2.1 Metadaten der Online-Applikation durch die MOA-ID-Auth Instanz. </td>
</tr>
<tr>
<td>URL zu den Metadaten</td>
<td>http://demo.egiz.gv.at/demologin-pvp2-sso/metadata/demoportal-pvp2-sso.mdxml</td>
<td align="center">&nbsp;</td>
<td align="center">&nbsp;</td>
- <td>URL unter der die MOA-ID-Auth Instanz die Metadaten der Online-Applikation beziehen kann. Diese Metadaten m&uuml;ssen durch die Online-Applikation signiert sein. F&uuml;r den Fall das die Metadaten &uuml;ber https abgeholt werden, muss ja jeweilige Serverzertifikat zur Zertifikatspr&uuml;fung im <a href="../install/install.html#webservice_basisinstallation_installation_spssdeploy">TrustStore der MOA-ID-Auth Instanz</a> hinterlegt sein.
+ <td>URL unter der die MOA-ID-Auth Instanz die Metadaten der Online-Applikation beziehen kann. Diese Metadaten m&uuml;ssen durch die Online-Applikation signiert sein. F&uuml;r den Fall das die Metadaten &uuml;ber https abgeholt werden, muss ja jeweilige Serverzertifikat zur Zertifikatspr&uuml;fung im <a href="../install/install.html#webservice_basisinstallation_installation_spssdeploy">TrustStore der MOA-ID-Auth Instanz</a> hinterlegt sein. Die Metadaten werden anschlie&szlig;end durch MOA-ID-Auth innerhalb des in den Metadaten angegebenen G&uuml;ltigkeitszeitraums automatisch aktuallisiert. Das Aktuallisierungsintervall bei automatischer Aktualisierung betr&auml;gt jedoch mindestens 15 Minuten jedoch nicht mehr als 24 Stunden. (Interval: 15min &lt; Aktualisierungszeitpunkt &lt; 24 Stunden)
<p><b>Hinweis:</b> Metadaten können nur über http oder https bezogen werden. Das Laden von Metadaten aus dem lokalen Verzeichnissystem ist nicht möglich.</p></td>
</tr>
<tr>
@@ -1618,7 +1704,7 @@ Soll die B&uuml;rgerkartenauswahl weiterhin, wie in MOA-ID 1.5.1 im Kontext der
<p>&nbsp;</p>
<h3><a name="konfigurationsparameter_oa_additional" id="uebersicht_zentraledatei_aktualisierung28"></a>3.2.7 Zus&auml;tzliche allgemeine Einstellungen</h3>
<p>In Abschnitt ermöglicht eine erweiterte online-applikationsspezifische Individualisierung des AuthBlocks und der Bürgerkartenauswahl.
-Die Individualisierung des AuthBlocks steht jedoch dann zur Verfügung wenn die dem Module MOA-ID-Auth beigelegte Security-Layer Transformation (siehe Kapitel TODO:) verwendet wird oder
+Die Individualisierung des AuthBlocks steht jedoch dann zur Verfügung wenn die dem Module MOA-ID-Auth beigelegte Security-Layer Transformation verwendet wird oder
wenn die individuelle Security-Layer Transformation den Formvorschriften der Spezifikation entspricht.</p>
<table width="1250" border="1">
<tr>
@@ -1781,7 +1867,9 @@ Exportfunktion verwendet werden.</p>
<h2><a name="import_template_" id="uebersicht_zentraledatei_Templates"></a>4 Templates</h2>
<p>Dieser Abschnitt spezifiziert den Mindestaufbau der Templates f&uuml;r die BKU Auswahl, die Single Sign-On Anmeldeabfrage und die Security-Layer Request Templates welche vo Module MOA-ID-Auth verwendet werden. Alle hier beschriebenen Templates werden durch MOA-ID-Auth geladen, erweitert und gegebenfalls der Benutzerin oder dem Benutzer im Web-Browser dargestellt. Um einen korrekten Anmeldeprozess zu gew&auml;hrleisten m&uuml;ssen diese Templates mindestens folgende Formvorschriften und Strukturen aufweisen.</p>
<h3><a name="import_template_bku" id="uebersicht_zentraledatei_aktualisierung6"></a>4.1 Bürgerkartenauswahl</h3>
-<p>Das BKU Template dient im Anmeldeprozess der Auswahl der gew&uuml;nschten B&uuml;rgerkatenumgebung oder Handy-Signature. Nach erfolgter Auswahl durch die Benutzer oder dem Benutzer wird diese an MOA-ID-Auth &uuml;bermittelt. F&uuml;r die &Uuml;bermittlung an MOA-ID-Auth ist ein http GET Request vorgesehen welcher folgende Parameter unterst&uuml;tzt. Die URL dieses http GET Request wird automatisiert &uuml;ber den Parameter &bdquo;#AUTH_URL#&ldquo; (ohne &bdquo;&ldquo;) eingetragen und muss nicht manuell hinterlegt werden. Folgende http GET Parameter werden f&uuml;r die BKU-Auswahl akzeptiert.</p>
+<p>Das BKU Template dient im Anmeldeprozess der Auswahl der gew&uuml;nschten B&uuml;rgerkatenumgebung oder Handy-Signature. Nach erfolgter Auswahl durch die Benutzer oder dem Benutzer wird diese an MOA-ID-Auth &uuml;bermittelt. </p>
+<p><strong>Hinweis:</strong> In der Datei <em>./htmlTemplates/loginFormFull.html</em> welcher sich relativ zur <a href="#uebersicht_bekanntmachung">MOA-ID-Auth Konfigurationsdatei</a> befindet finden Sie das Standard Template welches f&uuml;r den Anmeldevorgang verwendet wird, wenn kein online-applikationsspezifisches Template hinterlegt wurde. Dieses Standard Template unterst&uuml;tzt Responsive Design und passen sich somit in einem weiten Bereich an die aktuelle Fenstergr&ouml;&szlig;e an.</p>
+<p>F&uuml;r die &Uuml;bermittlung an MOA-ID-Auth ist ein http GET Request vorgesehen welcher folgende Parameter unterst&uuml;tzt. Die URL dieses http GET Request wird automatisiert &uuml;ber den Parameter &bdquo;#AUTH_URL#&ldquo; (ohne &bdquo;&ldquo;) eingetragen und muss nicht manuell hinterlegt werden. Folgende http GET Parameter werden f&uuml;r die BKU-Auswahl akzeptiert.</p>
<table width="1201" border="1">
<tr>
<th width="167" scope="col">Name</th>
@@ -1876,9 +1964,11 @@ Einige dieser Parameter werden jedoch nicht durch den Benutzer oder dem Service
&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type=&quot;submit&quot; value=&quot;&gt;lokale B&uuml;rgerkartenumgebung&quot;&gt;<br>
&lt;/form&gt;
</pre>
-<p>Als Beispiel f&uuml;r ein BKU-Auswahl Template steht auch das bei MOA-ID-Auth hinterlegte Standardtemplate zur Verf&uuml;gung. Dieses finden Sie <a href="../../htmlTemplates/BKU-selection.html">hier</a>.</p>
+<p>Als Beispiel f&uuml;r ein BKU-Auswahl Template steht auch das bei MOA-ID-Auth hinterlegte Standardtemplate zur Verf&uuml;gung. Dieses finden Sie <a href="../../htmlTemplates/BKU-selection.html">hier</a>. </p>
<h3><a name="import_template_sso" id="uebersicht_zentraledatei_aktualisierung7"></a>4.2 Single Sign-On Anmeldeabfrage</h3>
-<p>Das Send-Assertion Template dient im Falle einer Anmeldung mittels Single Sign-On der Abfrage ob die Anmeldedaten an die betreffende Online Applikation &uuml;bertragen werden d&uuml;rfen. &Auml;hnlich dem Template f&uuml;r die B&uuml;rgerkartenauswahl m&uuml;ssen auch hierbei Formvorschriften und Strukturen im Aufbau des Templates eingehalten werden.<br>
+<p>Das Send-Assertion Template dient im Falle einer Anmeldung mittels Single Sign-On der Abfrage ob die Anmeldedaten an die betreffende Online Applikation &uuml;bertragen werden d&uuml;rfen. </p>
+<p><strong>Hinweis:</strong> In der Datei <em>./htmlTemplates/sendAssertionFormFull.html</em> welcher sich relativ zur <a href="#uebersicht_bekanntmachung">MOA-ID-Auth Konfigurationsdatei</a> befindet finden Sie das Standard Template welches f&uuml;r den Anmeldevorgang verwendet wird, wenn kein online-applikationsspezifisches Template hinterlegt wurde. Dieses Standard Template unterst&uuml;tzt Responsive Design und passen sich somit in einem weiten Bereich an die aktuelle Fenstergr&ouml;&szlig;e an.</p>
+<p>&Auml;hnlich dem Template f&uuml;r die B&uuml;rgerkartenauswahl m&uuml;ssen auch hierbei Formvorschriften und Strukturen im Aufbau des Templates eingehalten werden.<br>
F&uuml;r die &Uuml;bermittlung an das Modul MOA-ID-Auth ist ein http POST Request vorgesehen welcher folgende Parameter unterst&uuml;tzt. Die URL, an welche dieser http POST Request gesendet werden muss, wird automatisiert &uuml;ber den Parameter &bdquo;#URL#&ldquo; (ohne &bdquo;&ldquo;) eingetragen und muss nicht manuell hinterlegt werden.</p>
<table width="1201" border="1">
<tr>
@@ -2014,6 +2104,21 @@ Die nachfolgenden Form zeigt ein Beispiel f&uuml;r den Aufbau des im BKU-Auswah
</tr>
</table>
<p>&nbsp;</p>
+<p><strong>Hinweis: </strong>Das in MOA-ID 1.5.1 verwendete Security-Layer Template ist kompatibel zu dem in MOA-ID 2.0 verwendeten Security-Layer Template. Jedoch stehen bei dem Template aus MOA-ID 1.5.1 die zus&auml;tzlichen Parameter zur Konfiguration mittels Konfigurationstool nicht zur Verf&uuml;gung.</p>
+<h1><a name="sp-config" id="sp-config">5 Konfiguration von MOA-SP</a></h1>
+<p>MOA-ID &uuml;berpr&uuml;ft die Signaturen der Personenbindung und des AUTH-Blocks mit dem VerifyXMLSignatureRequest von MOA-SP. Dazu muss MOA-SP wie unten beschreiben konfiguriert werden. <br>
+ <br>
+ <strong verifytransformsinfoprofile"="">VerifyTransformsInfoProfile</strong><br>
+ Der Request zum &uuml;berpr&uuml;fen der Signatur des AUTH-Blocks verwendet ein vordefiniertes VerifyTransformsInfoProfile. Die im Request verwendete Profil-ID wird in der MOA-ID-Auth Konfiguration im Parameter <a href="#konfigurationsparameter_allgemein_moasp">Authentfizierungsblock Transformationen</a> definiert. Entsprechend muss am MOA-SP Server ein VerifyTransformsInfoProfile mit gleichlautender ID definiert werden. Die Profiledefinition selbst ist in der Auslieferung von MOA-ID in $MOA_ID_INST_AUTH/conf/moa-spss/profiles/MOAIDTransformAuthBlockTable_DE_2.0.xml enthalten. Diese Profildefinition muss unver&auml;ndert &uuml;bernommen werden. </p>
+<p id="trustProfile"> <strong>TrustProfile</strong><br>
+Die Requests zur &uuml;berpr&uuml;fung der Signatur verwenden vordefinierte TrustProfile. Die im Request verwendete Profil-IDs werden in der MOA-ID-Auth Konfiguration in den Parametern <a href="#konfigurationsparameter_allgemein_moasp">Personenbindung Trustprofil</a> und <a href="#konfigurationsparameter_allgemein_moasp">Authentfizierungsblock Trustprofil</a> definiert. Diese beiden Elemente k&ouml;nnen unterschiedliche oder identische TrustProfileIDs enthalten. Am MOA-SP Server m&uuml;ssen TrustProfile mit gleichlautender ID definiert werden. Die Auslieferung von MOA-ID enth&auml;lt das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/trustprofiles/MOAIDBuergerkarteRoot, das als TrustProfile verwendet werden kann. Weitere Zertifikate k&ouml;nnen als vertrauensw&uuml;rdig hinzugef&uuml;gt werden. </p>
+<p id="certstore"> <strong>Certstore</strong><br>
+Zum Aufbau eines Zertifikatspfades k&ouml;nnen ben&ouml;tigte Zertifikate aus einem Zertifikatsspeicher verwendet werden. Die Auslieferung von MOA-ID enth&auml;lt das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/certstore, das als initialer Zertifikatsspeicher verwendet werden kann. </p>
+<p>Hinweis: Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues Format f&uuml;r die XML-Konfigurationsdatei. F&uuml;r die Konvertierung einer &auml;lteren Konfigurationsdatei auf das neue Format steht Ihnen ein Tool zur Verf&uuml;gung. Details dazu finden sie in der der Distribution von MOA-SP/SS beiligenden Dokumentation im Kapitel 'Konfiguration', Abschnitt 1.2.1.</p>
+<h1><a name="security" id="security">6 Tomcat Security Manager</a></h1>
+<p>Apache Tomcat bietet die M&ouml;glichkeit den Server unter einem Security Manager zu betreiben. Damit ist es m&ouml;glich den lokalen Dateizugriff zu beschr&auml;nken. Mit Hilfe der Datei "catalina.policy" k&ouml;nnen so Zugriffe auf lokale Dateien und Verzeichnisse festgelegt werden. Eine beispielhafte catalina.policy Datei finden Sie im Verzeichnis $MOA_ID_INST_AUTH/tomcat. Diese Datei wurde unter Apache Tomcat 4.1.31, 5.0.28 und 5.5.27 getestet. </p>
+<p>Mehr Informationen zum Security Manager entnehmen Sie bitte der entsprechenden Apache Tomcat Dokumentation. </p>
+<p>&nbsp;</p>
<h1><a name="referenzierte_spezifikation" id="uebersicht_zentraledatei_aktualisierung30"></a>A Referenzierte Spezifikation</h1>
<table class="fixedWidth" border="1" cellpadding="2">
<tbody>
diff --git a/id/server/doc/handbook/faq/faq.html b/id/server/doc/handbook/faq/faq.html
deleted file mode 100644
index 4e9ff77a3..000000000
--- a/id/server/doc/handbook/faq/faq.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
- <title>MOA SS und SP - FAQ</title>
- <link rel="stylesheet" href="../common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
- <table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="../common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="../common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
- </table>
- <hr/>
- <p class="title"><a href="../index.html">MOA: Serversignatur (SS) und Signaturpr&uuml;fung (SP)</a></p>
- <p class="subtitle">FAQ</p>
- <hr/>
- <h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#allgemeines">Allgemeines</a></p>
- </li>
- <li>
- <p><a href="#uebersicht_fragen">&Uuml;bersicht der Fragen </a></p>
- </li>
- <li>
- <p><a href="#antworten">Antworten</a></p>
- </li>
- </ol>
-<hr/>
- <h1><a name="allgemeines"></a>1 Allgemeines</h1>
- <p> Dieses Dokument enth&auml;lt eine Reihe von h&auml;ufig gestellten Fragen zu Installation, Konfiguration und Verwendung von MOA Serversignatur (SS) und Signaturpr&uuml;fung (SP). </p>
- <h1><a name="uebersicht_fragen" id="uebersicht_fragen"></a>2 &Uuml;bersicht der Fragen </h1>
- <h2> Installation</h2>
- <ol>
- <li>Beim Starten von MOA SPSS tritt folgende Exception auf: <code>java.lang.ClassCastException: iaik.asn1.structures.Name</code>. Was kann der Fehler sein? [<a href="#installation_1">Zur Antwort</a>]</li>
- <li>Ich m&ouml;chte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur &uuml;ber einen Proxy erlaubt. Funktioniert das? [<a href="#installation_1">Zur Antwort</a>] </li>
- </ol>
- <h2>Konfiguration</h2>
- <ol>
- <li>Ich m&ouml;chte gerne die CRL-Archivierung von MOA verwenden, m&ouml;chte aber eine andere als die in der Konfiguration erw&auml;hnte postgreSQL-Datenbank verwenden. Geht das? [<a href="#konfiguration_1">Zur Antwort</a>]</li>
- <li>Ich m&ouml;chte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das? [<a href="#konfiguration_2">Zur Antwort</a>]</li>
- <li>Meine bestehende Konfigurationsdatei funktioniert mit MOA SP/SS 1.3 oder h&ouml;her nicht mehr. Was ist passiert?
- [<a href="#konfiguration_3">Zur Antwort</a>]</li>
- </ol>
- <h2>Verwendung</h2>
- <ol>
- <li>Bei der Pr&uuml;fung einer Signatur liefert die Pr&uuml;fung des Zertifikatsstatus den Code 1. Was kann der Fehler sein? [<a href="#verwendung_1">Zur Antwort</a>] </li>
- </ol>
- <h1><a name="antworten" id="antworten"></a>3 Antworten</h1>
- <h2>Installation</h2>
- <ol>
- <li class="faq"><div class="faq-question"><a name="installation_1"></a>Beim Starten von MOA SPSS tritt folgende Exception auf: <code>java.lang.ClassCastException: iaik.asn1.structures.Name</code>. Was kann der Fehler sein?</div>
- <p>Auf Grund einer mangelhaften Implementierung in einigen Versionen des JDK 1.3.1 kann es beim Betrieb von MOA zu folgendem Problem kommen: Sun macht in der Implementierung von <code>PKCS7.getCertificate()</code> einen Downcast vom Interface<code> java.security.Principal</code> auf die eigene Implementierung, was zu einer <span class="term">ClassCastException</span> f&uuml;hrt, wenn der JCE-Provider von Sun nicht an erster Stelle in der List der Security-Provider installiert ist. MOA geht nun aber so vor, dass der JCE-Provider des IAIK an die erste Stelle installiert wird, wenn er zum Zeitpunkt der Konfiguration noch nicht installiert war. Wird dann von irgendeinem ClassLoader der jar-Verifier ben&uuml;tzt, wird <code>PKCS7.getCertificate()</code> verwendet, und es kommt zu einer <span class="term">ClassCastException</span>. </p>
- <p>Wird MOA &uuml;ber die API-Schnittstelle verwendet, ist ein Workaround die manuelle Installation des IAIK-JCE-Providers nach dem Sun JCE-Provider (etwa an die letzte Stelle), bevor die MOA-Konfiguration aufgerufen wird. Bei Verwendung der Webservices ist die M&ouml;glichkeit der statischen Konfiguration der JCE-Provider mittels Angabe in der Datei <code>$JAVA_HOME/jre/lib/security/java.security</code> der einzige bekannte Workaround. Hierzu m&uuml;ssen die Eintr&auml;ge </p>
- <pre> security.provider.1=sun.security.provider.Sun
- security.provider.2=com.sun.rsajca.Provider </pre>
- <p>durch folgenden Eintrag erg&auml;nzt werden:</p>
- <pre>security.provider.3=iaik.security.provider.IAIK</pre>
- </li>
- <li class="faq">
- <div class="faq-question"><a name="installation_2" id="installation_2"></a>Ich m&ouml;chte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur &uuml;ber einen Proxy erlaubt. Funktioniert das?</div>
- <p>Ja, zumindest f&uuml;r Zugriffe &uuml;ber HTTP. Sie m&uuml;ssen dazu die nachfolgenden JAVA System-Properties setzen:</p>
- <pre>http.proxyHost=&lt;proxyhost&gt;
-http.proxyPort=&lt;proxyport&gt;
-http.nonProxyHosts=&quot;&lt;exceptionhosts&gt;&quot;</pre>
- <p><code>&lt;proxyhost&gt;</code> gibt den Namen oder die IP-Adresse des Proxies an.</p>
- <p><code>&lt;proxyport&gt;</code> gibt den Port des Proxies an.</p>
- <p><code>&lt;exceptionhosts&gt;</code> enth&auml;lt eine Liste von Rechnernamen, die nicht &uuml;ber den Proxy laufen sollen. Jedenfalls m&uuml;ssen sie hier <code>localhost</code> angeben. Einzelne Namen sind durch eine Pipe (<code>|</code>) zu trennen. Bitte beachten Sie, dass IP-Addressen nicht angegeben werden d&uuml;rfen, sowie die verpflichtend zu verwendenen Anf&uuml;hrungszeichen.<br>
- </p>
- </li>
- </ol>
- <h2>Konfiguration</h2>
- <ol>
- <li class="faq"><div class="faq-question"><a name="konfiguration_1" id="konfiguration_1"></a>Ich m&ouml;chte gerne die CRL-Archivierung von MOA verwenden, m&ouml;chte aber eine andere als die in der Konfiguration erw&auml;hnte postgreSQL-Datenbank verwenden. Geht das?</div>
- <p>Ja, das ist m&ouml;glich. Wenn Sie eine mySQL-Datenbank verwenden m&ouml;chten, sind folgende Ma&szlig;nahmen zu treffen:</p>
- <ul>
- <li><a href="http://www.mysql.com/downloads/api-jdbc.html">Laden</a> Sie den mySQL-JDBC-Connector herunter und f&uuml;gen Sie das im Download enthaltene jar-File <code>mysql-connector-java-3.x.x-stable-bin.jar</code> zum Klassenpfad f&uuml;r MOA SPSS hinzu.</li>
- <li>Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters <code>DataBaseArchiveParameter.JDBCUrl</code> eine g&uuml;ltige JDBC-URL zu Ihrer mySQL-Datenbank angeben. Hinweise zum Format dieser URL f&uuml;r mySQL finden Sie <a href="http://www.mysql.com/documentation/connector-j/index.html">hier</a>. </li>
- </ul>
- <p>Wenn Sie eine andere Datenbank verwenden m&ouml;chten, beispielsweise Oracle, gehen Sie sinngem&auml;&szlig; wie oben vor und setzen zus&auml;tzlich noch folgenden Schritt:</p>
- <ul>
- <li>Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters <code>DataBaseArchiveParameter.JDBCDriverClass</code> den vollst&auml;ndig qualifizierten Klassennamen des JDBC-Treibers an, der die Verbindung zu Ihrer Datenbank herstellt. </li>
- </ul>
- </li>
- <li class="faq">
- <div class="faq-question"><a name="konfiguration_2" id="konfiguration_2"></a>Ich m&ouml;chte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das?</div>
- <p>Sie k&ouml;nnen f&uuml;r diesen Zweck ein mit MOA SP/SS mitgeliefertes Kommandozeilen-Tool verwenden, das Sie im Verzeichnis <code>$MOA_SPSS_INST/tools</code> finden. Wechseln Sie zu diesem Verzeichnis und rufen Sie die Script-Datei <code>certtools.bat</code> bzw. <code>certtools.sh</code> (je nach Betriebssystem) auf. Achten Sie darauf, dass die Umgebungsvariable <code>$JAVA_HOME</code> korrekt gesetzt ist. Die Syntax f&uuml;r dieses Tool lautet:</p>
- <pre>certtool -add &lt;cert&gt; &lt;store&gt;</pre>
- <p><code>&lt;cert&gt;</code> bezeichnet dabei Pfad und Dateiname des zu importierenden X509-Zertifikats. Das Zertifikat muss DER-kodiert vorliegen.</p>
- <p><code>&lt;store&gt;</code> bezeichnet den Pfad des internen Zertifikatsspeichers von MOA SP. Wenn Sie nach der Installationsanleitung vorgegangen sind, lautet dieser Pfad <code>$CATALINA_HOME/conf/moa-spss/certstore</code>.</p>
- </li>
- <li class="faq">
- <div class="faq-question"><a name="konfiguration_3" id="konfiguration_3"></a>
- Meine bestehende Konfigurationsdatei
- funktioniert mit MOA SP/SS 1.3 oder h&ouml;her nicht mehr. Was ist passiert?</div>
- <p>Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, &uuml;bersichtlicheres Format f&uuml;r die
- XML-Konfigurationsdatei. </p>
- <p>Wenn Sie von einer &auml;lteren Version von MOA SP/SS auf die Version 1.3 wechseln und Ihre bestehende
- Konfiguration beibehalten wollen, steht Ihnen ein einfaches Kommandozeilenwerkzeug zur Verf&uuml;gung, mit
- dem Sie Ihre Konfigurationsdatei vom bisherigen auf das neue Format migrieren k&ouml;nnen.</p>
- <p>Informationen zur Verwendung des Werkzeugs finden Sie in <a href="../config/config.html#&#252;bersicht_zentraledatei_aktualisierung">Abschnitt 1.2.1</a> des Konfigurationshandbuchs. </p>
- </li>
- </ol>
- <h2>Verwendung</h2>
- <ol>
- <li class="faq"><div class="faq-question"><a name="verwendung_1" id="verwendung_1"></a>Bei der Pr&uuml;fung einer Signatur liefert die Pr&uuml;fung des Zertifikatsstatus den Code 1. Was kann der Fehler sein? </div>
- <p>Dieser Fehlercode bedeutet: Es konnte keine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauensw&uuml;rdigen Wurzelzertifikat konstruiert werden. Das kann grunds&auml;tzlich eine der beiden folgenden Ursachen haben:</p>
- <ul>
- <li>Keines der Zertifikate in der Kette vom Signatorzertifikat bis zu einem selbstsignierten Wurzelzertifikat ist im anzuwendenden <span class="term">TrustProfile</span> enthalten. </li>
- <li>Die Zertifikatskette konnte nicht bis zu einem im anzuwendenden <span class="term">TrustProfile</span> enthaltenen vertrauensw&uuml;rdigen Zertifikat gebildet werden. </li>
- </ul>
- <p>Pr&uuml;fen Sie also zun&auml;chst, ob sie im anzuwendenden <span class="term">TrustProfile</span> ein passendes vertrauensw&uuml;rdiges Zertifikat konfiguriert haben. Das kann beispielsweise das Zertifikat jener CA sein, die das Signatorzertifikat ausgestellt hat, oder aber auch das Zertifikat einer CA weiter oben in der Hierarchie des Zertifizierungsdiensteanbieters, beispielsweise das selbstsignierte Wurzelzertifikat.</p>
- <p>Wenn diese Pr&uuml;fung das Problem nicht behebt, gelingt des MOA SP vermutlich nicht, ein f&uuml;r die Bildung der Zertifikatskette notwendiges Zertifikat zu lokalisieren. M&ouml;gliche Gr&uuml;nde sowie L&ouml;sungsm&ouml;glichkeiten daf&uuml;r sind:</p>
- <ul>
- <li>Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt zwar die Zertifikatserweiterung <span class="term">AuthorityInformationAccess</span> mit einem Hinweis auf das n&auml;chste Zertifikat der zu bildenden Kette, das darin per URL referenzierte Zertifikat kann jedoch nicht geladen werden. Pr&uuml;fen Sie daher zun&auml;chst, ob MOA SP/SS per HTTP oder LDAP Zugriffe nach au&szlig;en t&auml;tigen darf. </li>
- <li>Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt keine Zertifikatserweiterung <span class="term">AuthorityInformationAccess</span> mit einem Hinweis auf das n&auml;chste Zertifikat der zu bildenden Kette, und auch im internen Zertifikatsspeicher von MOA SP ist das n&auml;chste Zertifikat nicht enthalten. Ist Ihnen das n&auml;chste Zertifikat bekannt (z.B. durch manuellen Download von der Webseite des Zertifizierungsdiensteanbieters), k&ouml;nnen Sie es manuell in den internen Zertifikatsspeicher importieren. Eine Anleitung dazu finden Sie <a href="#konfiguration_2">hier</a>. <br>
- </li>
- </ul>
- </li>
- </ol>
-</body>
-</html>
diff --git a/id/server/doc/handbook/index.html b/id/server/doc/handbook/index.html
index 12c598c9d..1a286f11a 100644
--- a/id/server/doc/handbook/index.html
+++ b/id/server/doc/handbook/index.html
@@ -15,7 +15,7 @@
</table>
<hr/>
<p class="title">MOA-ID (Identifikation) </p>
- <p class="subtitle">&Uuml;bersicht zur Dokumentation der Version 2.0 </p>
+ <p class="subtitle">&Uuml;bersicht zur Dokumentation der Version 2.0.0 </p>
<hr/>
<dl>
<dt><a href="./intro/intro.html">Einf&uuml;hrung</a></dt>
@@ -26,8 +26,13 @@
<dd>Erl&auml;uterung aller Konfigurationsoptionen sowie Leitfaden f&uuml;r h&auml;ufige Konfigurationsaufgaben.</dd>
<dt><a href="./protocol/protocol.html">Protokolle</a></dt>
<dd>Erl&auml;uterung der unterst&uuml;tzen Authentifizierungsprotokolle.</dd>
- <dt><a href="./faq/faq.html">FAQ</a></dt>
- <dd>H&auml;ufig gestellte Fragen zu Installation, Konfiguration und Anwendung. </dd>
+ <dt><a href="./application/application.html">Anwendungen</a></dt>
+ <dd>Erl&auml;utert die Integration in bestehende Online-Applikationen und beschreibt die beigelegten Demo Applikationen</dd>
+ <dt><a href="./additional/additional.html">Zusatzinformationen</a></dt>
+ <dd>Spezifiziert allgemeine Funktionen des Modules MOA-ID-Auth</dd>
+ </dl>
+ <dl>
+ <dt>&nbsp;</dt>
</dl>
</body>
</html>
diff --git a/id/server/doc/handbook/install/install.html b/id/server/doc/handbook/install/install.html
index a109fb6a7..9e8e810de 100644
--- a/id/server/doc/handbook/install/install.html
+++ b/id/server/doc/handbook/install/install.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
- <title>MOA SS und SP - Installation</title>
+ <title>MOA-ID - Installation</title>
<link rel="stylesheet" href="../common/MOA.css" type="text/css">
</head>
<<body link="#990000">
@@ -23,7 +23,7 @@
<p><a href="#uebersicht">&Uuml;bersicht</a></p>
</li>
<li>
- <p><a href="#webservice">MOA-ID-Auth</a></p>
+ <p><a href="#webservice">MOA-ID-Auth und MOA-ID-Configuration</a></p>
<ol>
<li><a href="#webservice_basisinstallation">Basisinstallation</a>
<ol>
@@ -84,8 +84,8 @@
<h1><a name="uebersicht" id="uebersicht"></a>1 &Uuml;bersicht</h1>
<p>Die Module MOA-ID-Auth und MOA-ID-Configuration sind als plattformunabh&auml;ngige Module ausgelegt. MOA-ID-Auth bietet Webservices &uuml;ber HTTPS zur Identifizierung und Authentifizierung an. Das Modul MOA-ID-Configuration stellt eine Weboberfl&auml;che zur Konfiguration des MOA-ID-Auth Modules zur Verf&uuml;gung.</p>
<p>Dieses Handbuch beschreibt die Installation der beiden Module.</p>
-<h1><a name="webservice"></a>2 MOA-ID-Auth </h1>
- <p>Dieser Abschnitt beschreibt die Installation von MOA SP/SS als Webservice. Im ersten Unterkapitel wird eine minimale Basisinstallation beschrieben. Das zweite Unterkapitel zeigt eine Reihe von optionalen Erweiterungsm&ouml;glichkeiten auf.</p>
+<h1><a name="webservice"></a>2 MOA-ID-Auth und MOA-ID-Configuration</h1>
+ <p>Dieser Abschnitt beschreibt die Installation von der Module MOA-ID-Auth und MOA-ID-Configuration. Im ersten Unterkapitel wird eine minimale Basisinstallation beschrieben. Das zweite Unterkapitel zeigt eine Reihe von optionalen Erweiterungsm&ouml;glichkeiten auf.</p>
<h2><a name="webservice_basisinstallation" id="webservice_basisinstallation"></a>2.1 Basisinstallation</h2>
<h3><a name="webservice_basisinstallation_einfuehrung" id="webservice_basisinstallation_einfuehrung"></a>2.1.1 Einf&uuml;hrung </h3>
<p> Die Basisinstallation der Module MOA-ID-Auth und MOA-ID-Configuration stellt einerseits die minimalen Anforderungen f&uuml;r den Betrieb von MOA-ID dar, andererseits dient sie als Ausgangspunkt f&uuml;r optionale <a href="#webservice_erweiterungsmoeglichkeiten">Erweiterungsm&ouml;glichkeiten</a>.</p>
@@ -138,15 +138,15 @@
<p> Um die Module MOA-ID-Auth und MOA-ID-Configuratuion in Tomcat f&uuml;r den Einsatz vorzubereiten, sind folgende Schritte notwendig:</p>
<ul>
<li>Die Datei <code>$MOA_ID_AUTH_INST/moa-id_auth.war</code> enth&auml;lt das einsatzfertige MOA-ID-Auth Webarchiv und muss ins Verzeichnis <code>$CATALINA_HOME/webapps</code> kopiert werden. Dort wird sie beim ersten Start von Tomcat automatisch ins Verzeichnis <code>$CATALINA_HOME/webapps/moa-id-auth</code> entpackt. </li>
- <li>Die Konfigurationsdatei mit der Basiskonfiguration f&uuml;r MOA-ID-Auth und die zugeh&ouml;rigen Verzeichnisse m&uuml;ssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. <code>$CATALINA_HOME/conf/moa-id</code>). Eine funktionsf&auml;hige Konfiguration, die als Ausgangspunkt f&uuml;r die Basiskonfiguration des MOA-ID-Auth Modules dienen kann, finden Sie <a href="../../conf/moa-id/moa_id.properties">hier</a>. <br>
+ <li>Die Konfigurationsdatei mit der Basiskonfiguration f&uuml;r MOA-ID-Auth und die zugeh&ouml;rigen Verzeichnisse m&uuml;ssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. <code>$CATALINA_HOME/conf/moa-id</code>). Eine funktionsf&auml;hige Konfiguration, die als Ausgangspunkt f&uuml;r die Basiskonfiguration des MOA-ID-Auth Modules dienen kann, finden Sie <a href="../../../conf/moa-id/moa-id.properties">hier</a>. <br>
</li>
<li> Die Dateien <code>xalan.jar</code>, <code>xercesImpl.jar, serializer.jar </code> und <code>xml-apis.jar</code> aus dem Verzeichnis <code>$MOA_ID_AUTH_INST/endorsed</code> m&uuml;ssen in das Tomcat-Verzeichnis <code>$CATALINA_HOME/endorsed</code> (bzw. <code>$CATALINA_HOME/common/endorsed</code> bis Apache Tomcat Version 5.5) kopiert werden. Sind gleichnamige Dateien dort bereits vorhanden, m&uuml;ssen sie &uuml;berschrieben werden. Die ggf. in diesem Verzeichnis vorhandene Datei <code>xmlParserAPIs.jar</code> muss gel&ouml;scht werden. Sollte das Verzeichnis <code>endorsed</code> nicht vorhanden sein, dann muss dieses zuerst erstellt werden.</li>
<li>Folgende <span class="term">System Properties</span> k&ouml;nnen gesetzt werden (wird beim Starten von Tomcat der <span class="term">Java Virtual Machine</span> in der Umgebungsvariablen <code>CATALINA_OPTS</code> in der Form <code>-D&lt;name&gt;=&lt;wert&gt;</code> &uuml;bergeben):
<ul>
<li id="klein"><code>moa.id.configuration</code>: Pfad und Name der Basiskonfigurationsdatei f&uuml;r MOA-ID-Auth. Eine beispielhafte Konfigurationsdatei fnden Sie <a href="../../../conf/moa-id/moa-id.properties">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
- <li><code>moa.spss.server.configuration</code>: Pfad und Name der zentralen Konfigurationsdatei f&uuml;r MOA SP/SS. Eine beispielhafte Konfigurationsdatei finden Sie <a href="../../../conf/moa-spss/spss.config.xml">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/conf</code> enthaltene Default-Konfiguration herangezogen.</li>
+ <li><code>moa.spss.server.configuration</code>: Pfad und Name der zentralen Konfigurationsdatei f&uuml;r MOA SP/SS. Eine beispielhafte Konfigurationsdatei finden Sie <a href="../../../conf/moa-spss/SampleMOASPSSConfiguration.xml">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/conf</code> enthaltene Default-Konfiguration herangezogen.</li>
<li><code>eu.stork.samlengine.config.location</code>: Pfad auf den Ordner mit den zentralen Konfigurationsdateien f&uuml;r STORK. Die Beispielkonfiguration f&uuml;r das Modul MOA-ID-Auth enth&auml;lt bereits den<a href="../../../conf/moa-id/stork/"> Ordner f&uuml;r die STORK Konfiguration</a>. </li>
- <li id="klein"><code>log4j.configuration</code>: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie <a href="../../../conf/moa-spss/log4j.properties">hier</a>. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/classes</code> enthaltene Default-Konfiguration herangezogen.</li>
+ <li id="klein"><code>log4j.configuration</code>: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie <a href="../../../conf/moa-id/log4j.properties">hier</a>. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/classes</code> enthaltene Default-Konfiguration herangezogen.</li>
<li id="klein"><code>javax.net.ssl.trustStore</code>: Pfad und Dateiname des <span class="term">Truststores</span> f&uuml;r vertrauensw&uuml;rdige SSL Client-Zertifikate (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Ein relativer Pfad werden relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
<li id="klein"><code>javax.net.ssl.trustStorePassword</code>: Passwort f&uuml;r den <span class="term">Truststore</span> (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). </li>
<li id="klein"><code>javax.net.ssl.trustStoreType</code>: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Je nach verwendetem Keystore-Typ muss <code>jks</code> (<span class="term">Java Key Store</span>) oder <code>pkcs12</code> (PKCS#12-Datei) angegeben werden.</li>
@@ -156,13 +156,13 @@
<h5><a name="moa_id_configuration_deploy" id="webservice_basisinstallation_installation_spssdeploy2"></a>2.1.2.4 Einsatz des Moduls MOA-ID-Configuration in Tomcat</h5>
<ul>
<li>Die Datei <code>$MOA_ID_AUTH_INST/moa-id_configuration.war</code> enth&auml;lt das einsatzfertige MOA-ID-Configuration Webarchiv und muss ins Verzeichnis <code>$CATALINA_HOME/webapps</code> kopiert werden. Dort wird sie beim ersten Start von Tomcat automatisch ins Verzeichnis <code>$CATALINA_HOME/webapps/moa-id-configuration</code> entpackt. </li>
- <li>Die Konfigurationsdatei mit der Basiskonfiguration f&uuml;r MOA-ID-Auth und die zugeh&ouml;rigen Verzeichnisse m&uuml;ssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. <code>$CATALINA_HOME/conf/moa-id-configuration</code>). Eine funktionsf&auml;hige Konfiguration, die als Ausgangspunkt f&uuml;r die Basiskonfiguration des MOA-ID-Auth Modules dienen kann, finden Sie <a href="../../conf/moa-id-configuration/moa-id-configtool.properties">hier</a>. <br>
+ <li>Die Konfigurationsdatei mit der Basiskonfiguration f&uuml;r MOA-ID-Auth und die zugeh&ouml;rigen Verzeichnisse m&uuml;ssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. <code>$CATALINA_HOME/conf/moa-id-configuration</code>). Eine funktionsf&auml;hige Konfiguration, die als Ausgangspunkt f&uuml;r die Basiskonfiguration des MOA-ID-Auth Modules dienen kann, finden Sie <a href="../../../conf/moa-id-configuration/moa-id-configtool.properties">hier</a>. <br>
</li>
<li> Die Dateien <code>xalan.jar</code>, <code>xercesImpl.jar, serializer.jar </code> und <code>xml-apis.jar</code> aus dem Verzeichnis <code>$MOA_ID_AUTH_INST/endorsed</code> m&uuml;ssen in das Tomcat-Verzeichnis <code>$CATALINA_HOME/endorsed</code> (bzw. <code>$CATALINA_HOME/common/endorsed</code> bis Apache Tomcat Version 5.5) kopiert werden. Sind gleichnamige Dateien dort bereits vorhanden, m&uuml;ssen sie &uuml;berschrieben werden. Die ggf. in diesem Verzeichnis vorhandene Datei <code>xmlParserAPIs.jar</code> muss gel&ouml;scht werden. Sollte das Verzeichnis <code>endorsed</code> nicht vorhanden sein, dann muss dieses zuerst erstellt werden.</li>
<li>Folgende <span class="term">System Properties</span> k&ouml;nnen gesetzt werden (wird beim Starten von Tomcat der <span class="term">Java Virtual Machine</span> in der Umgebungsvariablen <code>CATALINA_OPTS</code> in der Form <code>-D&lt;name&gt;=&lt;wert&gt;</code> &uuml;bergeben):
<ul>
- <li><code>moa.id.webconfig</code>: Pfad und Name der Basiskonfigurationsdatei f&uuml;r MOA-ID-Configuration. Eine beispielhafte Konfigurationsdatei fnden Sie <a href="../../conf/moa-id-configuration/moa-id-configtool.properties">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
- <li><code>log4j.configuration</code>: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie <a href="../../../conf/moa-spss/log4j.properties">hier</a>. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/classes</code> enthaltene Default-Konfiguration herangezogen.</li>
+ <li><code>moa.id.webconfig</code>: Pfad und Name der Basiskonfigurationsdatei f&uuml;r MOA-ID-Configuration. Eine beispielhafte Konfigurationsdatei fnden Sie <a href="../../../conf/moa-id-configuration/moa-id-configtool.properties">hier</a>. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
+ <li><code>log4j.configuration</code>: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie <a href="../../../conf/moa-id/log4j.properties">hier</a>. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert. Ist diese <span class="term">System Property</span> nicht gesetzt, wird automatisch eine im Webarchiv unter <code>WEB-INF/classes</code> enthaltene Default-Konfiguration herangezogen.</li>
<li><code>javax.net.ssl.trustStore</code>: Pfad und Dateiname des <span class="term">Truststores</span> f&uuml;r vertrauensw&uuml;rdige SSL Client-Zertifikate (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Ein relativer Pfad werden relativ zum Startverzeichnis der <span class="term">Java Virtual Machine</span> interpretiert.</li>
<li><code>javax.net.ssl.trustStorePassword</code>: Passwort f&uuml;r den <span class="term">Truststore</span> (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). </li>
<li><code>javax.net.ssl.trustStoreType</code>: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden soll). Je nach verwendetem Keystore-Typ muss <code>jks</code> (<span class="term">Java Key Store</span>) oder <code>pkcs12</code> (PKCS#12-Datei) angegeben werden.</li>
@@ -190,7 +190,7 @@ gestartet werden. Das Stoppen von Tomcat erfolgt analog mit
<p>Analog bei MOA-ID-Configuration</p>
<pre>INFO at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider - MOA-ID-Configuration initialization completed</pre>
<p>Bei leichten Fehlern in der Konfiguration geben <code>WARN</code> Log-Meldungen unmittelbar davor Aufschluss &uuml;ber fehlerhafte Konfigurations-Eintr&auml;ge.
- Nach dem Starten von Tomcat stehen MOA-ID-Auth und MOA-ID-Configuration zur Verf&uuml;gung. Die Einsprungpunkte der unterschiedlichen Authentifizierungsprotokolle von MOA-ID-Auth werden im Abschnitt <a href="./protocol/protocol.html">Protokolle</a> im Detail beschrieben.</p>
+ Nach dem Starten von Tomcat stehen MOA-ID-Auth und MOA-ID-Configuration zur Verf&uuml;gung. Die Einsprungpunkte der unterschiedlichen Authentifizierungsprotokolle von MOA-ID-Auth werden im Abschnitt <a href="../protocol/protocol.html">Protokolle</a> im Detail beschrieben.</p>
<pre>
http://&lt;host&gt;:&lt;port&gt;/moa-id-auth/
http://&lt;host&gt;:&lt;port&gt;/moa-id-configuration/</pre>
diff --git a/id/server/doc/handbook/intro/anmeldeablauf.png b/id/server/doc/handbook/intro/anmeldeablauf.png
index e7d1ea042..a6af21c5f 100644
--- a/id/server/doc/handbook/intro/anmeldeablauf.png
+++ b/id/server/doc/handbook/intro/anmeldeablauf.png
Binary files differ
diff --git a/id/server/doc/handbook/intro/intro.html b/id/server/doc/handbook/intro/intro.html
index b992d9bc6..ffa3c37a4 100644
--- a/id/server/doc/handbook/intro/intro.html
+++ b/id/server/doc/handbook/intro/intro.html
@@ -19,8 +19,16 @@
<hr/>
<h1>Inhalt</h1>
<ol>
- <li><a href="#allgemeines">Allgemeines</a></li>
- <li><a href="#ss">MOA-ID-Auth </a></li>
+ <li><a href="#allgemeines">Allgemeines</a>
+ <ol>
+ <li><a href="#allgemeines_service">Externe Services</a></li>
+ </ol>
+ </li>
+ <li><a href="#ss">MOA-ID-Auth </a>
+ <ol>
+ <li><a href="#ablauf">Ablauf einer Anmeldung</a></li>
+ </ol>
+ </li>
<li><a href="#sp">MOA-ID-Configuration</a></li>
</ol>
<hr/>
@@ -41,17 +49,17 @@
<li><u>Configuration</u><u> Modul</u>: Dieses Modul stellt die Schnittstelle zur MOA-ID-Auth Konfiguration dar welche in einer Datenbank abgelegt wird. </li>
<li><u>Konfigurationstool</u>: Oberfl&auml;che, mit deren Hilfe MOA-ID konfiguriert werden kann. Dies umfasst sowohl allgemeine Konfigurationsteile als auch die Konfiguration der einzelnen bei MOA-ID-Auth registrierten Online-Applikationen. Service Provider k&ouml;nnen sich am Konfigurationstool mittels B&uuml;rgerkarte oder Handy-Signatur anmelden und ihre Online-Applikationen verwalten.</li>
</ol>
- <h2>1.1 Externe Services</h2>
- <p>F&uuml;r die Anmeldung in Vertretung und die Anmeldung ausl&auml;ndischer Personen werden zus&auml;tzliche externe Services verwendet.</p>
- <h3>1.1.1 Online-Vollmachten</h3>
- <p>Ab der MOA-ID Release 1.5.0 werden Online-Vollmachten (f&uuml;r Anwendungen aus dem &ouml;ffentlichen Bereich) unterst&uuml;tzt. Hierzu werden diese Vollmachten &uuml;ber eine Online-Vollmachten-Service ausgew&auml;hlt. Der Zugang zu diesem Online-Vollmachten Service ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
- <h3>1.1.2 Ausl&auml;ndische B&uuml;rger</h3>
+ <h2><a name="allgemeines_service" id="allgemeines_service"></a>1.1 Externe Services</h2>
+<p>F&uuml;r die Anmeldung in Vertretung und die Anmeldung ausl&auml;ndischer Personen werden zus&auml;tzliche externe Services verwendet.</p>
+ <h3><a name="allgemeines_service_ovs" id="allgemeines_service2"></a>1.1.1 Online-Vollmachten</h3>
+<p>Ab der MOA-ID Release 1.5.0 werden Online-Vollmachten (f&uuml;r Anwendungen aus dem &ouml;ffentlichen Bereich) unterst&uuml;tzt. Hierzu werden diese Vollmachten &uuml;ber eine Online-Vollmachten-Service ausgew&auml;hlt. Der Zugang zu diesem Online-Vollmachten Service ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
+ <h3><a name="allgemeines_service_szrgw" id="allgemeines_service3"></a>1.1.2 Ausl&auml;ndische B&uuml;rger</h3>
<p> Ab der MOA-ID Release 1.4.7 ist es m&ouml;glich, dass sich auch ausl&auml;ndische B&uuml;rger mittels MOA-ID einloggen k&ouml;nnen. Hierzu wird eine Verbindung zu einem sogenannten Stammzahlenregister-Gateway aufgebaut, dass basierend auf den Zertifikatsdaten des ausl&auml;ndischen B&uuml;rgers eine Eintragung im Erg&auml;nzungsregister f&uuml;r nat&uuml;rliche Personen gem&auml;&szlig; E-Government Gesetz &sect;6(5) vornimmt. Somit ist es m&ouml;glich, dass eine Personenbindung ausgestellt werden kann, die in weitere Folge an MOA-ID weitergeleitet wird. Der Zugang zu diesem Stammzahlenregister-Gateway ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
-<h1><a name="ss"></a>2 MOA-ID-Auth</h1>
+<h1><a name="moaidauth" id="moaidauth"></a>2 MOA-ID-Auth</h1>
<p>Das Modul MOA-ID-Auth dient der Identifizierung und Authentifizierung im Rahmen eines Anmeldevorgangs an einer Online-Applikation. Die Identifizierung und Authentifizierung erfolgt mit B&uuml;rgerkartem, Handy-Signatur oder f&uuml;r aus&auml;ndische Personen mittels STORK.</p>
<p>Die Funktionalit&auml;t und der Aufbau der Schnittstellen des Modules MOA-ID-Auth in Richtung Online-Applikation wird im Kapitel <a href="../protocol/protocol.html">Protokolle</a> beschriebe.
<p>F&uuml;r den Betrieb von MOA-ID-Auth ist der Einsatz von MOA-Signaturpr&uuml;fung (MOA-SP) erforderlich.</p>
-<h2>2.1 Ablauf einer Anmeldung</h2>
+<h2><a name="ablauf" id="ablauf"></a> 2.1 Ablauf einer Anmeldung</h2>
<p>Die nachfolgende Grafik beschreibt den Ablauf eines Abmeldevorgangs an einer Online-Applikation mit Hilfe von MOA-ID-Auth unter Verwendung der B&uuml;rgerkarte oder der Handy-Signatur.</p>
<p><img src="anmeldeablauf.png" width="947" height="881" alt="Sequenzdiagramm eines Anmeldevorgangs mit MOA-ID-Auth"></p>
<p>&nbsp;</p>
@@ -81,7 +89,7 @@
<li> MOA-ID-Auth sendet die Anmeldedaten an den Service-Provider und setzt im Browser des Benutzers ein SSO Session-Tokken welches f&uuml;r weitere Anmeldevorg&auml;nge verwendet werden kann.</li>
<li>Die Anmeldedaten werden vom Service-Provider verarbeitet und der Benutzer wird vom Service-Provider an die Online-Applikation weitergeleitet. </li>
</ol>
-<h1><a name="sp"></a>3 MOA-ID-Configuration </h1>
+<h1><a name="config" id="config"></a>3 MOA-ID-Configuration </h1>
<p>Das Modul MOA-ID-Configuration stellt eine web-basierte Benutzerschnittstelle zur Konfiguration des Moduls MOA-ID-Auth zur Verf&uuml;gung, wobei sich die Konfiguration in zwei Teilbereiche unterteilt ist. Eine detailierte Aufstellung der einzelnen Konfigurationspunkte befindet sich im Kapitel <a href="../config/config.html">Konfiguration</a>.</p>
<ol>
<li>Allgemeine Konfiguration<br>
diff --git a/id/server/doc/handbook/protocol/Assertion.xml b/id/server/doc/handbook/protocol/Assertion.xml
index 6be5c7384..b6db5f088 100644
--- a/id/server/doc/handbook/protocol/Assertion.xml
+++ b/id/server/doc/handbook/protocol/Assertion.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://demo.egiz.gv.at/demoportal_demologin/securearea.action" InResponseTo="_2e6529184b536ad98be7e8a23058276b" IssueInstant="2014-03-04T13:52:14.026Z" Version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://demo.egiz.gv.at/demoportal_demologin/securearea.action" InResponseTo="_aeebfae3ce681fe3ddcaf213a42f01d3" IssueInstant="2014-03-05T06:39:51.017Z" Version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://demo.egiz.gv.at/demoportal_moaid-2.0</saml2:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
@@ -13,10 +13,10 @@
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
- <ds:DigestValue>kvUKbjEOo7lVsclpkgHFkkbJ5bErwG/bu6KzGoJzLZs=</ds:DigestValue>
+ <ds:DigestValue>fCE31ZeXZybQLOuNQBePLjFrCtKdvCmeyJ1tUW/ghtA=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
- <ds:SignatureValue>bNS+LN4YNeqKR05F+Y9YbRkPEJ87rhEK+Prk3pEnMBZT8VKWwP/ki4TdrupkFX3YjJvINXk2NFJxcB5GEbHxJjnpF8+K4gH2cPRyzDdS72mlO70mKg9Aa2chP/35c9kyGaHfzrw7Y4MzKjrkXfl76ekdL8UzHFYVFE4oUwtJXvrsg78RZNcy4aCuUvzsJbYwfriAjT7Cp93F5aum6oJ6kXk8XSHmh+yVzFSzYL+WkbIV+x7OOXVnoAWSY5d3tPGlr2LhjTf53q0pn+cggJ6jPfAVmwuxJTwe2C7xPlkylsQkswORMwXovGr+KqrcOpimxgeukvlJD+7YUHsi8uJMvg==</ds:SignatureValue>
+ <ds:SignatureValue>vUFR3YPk5wiBJnrLh6Er7V46FNDMuB5Jcu73Rw7tipgr+bnV0reRNcZ5TGT+VMjNhtKJMcqgjrQWJ6tACe1r0mzhpRSVQkw7yFkTvIhQHX1a08yqJ4yy3qiN13ctDo4VgP9qHUim7b797oOKNhRXFk+2GJA5hRcpRliUjhBlzTYrxpkY5NcYDRhDPlvMx+l11oa1iDGuAylN+ty4h3P4fIoIgL9Tz1m3l65LqkV5RBc6avSeHw9OASMigPsjd5b0IBvhvJ611xLgzC1BOtJshiw1k/p8alv8TaUmYZ/kJbRN1tuTBL129edbS0Rz0faT0tniF42QHteJ214brK3rCg==</ds:SignatureValue>
<ds:KeyInfo>
<ds:KeyValue>
<ds:RSAKeyValue>
@@ -33,20 +33,20 @@ nibdIyU5+AmfFzDaMwNocJEANoXrjLTpduCHvT0Qt/wH+7rVdgjX1djMrBhyMWs7GQyIBRfuf58m
<saml2p:Status>
<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</saml2p:Status>
- <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_35f651bf2b8f06249ef55ca244584a6a" IssueInstant="2014-03-04T13:52:14.026Z" Version="2.0">
+ <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_602c3236bffaf71ac3ac88674e76ff9f" IssueInstant="2014-03-05T06:39:51.017Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://demo.egiz.gv.at/demoportal_moaid-2.0</saml2:Issuer>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" NameQualifier="urn:publicid:gv.at:cdid+BF">QVGm48cqcM4UcyhDTNGYmVdrIoY=</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
- <saml2:SubjectConfirmationData InResponseTo="_2e6529184b536ad98be7e8a23058276b" NotOnOrAfter="2014-03-04T13:57:14.026Z" Recipient="https://demo.egiz.gv.at/demoportal_demologin/securearea.action"/>
+ <saml2:SubjectConfirmationData InResponseTo="_aeebfae3ce681fe3ddcaf213a42f01d3" NotOnOrAfter="2014-03-05T06:44:51.017Z" Recipient="https://demo.egiz.gv.at/demoportal_demologin/securearea.action"/>
</saml2:SubjectConfirmation>
</saml2:Subject>
- <saml2:Conditions NotBefore="2014-03-04T13:52:14.026Z" NotOnOrAfter="2014-03-04T13:57:14.026Z">
+ <saml2:Conditions NotBefore="2014-03-05T06:39:51.017Z" NotOnOrAfter="2014-03-05T06:44:51.017Z">
<saml2:AudienceRestriction>
<saml2:Audience>https://demo.egiz.gv.at/demoportal_demologin/</saml2:Audience>
</saml2:AudienceRestriction>
</saml2:Conditions>
- <saml2:AuthnStatement AuthnInstant="2014-03-04T13:52:14.026Z" SessionIndex="_3d750604d315cc40a9cce50f7bdb43d7">
+ <saml2:AuthnStatement AuthnInstant="2014-03-05T06:39:51.017Z" SessionIndex="_c0c683509a8ff6ac372a9cf9c5c5a406">
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>http://www.stork.gov.eu/1.0/citizenQAALevel/4</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
diff --git a/id/server/doc/handbook/protocol/AuthRequest.xml b/id/server/doc/handbook/protocol/AuthRequest.xml
index 9a5c5f481..f9de11c4c 100644
--- a/id/server/doc/handbook/protocol/AuthRequest.xml
+++ b/id/server/doc/handbook/protocol/AuthRequest.xml
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceIndex="1" AttributeConsumingServiceIndex="0" Destination="https://demo.egiz.gv.at/demoportal_moaid-2.0/pvp2/post" ID="_5760e287e5e06dda027d3c59812a2aba" IssueInstant="2014-03-04T13:20:00.861Z" Version="2.0">
+<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceIndex="1" AttributeConsumingServiceIndex="0" Destination="https://demo.egiz.gv.at/demoportal_moaid-2.0/pvp2/post" ID="_aeebfae3ce681fe3ddcaf213a42f01d3" IssueInstant="2014-03-05T06:39:02.775Z" Version="2.0">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://demo.egiz.gv.at/demoportal_demologin/</saml2:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
- <ds:Reference URI="#_5760e287e5e06dda027d3c59812a2aba">
+ <ds:Reference URI="#_aeebfae3ce681fe3ddcaf213a42f01d3">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
- <ds:DigestValue>6azvvz1bk4wlcEoCEq3DgwYE/FU=</ds:DigestValue>
+ <ds:DigestValue>sBVJQf9b+QIxRfH8YuTbF6hBrf4=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
- <ds:SignatureValue>J+en/LY0okRfEW9KEX4sj6TydwHFrtY4PbS1wDvdpAr9v6qY4+PvKHIhfTY/D/DBMJq/bVMJj+y+LgXzyHbLitqEvJkgYeFBrfFLu/6I7zuqucHbip4YAd63Vrg6f5buxrY0S4uJniRGtEhkZDcGJ0Y9Bu3obWXMk7oK/tHtsrvejd27bQOzdZv1ESWiBorlTVPzkfvS13jNsIyeWOuQ/Zv0FKn9RenqvbIVWnG3xKiSEcKT4VaosDdvZX35wxEYh3Rk84ZySDdp502vCvpOjSkc64s6ZiqZcmwwpSNb3+uMwvUNF+gH7mAYs1FXit9/UaGyL30qXgEc+TUZd2o/iA==</ds:SignatureValue>
+ <ds:SignatureValue>JK68H5XqmD2OEA8O/UCZFenVj0TrvauPhaKJt73pbHbi//hO1hBcRQbV2Qg3gQ11EcJ9Q+TM3TCe9nT6tdU/z7ry3qdZvlOfrkMF13fY4HOIuvB9AcySdxq2yKA3V5O9sLhf5S9qCyx9lMnTARC7wkVs4j2Pv00R6P/iROOHD5ryGF2J0FdtMp9VqhvQJ9yRGM2lTduF98MqxWA2EMk6AMo7qij0Bvha1B2OyFSU9HM3fyfRQpXDeiLnKHcjLpzu5TDNkKrP75c7vv85DDr7s2I0p74nAOVLMuLau5tEQ91Crk9QoqoqqEecKWcNJDXTO9MahCQw77hUDL1WOEMFFg==</ds:SignatureValue>
<ds:KeyInfo>
<ds:KeyValue>
<ds:RSAKeyValue>
diff --git a/id/server/doc/handbook/protocol/idp_metadata.xml b/id/server/doc/handbook/protocol/idp_metadata.xml
index ff8a2cdf1..2d2990917 100644
--- a/id/server/doc/handbook/protocol/idp_metadata.xml
+++ b/id/server/doc/handbook/protocol/idp_metadata.xml
@@ -1,34 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor ID="_b8d2c4cbb05444174815ce5f407e56d4" Name="MOA-ID 2.0 Demo IDP (Version: 1.9.98-SNAPSHOT)" validUntil="2014-03-05T11:49:47.300Z">
+<md:EntitiesDescriptor ID="_8e844196b97a91dc47f59577edc2d2b7" Name="MOA-ID 2.0 Demo IDP (Version: 2.0-RC3)" validUntil="2014-03-26T11:34:06.707Z">
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
- <ds:Reference URI="#_b8d2c4cbb05444174815ce5f407e56d4">
+ <ds:Reference URI="#_8e844196b97a91dc47f59577edc2d2b7">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
- <ds:DigestValue>TDy0AH/6p/9B1XhpoisAD3Rwx3fzQt75+tD+rvmA1ro=</ds:DigestValue>
+ <ds:DigestValue>YPy6KJGNTbmKTzmLbQ3wsDhGgz8ktuUjud19b9xoHe0=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
- <ds:SignatureValue>QC+UmPuj/8cmpjyDtprXMz7bEZ3a5bJQT4QgJ3bkZ5sHfNR5u3NvYLdZbWwrzKiruDPdItYghTnXIv3fULBjR8j/51nOjgHQPzk8oz9MeJVFtH99AxLYwkYRk2bl1ZiPc5gZJOoyf0uF5nO+F9oJFV0CD91QVEBAKmnlGpED4s53EVojKFrXxbQUNEmNrHXq0o+iIIZnKUb+PDDjqr/IZoDmTYswsld7tv5+PZT6MyQADVHYfuU6DjY98vFCAFeBDyw7BY8dplFuUzqzvQ2AEF3vY+1lF2Xet6in9pjly3OZq+9greFkpcTZoyIBql+jS6qjf5WD51CjTm76xWQsRg==</ds:SignatureValue>
+ <ds:SignatureValue>Zg4iaALZ/pNrthme8PaH5iiWZQ+ay30oC14RJab99im9atRDd6tb5RGmmuKY0KXpxetHUnBp5yA8I2Oh+tUuaq4Vbhewq1k9TytZmo83KMJbWBwtPWhbgET/i40CcngDiKPZLSt793WJ/LJpFtj/YidJaq2Z4k5Mj4RUr/SBMdH2HN+fZio/K9uyGy7hOLWKIU9zrSj1sOeMvqwyT6vD8h2s2qWV4TZai2PMxUSMgqqmJS3be2yoI68+5JHX3lgdQ9xRfhasxk//hK/rx39UiljIKxRRUpq1V2TGimK6YYNKrimzzVznCoB25h1+NMF8vQvwSRj085MAQkeQ14gedw==</ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIEFTCCAv2gAwIBAgIJAI/HXXgQpJtFMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNVBAYTAkFUMRMw
+EQYDVQQIEwpTb21lLVN0YXRlMQ0wCwYDVQQHEwRHcmF6MQ0wCwYDVQQKEwRFR0laMSIwIAYDVQQD
+ExlNT0EtSUQgSURQIChUZXN0LVZlcnNpb24pMB4XDTE0MDEyMTA4NDAxOFoXDTE1MDEyMTA4NDAx
+OFowZDELMAkGA1UEBhMCQVQxEzARBgNVBAgTClNvbWUtU3RhdGUxDTALBgNVBAcTBEdyYXoxDTAL
+BgNVBAoTBEVHSVoxIjAgBgNVBAMTGU1PQS1JRCBJRFAgKFRlc3QtVmVyc2lvbikwggEiMA0GCSqG
+SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFETzd0nLV2P4pUGnlLKj3V+MZ4bUyYkNK5NnkzB0PO8hm
+tsrdg+HSNsnPiU5KvD26tFpxq9lfibZcAp9JHFqjA/capOHcTDhYkTvJcSdaKJzttTPy4wivTbRu
+y+ocK9jjz6g8BFvP9wQ5/k2AwFaqj0SeJt0jJTn4CZ8XMNozA2hwkQA2heuMtOl24Ie9PRC3/Af7
+utV2CNfV2MysGHIxazsZDIgFF+5/nybyR1yiIxKb0BYDh3gbNdyH5uLVBHOP4hvzQN5Z1xc/cdzq
+lzKn/4v6HJraNn00xLzK6nrG6gB6HvDok2l8T1Cc7f8I+sNlO2aM8rY4hGSGCfhiL6IFAgMBAAGj
+gckwgcYwHQYDVR0OBBYEFKG3LzuPtAGCXUPTw3fo9dtsS9wWMIGWBgNVHSMEgY4wgYuAFKG3LzuP
+tAGCXUPTw3fo9dtsS9wWoWikZjBkMQswCQYDVQQGEwJBVDETMBEGA1UECBMKU29tZS1TdGF0ZTEN
+MAsGA1UEBxMER3JhejENMAsGA1UEChMERUdJWjEiMCAGA1UEAxMZTU9BLUlEIElEUCAoVGVzdC1W
+ZXJzaW9uKYIJAI/HXXgQpJtFMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAME3wzEi
+UAcF2pCDtMMJzX4IDhSkWNuvWtSMMy8Vgtcc2t570teIKh+qNKQWZyX3QFVE6ovDABg3ZUhn780l
+G4/t6aMOUEeGg4udl7l0QRBRbdd+9oc0Aw5dQqku02AQ6wQd695PLj+F0GeA7cdef90aLPu6Rwa5
+z5BiKpReJZoul3NpjQXz7A1IslZOlIhEDcFUlBSn/+QfLOeNDKurvPT0OzUGSGfrv0AoniNHc/fz
+lfyRmgFbzAVHedU5cIxcE0yHtEKFjFSVwtGng9rTJpoOoY4pvGvAHlw6GEgO+HwFukPDtnvY8vi/
+cfmNJhb06H+6mmHz929Bk4HuHoQj8X8=</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
</ds:Signature>
- <md:EntityDescriptor entityID="https://demo.egiz.gv.at/demoportal_moaid-2.0" validUntil="2014-03-28T11:49:47.300Z">
+ <md:EntityDescriptor entityID="https://demo.egiz.gv.at/demoportal_moaid-2.0" validUntil="2014-04-18T10:34:06.707Z">
<md:IDPSSODescriptor WantAuthnRequestsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<ds:KeyInfo>
- <ds:KeyValue>
- <ds:RSAKeyValue>
- <ds:Modulus>xRE83dJy1dj+KVBp5Syo91fjGeG1MmJDSuTZ5MwdDzvIZrbK3YPh0jbJz4lOSrw9urRacavZX4m2
-XAKfSRxaowP3GqTh3Ew4WJE7yXEnWiic7bUz8uMIr020bsvqHCvY48+oPARbz/cEOf5NgMBWqo9E
-nibdIyU5+AmfFzDaMwNocJEANoXrjLTpduCHvT0Qt/wH+7rVdgjX1djMrBhyMWs7GQyIBRfuf58m
-8kdcoiMSm9AWA4d4GzXch+bi1QRzj+Ib80DeWdcXP3Hc6pcyp/+L+hya2jZ9NMS8yup6xuoAeh7w
-6JNpfE9QnO3/CPrDZTtmjPK2OIRkhgn4Yi+iBQ==</ds:Modulus>
- <ds:Exponent>AQAB</ds:Exponent>
- </ds:RSAKeyValue>
- </ds:KeyValue>
<ds:X509Data>
<ds:X509Certificate>MIIEFTCCAv2gAwIBAgIJAI/HXXgQpJtFMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNVBAYTAkFUMRMw
EQYDVQQIEwpTb21lLVN0YXRlMQ0wCwYDVQQHEwRHcmF6MQ0wCwYDVQQKEwRFR0laMSIwIAYDVQQD
@@ -111,6 +123,7 @@ cfmNJhb06H+6mmHz929Bk4HuHoQj8X8=</ds:X509Certificate>
<md:GivenName>Lenz</md:GivenName>
<md:SurName>Thomas</md:SurName>
<md:EmailAddress>thomas.lenz@egiz.gv.at</md:EmailAddress>
+ <md:TelephoneNumber>+43 316 873 5525</md:TelephoneNumber>
</md:ContactPerson>
</md:EntityDescriptor>
</md:EntitiesDescriptor>
diff --git a/id/server/doc/handbook/protocol/protocol.html b/id/server/doc/handbook/protocol/protocol.html
index f75888f22..5055a4325 100644
--- a/id/server/doc/handbook/protocol/protocol.html
+++ b/id/server/doc/handbook/protocol/protocol.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
- <title>MOA-ID - Einf&uuml;hrung</title>
+ <title>MOA-ID - Protokolle</title>
<link rel="stylesheet" href="../common/MOA.css" type="text/css">
</head>
<body link="#990000">
@@ -17,23 +17,61 @@
<p class="title"><a href="../index.html">MOA-ID (Identifikation) </a></p>
<p class="subtitle">Protokolle</p>
<hr/>
- <h1>Inhalt</h1>
+<h1>Inhalt</h1>
<ol>
- <li><a href="#allgemeines">Allgemeines</a></li>
- <li><a href="#pvp21">PVP 2.1 </a></li>
- <li><a href="#openid">OpenID Connect</a></li>
- <li><a href="#saml1">SAML 1</a></li>
- </ol>
- <ol type="A">
+ <li><a href="#allgemeines">Allgemeines</a>
+ <ol>
+ <li><a href="#allgemeines_zugangspunkte">&Uuml;bersicht der Zugangspunkte</a></li>
+ <li><a href="#allgemeines_attribute">&Uuml;bersicht der m&ouml;glichen Attribute</a></li>
+ <li><a href="#allgemeines_sso">Single Sign-On</a></li>
+ <li><a href="#allgemeines_ssologout">SSO Logout </a></li>
+ <li><a href="#allgemeines_legacy">Legacy Request (B&uuml;rgerkartenauswahl beim Service Provider)</a></li>
+ </ol>
+ </li>
+ <li><a href="#pvp21">PVP 2.1 </a>
+ <ol>
+ <li><a href="#pvp21_sequenz">Ablauf einer Anmeldung mittels PVP 2.1</a></li>
+ <li><a href="#pvp21_metadata">Metadaten</a></li>
+ <li><a href="#pvp21_binding">Zugangspunkte</a>
+<ol>
+ <li><a href="#2.3.1 Authentifizierungsrequest">Authentifizierungsrequest</a></li>
+ <li><a href="#pvp21_binding_response">Authentifizierungsrespon</a></li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li><a href="#openid">OpenID Connect</a>
+ <ol>
+ <li><a href="#openid_sequenzdiagramm">Ablauf einer Anmeldung mittels OpenID Connect</a></li>
+ <li><a href="#openid_interface">Zugangspunkte</a></li>
+ <li><a href="#openid_requests">Beschreibung der Nachrichten</a>
+<ol>
+ <li><a href="#openid_req_authnreq">AuthCode Request</a></li>
+ <li><a href="#openid_req_authnresp">AuthCode Response</a></li>
+ <li><a href="#openid_req_tokenreq">AccessToken Request</a></li>
+ <li><a href="#openid_req_tokenresp">AccessToken Response</a></li>
+ </ol>
+</li>
+ </ol>
+ </li>
+ <li><a href="#saml1">SAML 1</a>
+ <ol>
+ <li><a href="#saml1_sequence">Ablauf einer Anmeldung mittels SAML 1</a></li>
+ <li><a href="#saml1_zugang">Zugangspunkte</a></li>
+ <li><a href="#saml1_startauth">StartAuthentication Request</a></li>
+ <li><a href="#saml1_getassertion">GetAuthenticationData Request</a></li>
+ </ol>
+ </li>
+
<li><a href="#referenzierte_spezifikation">Referenzierte Spezifikation</a></li>
- </ol>
+</ol>
<hr/>
<h1><a name="allgemeines"></a>1 Allgemeines</h1>
<p>Dieses Kapitel behandelt jene Authentifizierungsprotokolle die vom Modul MOA-ID-Auth unterstützt werden.
Wobei die Verwendung der Protokolle PVP 2.1 oder OpenID Connect empfohlen wird. Das Protokoll SAML 1, welches bis zur MOA-ID Version 1.5.1
verwendet wurde, wird jedoch ab der Version 2.0 nur mehr aus Kompatibilitätsgründen angeboten und nicht mehr aktiv weiterentwickelt.</p>
- <h2><a name="allgemeines_zugangspunkte" id="allgemeines_zugangspunkte"></a>1.1 &Uuml;bersicht der Zugangspunkte</h2>
- <p>In diesem Abschnitt sind die Zugangspunkte der vom Modul MOA-ID-Auth unterst&uuml;tzten Protokolle kurz zusammengefasst. Eine detailierte Beschreibung der einzelnen Protokolle finden Sie in den anschlie&szlig;enden Unterkapiteln. </p>
+<h2><a name="allgemeines_zugangspunkte" id="allgemeines_zugangspunkte"></a>1.1 &Uuml;bersicht der Zugangspunkte</h2>
+<p>In diesem Abschnitt sind die Zugangspunkte der vom Modul MOA-ID-Auth unterst&uuml;tzten Protokolle kurz zusammengefasst. Eine detaillierte Beschreibung der einzelnen Protokolle finden Sie in den anschlie&szlig;enden Unterkapiteln. </p>
<table width="1247" border="1">
<tr>
<th width="164" scope="col">Protokoll</th>
@@ -79,57 +117,64 @@ Redirect Binding</td>
<td><p>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/services/GetAuthenticationData</p>
<p>http://&lt;host&gt;:&lt;port&gt;/moa-id-auth/services/GetAuthenticationData</p></td>
</tr>
+ <tr>
+ <td><a href="#allgemeines_ssologout">SSO Logout</a></td>
+ <td>LogOut</td>
+ <td><p>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/LogOut</p>
+ <p>http://&lt;host&gt;:&lt;port&gt;/moa-id-auth/LogOut</p></td>
+ </tr>
</table>
<h2><a name="allgemeines_attribute" id="allgemeines_zugangspunkte2"></a>1.2 &Uuml;bersicht der m&ouml;glichen Attribute</h2>
- <p>Die nachfolgende Tabelle beinhaltet eine Liste aller Attribute die vom Modul MOA-ID-Auth an die Online-Applikation zur&uuml;ckgeliefert werden k&ouml;nnen, sofern diese nach der Authentifizierung zur Verf&uuml;gung stehen. Alle Namen beziehen sich auf den Attributnamen im jeweiligen Protokoll. Detailinformationen zu den einzelnen Attributen finden Sie in der <a href="#referenzierte_spezifikation">PVP 2.1 Spezifikation</a> der der <a href="#referenzierte_spezifikation">STORK Spezifikation</a>.</p>
- <table width="1247" border="1">
+<p>Die nachfolgende Tabelle beinhaltet eine Liste aller Attribute die vom Modul MOA-ID-Auth an die Online-Applikation zur&uuml;ckgeliefert werden k&ouml;nnen, sofern diese nach der Authentifizierung zur Verf&uuml;gung stehen. Alle Namen beziehen sich auf den Attributnamen im jeweiligen Protokoll. Detailinformationen zu den einzelnen Attributen finden Sie in der <a href="#referenzierte_spezifikation">PVP 2.1 Spezifikation</a> der der <a href="#referenzierte_spezifikation">STORK Spezifikation</a>.</p>
+<table width="1247" border="1">
<tr>
<th colspan="4" align="center" valign="middle" scope="col">Protokolle</th>
- <th width="518" rowspan="3" scope="col">Beschreibung</th>
+ <th width="429" rowspan="3" scope="col">Beschreibung</th>
</tr>
<tr>
- <th width="254" rowspan="2" scope="col">PVP 2.1</th>
+ <th width="208" rowspan="2" scope="col">PVP 2.1</th>
<th colspan="2" scope="col">OpenID Connect</th>
- <th width="219" rowspan="2" scope="col">SAML 1</th>
+ <th width="335" rowspan="2" scope="col">SAML 1</th>
</tr>
<tr>
- <th width="169" scope="col">Name</th>
+ <th width="188" scope="col">Name</th>
<th width="53" scope="col">Profil</th>
</tr>
<tr>
<td>urn:oid:1.2.40.0.10.2.1.1.149</td>
<td>BPK</td>
<td align="center">eID</td>
- <td>&nbsp;</td>
+ <td><p>/saml:Assertion/saml:AttributeStatement/</p>
+ <p>saml:Subject/saml:NameIdentifier</p></td>
<td><p>Bereichsspezifisches Personenkennzeichen (bPK / wbPK)</p>
- <p><strong>Hinweis:</strong> Der Syntax f&uuml;r dieses Attribut ist <em>bPK-value := (BEREICH &quot;:&quot; bPK)</em> wobei unter <em>Bereich</em> der &ouml;ffentliche Bereich (Target) der Online-Applikation oder die Stammzahl des Auftraggebers bei Anwendungs-verantwortlichen aus der Privatwirtschaft angegeben wird.</p></td>
+ <p><strong>Hinweis:</strong> Der Syntax f&uuml;r dieses Attribut bei den Protokollen PVP 2.1 und OpenID Connect ist <em>bPK-value := (BEREICH &quot;:&quot; bPK/wbPK)</em> wobei unter <em>Bereich</em> der &ouml;ffentliche Bereich (Target) der Online-Applikation oder die Stammzahl des Auftraggebers bei Anwendungs-verantwortlichen aus der Privatwirtschaft angegeben wird.</p></td>
</tr>
<tr>
<td><p>urn:oid:2.5.4.42</p></td>
<td>given_name</td>
<td align="center">profile</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;PersonData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Vorname</td>
</tr>
<tr>
<td><p>urn:oid:1.2.40.0.10.2.1.1.261.20</p></td>
<td>family_name</td>
<td align="center">profile</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;PersonData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Familienname</td>
</tr>
<tr>
<td>urn:oid:1.2.40.0.10.2.1.1.55</td>
<td>birthdate</td>
<td align="center">profile</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;PersonData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Geburtsdatum im Format JJJJ-MM-TT</td>
</tr>
<tr>
<td>urn:oid:1.2.40.0.10.2.1.1.261.64</td>
<td>EID-CCS-URL</td>
<td align="center">eID</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;bkuURL&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/moa/20020822#&quot;&gt;</td>
<td>URL auf die B&uuml;rgerkartenumgebung die f&uuml;r die Authentifizierung verwendet wurde. Im Falle einer Anmeldung mittels STORK steht dieses Attribut NICHT zur Verf&uuml;gung.</td>
</tr>
<tr>
@@ -157,21 +202,23 @@ Redirect Binding</td>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.62</td>
<td>EID-AUTH-BLOCK</td>
<td align="center">eID</td>
- <td>&nbsp;</td>
+ <td><p>/saml:Assertion/saml:AttributeStatement/</p>
+ <p>saml:Subject/saml:SubjectConfirmation/</p>
+ <p>saml:SubjectConfirmationData</p></td>
<td>Base64 kodierte Signatur die w&auml;hrend des Authentifizierungsdaten vom Benutzer erzeugt wurde.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.66</td>
<td>EID-SIGNER-CERTIFICATE</td>
<td align="center">eID</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;SignerCertificate&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/moa/20020822#&quot;&gt;</td>
<td>Base64 kodiertes Zertifikat, dass f&uuml;r die Anmeldung verwendet wurde.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.36</td>
<td>EID-SOURCE-PIN</td>
<td align="center">eID_gov</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;PersonData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td><p>Stammzahl der nat&uuml;rlichen Person</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur zur Verf&uuml;gung wenn die Online-Applikation alle <a href="../config/config.html#konfigurationsparameter_oa_general_public">Anforderungen an eine Applikation aus dem &ouml;ffentlichen Bereich</a> erf&uuml;llt.</p></td>
</tr>
@@ -179,7 +226,7 @@ Redirect Binding</td>
<td height="23">urn:oid: 1.2.40.0.10.2.1.1.261.104</td>
<td>EID-SOURCE-PIN-TYPE</td>
<td align="center">eID_gov</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;PersonData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td><p>Bereich der Stammzahl, wobei aktuell nur ein Bereich existiert.</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur zur Verf&uuml;gung wenn die Online-Applikation alle <a href="../config/config.html#konfigurationsparameter_oa_general_public">Anforderungen an eine Applikation aus dem &ouml;ffentlichen Bereich</a> erf&uuml;llt.</p></td>
</tr>
@@ -187,7 +234,9 @@ Redirect Binding</td>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.38</td>
<td>EID-IDENTITY-LINK</td>
<td align="center">eID_gov</td>
- <td>&nbsp;</td>
+ <td><p>/saml:Assertion/saml:AttributeStatement/</p>
+ <p>saml:Subject/saml:SubjectConfirmation/</p>
+ <p>saml:SubjectConfirmationData</p></td>
<td><p>Gesamte Personenbindung in BASE64 kodiert.</p>
<p><strong>Hinweis:</strong> Im Falle einer privatwirtschaftlichen Applikation ist die Stammzahl durch die wbPK ersetzt.</p></td>
</tr>
@@ -195,98 +244,98 @@ Redirect Binding</td>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.68</td>
<td>MANDATE-TYPE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;RepresentationType&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/mandates/20040701#&quot;&gt;</td>
<td>Bezeichnung des verwendeten Vollmachten-Profils.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.102</td>
<td>MANDATOR-NATURAL-PERSON-SOURCE-PIN-TYPE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Bereich der Stammzahl der vertretenen nat&uuml;rlichen Person, wobei aktuell nur ein Bereich existiert.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.70</td>
<td>MANDATOR-NATURAL-PERSON-SOURCE-PIN</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Stammzahl der nat&uuml;rlichen Person, f&uuml;r die Vollmachts- bzw. Vertretungsbe-fugnisse ausge&uuml;bt werden.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.76</td>
<td>MANDATOR-LEGAL-PERSON-SOURCE-PIN-TYPE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Gibt an, um welche Art der Stammzahl einer vertretenen juristischen Person es sich handelt.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.100</td>
<td>MANDATOR-LEGAL-PERSON-SOURCE-PIN</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Stammzahl der juristischen Person, f&uuml;r die Vollmachts- bzw. Vertretungsbe-fugnisse ausge&uuml;bt werden.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.98</td>
<td>MANDATOR-NATURAL-PERSON-BPK</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Bereichsspezifisches Personenkennzeichen des Vollmachtgebers</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.78</td>
<td>MANDATOR-NATURAL-PERSON-GIVEN-NAME</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Vorname(n) der nat&uuml;rlichen Person, die die Vollmacht erteilt hat, bzw. die vertreten wird.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.80</td>
<td>MANDATOR-NATURAL-PERSON-FAMILY-NAME</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Nachname der Person, die die Vollmacht erteilt hat, bzw. die vertreten wird.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.82</td>
<td>MANDATOR-NATURAL-PERSON-BIRTHDATE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Geburtsdatum der Person, die die Vollmacht erteilt hat, bzw. die vertreten wird im Format JJJJ-MM-TT</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.84</td>
<td>MANDATOR-LEGAL-PERSON-FULL-NAME</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Name der juristischen Person bzw. Personenmehrheit gem&auml;&szlig; zugrundelie-gendem Register.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.86</td>
<td>MANDATE-PROF-REP-OID</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Object Identifiern (OID) zur Kennzeichnung von berufsm&auml;&szlig;igen ParteienvertreterInnen bzw. OrganwalterInnen.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.88</td>
<td>MANDATE-PROF-REP-DESCRIPTION</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;MandateData&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/persondata/20020228#&quot;&gt;</td>
<td>Textuelle Beschreibung der Eigenschaft als berufsm&auml;&szlig;iger ParteienvertreterIn.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.90</td>
<td>MANDATE-REFERENCE-VALUE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;mandateReferenceValue&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/moa/20020822#&quot;&gt;</td>
<td>Die im Rahmen einer elektronischen Vollmachtserstellung generierte Transaktionsnummer.</td>
</tr>
<tr>
<td height="23">urn:oid:1.2.40.0.10.2.1.1.261.92</td>
<td>MANDATE-FULL-MANDATE</td>
<td align="center">mandate</td>
- <td>&nbsp;</td>
+ <td>&lt;saml:Attribute AttributeName=&quot;Mandate&quot; AttributeNamespace=&quot;http://reference.e-government.gv.at/namespace/mandates/20040701#&quot;&gt;</td>
<td>Base64 kodierte Vollmacht im XML Format gem&auml;&szlig; Vollmachten-Spezifikation.</td>
</tr>
<tr>
@@ -301,7 +350,8 @@ Redirect Binding</td>
inheritedFamilyName</td>
<td>inheritedFamilyName</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ inheritedFamilyName</td>
<td><p>Vererbter Familienname</p>
<strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</td>
</tr>
@@ -310,7 +360,8 @@ Redirect Binding</td>
adoptedFamilyName</td>
<td>adoptedFamilyName</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ adoptedFamilyName</td>
<td><p>Angenommener Familienname</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -319,7 +370,8 @@ Redirect Binding</td>
gender</td>
<td>gender</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ gender</td>
<td><p>Geschlecht</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -328,7 +380,8 @@ Redirect Binding</td>
countryCodeOfBirth</td>
<td>countryCodeOfBirth</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ countryCodeOfBirth</td>
<td><p>Geburtsland</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -337,7 +390,8 @@ Redirect Binding</td>
nationalityCode</td>
<td>nationalityCode</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ nationalityCode</td>
<td><p>Nationalit&auml;t</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -346,7 +400,8 @@ Redirect Binding</td>
maritalStatus</td>
<td>maritalStatus</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ maritalStatus</td>
<td><p>Familienstand</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -355,7 +410,8 @@ Redirect Binding</td>
textResidenceAddress</td>
<td>textResidenceAddress</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ textResidenceAddress</td>
<td><p>Wohnadresse in Textform</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -364,7 +420,8 @@ Redirect Binding</td>
canonicalResidenceAddress</td>
<td>canonicalResidenceAddress</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ canonicalResidenceAddress</td>
<td><p>Anerkannte Wohnadresse</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -373,7 +430,8 @@ Redirect Binding</td>
title</td>
<td>title</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ title</td>
<td><p>Titel</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -382,7 +440,8 @@ Redirect Binding</td>
residencePermit</td>
<td>residencePermit</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ residencePermit</td>
<td><p>Aufenthaltsbewilligung</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -391,7 +450,8 @@ Redirect Binding</td>
pseudonym</td>
<td>pseudonym</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ pseudonym</td>
<td><p>Pseudonym</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -400,7 +460,8 @@ Redirect Binding</td>
age</td>
<td>age</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ age</td>
<td><p>Alter</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -409,7 +470,8 @@ Redirect Binding</td>
isAgeOver</td>
<td>isAgeOver</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ isAgeOver</td>
<td><p>Mindestalter erreicht</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
@@ -418,19 +480,130 @@ Redirect Binding</td>
fiscalNumber</td>
<td>fiscalNumber</td>
<td align="center">stork</td>
- <td>&nbsp;</td>
+ <td>http://www.stork.gov.eu/1.0/<br>
+ fiscalNumber</td>
<td><p>Steuernummer</p>
<p><strong>Hinweis:</strong> Dieses Attribut steht nur bei einer Anmeldung mittels STORK zur Verf&uuml;gung.</p></td>
</tr>
</table>
- <p>&nbsp;</p>
-
+<h2><a name="allgemeines_sso" id="allgemeines_zugangspunkte3"></a>1.3 Single Sign-On</h2>
+<p>Das Modul MOA-ID-Auth unterst&uuml;tzt ab der Version 2.0 Single Sign-On (SSO), wobei diese Funktionalit&auml;t unabh&auml;ngig vom verwendeten Protokoll ist. Bei Verwendung von SSO muss sich der Benutzer nur ein Mal bei MOA-ID-Auth authentifizieren und danach steht die authentifizierte Session f&uuml;r die BenutzerIn oder den Benutzer f&uuml;r weitere Anmeldevorg&auml;nge ohne weitere Authentifizierung mittels B&uuml;rgerkarte, Handy-Signatur oder STORK zur Verf&uuml;gung. Die SSO Session kann danach durch <a href="#allgemeines_ssologout">die BenutzerIn oder den Benutzer beendet</a> werden, oder sie wird von MOA-ID-Auth nach der <a href="./../config/config.html#konfigurationsparameter_allgemein_timeouts">maximal erlaubten Sessionzeit</a> serverseitig beendet. </p>
+<p>Das nachfolgende Sequenzdiagramm zeigt eine Anmeldung mittels Single Sign-On an zwei Online-Applikationen unter Verwendung von PVP 2.1. Aus Gr&uuml;nden der &Uuml;bersichtlichkeit wurden die Teile welche die Kommunikation mit der B&uuml;rgerkartenumgebung, die Vollmachten-Auswahl oder den Metadatenaustausch betreffen bewusst nicht ber&uuml;cksichtigt.</p>
+<p><img src="sso_sequence.png" width="1095" height="978" alt="Sequenzdiagramm einer Anmeldung mittels Single Sign-On"></p>
+<ol>
+ <li>Die BenutzerIn oder der Benutzer verbindet sich zu einem Web-Portal (Service Provider 1) &uuml;ber das die Online-Applikation 1 erreichbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang ausgel&ouml;st.</li>
+ <li>Der Service Provider 1 generiert einen Authentifizierungsrequest und sendet diesen &uuml;ber den Browser an das Modul MOA-ID-Auth.</li>
+ <li>MOA-ID-Auth leitet die BenutzerIn oder den Benutzer zur B&uuml;rgerkartenauswahl.
+ <ol>
+ <li>Die BenutzerIn oder der Benutzer Authentifiziert sich mit der gew&auml;hlten Methode.</li>
+ </ol>
+ </li>
+ <li>War die Authentifizierung der BenutzerIn oder des Benutzers erfolgreich generiert MOA-ID-Auth die Assertion mit den Anmeldedaten des Benutzers f&uuml;r die Online-Applikation 1.</li>
+ <li>MOA-ID-Auth senden die Assertion und ein SSO Token an den Browser des Benutzers, wobei das SSO Token (http Cookie) im Browser des Benutzers gespeichert wird.</li>
+ <li>Die Assertion (ohne SSO Token!) wird an den Service Provider 1 weitergeleitet.</li>
+ <li>Ist die Validierung der Assertion erfolgreich wird die BenutzerIn oder der Benutzer an der Online-Applikation 1 angemeldet. </li>
+ <li>Die BenutzerIn oder der Benutzer verbindet sich zu einem weiteren Web-Portal (Service Provider 2) &uuml;ber das die Online-Applikation 2 erreichbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang f&uuml;r die Online-Applikation 2 ausgel&ouml;st.</li>
+ <li>Der Service Provider 2 generiert einen Authentifizierungsrequest und sendet diesen &uuml;ber den Browser.</li>
+ <li>Der Browser sendet den Authentifizierungsrequest und das gespeicherte SSO Token an das Modul MOA-ID-Auth.</li>
+ <li>MOA-ID-Auth validiert das SSO Token. Hierbei wird gepr&uuml;ft ob das Token zu einer aktiven SSO Session geh&ouml;rt und ob das Token bereits verwendet wurde. Jedes vergebene SSO Token ist nur f&uuml;r einen weiteren Anmeldevorgang g&uuml;ltig und wird anschlie&szlig;end durch ein neues ersetzt. Ist das Token abgelaufen oder wurde es bereits verwendet wird die korrespondierende SSO Session beendet und die BenutzerIn oder der Benutzer m&uuml;ssen sich erneut Authentifizieren.</li>
+ <li>Bei einem g&uuml;ltigen SSO Token antwortet MOA-ID-Auth mit einem <a href="./../config/config.html#konfigurationsparameter_oa_sso">Abfrage zum SSO Anmeldevorgang</a>, welche der BenutzerIn oder dem Benutzer im Browser dargestellt wird. Diese Abfrage beinhaltet den Namen der Online-Applikation 2 und eine einfache JA / NEIN Abfrage ob die Anmeldung mittels SSO an der Online-Applikation 2 fortgesetzt werden soll.<br>
+ <strong>Hinweis:</strong> Diese Abfrage kann jedoch f&uuml;r Online-Applikationen deaktiviert werden. N&auml;heres hierzu finden Sie <a href="./../config/config.html#import_template_sso">hier</a>.</li>
+ <li>Die Antwort der BenutzerIn oder dem Benutzer wird an MOA-ID-Auth &uuml;bermittelt. Antwort die BenutzerIn oder der Benutzer mit NEIN wird der Anmeldevorgang abgebrochen.</li>
+ <li>Soll der Anmeldevorgang vorgesetzt werden generiert MOA-ID-Auth die Assertion mit den Anmeldedaten des Benutzers f&uuml;r die Online-Applikation 2.</li>
+ <li>MOA-ID-Auth senden die Assertion und ein neues SSO Token an den Browser des Benutzers, wobei das SSO Token (http Cookie) im Browser des Benutzers gespeichert wird.</li>
+ <li>Die Assertion (ohne SSO Token!) wird an den Service Provider 2 weitergeleitet.</li>
+ <li>Ist die Validierung der Assertion erfolgreich wird die BenutzerIn oder der Benutzer an der Online-Applikation 2 angemeldet</li>
+</ol>
+<p>Zus&auml;tzliche Informationen zur Konfiguration und die sich daraus ergebenden Anforderungen oder Einschr&auml;nkungen finden sie <a href="./../config/config.html#konfigurationsparameter_allgemein_sso">hier</a>.</p>
+<h2><a name="allgemeines_ssologout" id="allgemeines_zugangspunkte5"></a>1.4 SSO Logout </h2>
+ <p>Das Modul MOA-ID-Auth stellt ein einfaches Service zur Beendigung einer bestehenden Single Sign-On Session zur Verf&uuml;gung. Nach dem Aufruf dieses Service aus dem Browser des Users wird eine bestehende SSO Session beendet und anschlie&szlig;end wird die BenutzerIn oder der Benutzer an eine im LogOut Request angegebene URL weitergeleitet. </p>
+ <p>Das SSO Logout Service steht unter folgender URL zur Verf&uuml;gung und ben&ouml;tigt einen http GET Parameter:</p>
+<pre>http://&lt;host&gt;:&lt;port&gt;/moa-id-auth/LogOut
+ </pre>
+ <p>bzw. </p>
+<pre>
+https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/LogOut
+ </pre>
+<table width="1247" border="1">
+ <tr>
+ <th width="115" scope="col">Name</th>
+ <th width="262" scope="col">Beispielwert</th>
+ <th width="848" scope="col">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>redirect</td>
+ <td>https://demo.egiz.gv.at/demoportal-openID_demo</td>
+ <td><p>Nach Beendigung des Logout Vorgangs erfolgt ein Redirect auf die in diesem Parameter angegebene URL. Wird kein Parameter angegeben wird der Benutzer an die MOA-ID-Auth Instanz weitergeleitet.<br>
+ <br>
+ <strong>Hinweis:</strong>Wird eine URL angeben muss diese als Prefix identisch mit dem <a href="./../config/config.html#konfigurationsparameter_oa_general">eindeutigen Identifier der jeweiligen Online-Applikation</a> sein, </p></td>
+ </tr>
+</table>
+<p>&nbsp;</p>
+<p>Nachstehend ein Beispiel zur Verwendung dieses Services:s</p>
+<pre>https://demo.egiz.gv.at/moa-id-auth/LogOut?redirect=https://demo.egiz.gv.at/demoportal-openID_demo
+</pre>
+<p><strong>Hinweis:</strong> Dieses Service bietet jedoch NICHT eine vollst&auml;ndige Single Log-Out Funktionalit&auml;t wie sie im SAML 2 Protokoll vorgesehen ist, sondern beendet ausschlie&szlig;lich die SSO Session in der MOA-ID-Auth Instanz.</p>
+<h2><a name="allgemeines_legacy" id="allgemeines_zugangspunkte4"></a>1.5 Legacy Request (B&uuml;rgerkartenauswahl beim Service Provider)</h2>
+<p>Soll die B&uuml;rgerkartenauswahl jedoch weiterhin, wie aus MOA-ID 1.5.1 bekannt direkt in der Online-Applikation des Service Providers erfolgen muss f&uuml;r das jeweilige Protokoll der <a href="./../config/config.html#konfigurationsparameter_allgemein_protocol_legacy">Legacy Modus aktiviert</a> werden. Wird der Legacy Modus verwendet muss jedoch zus&auml;tzlich zu den protokollspezifischen Parametern mindestens der Parameter <em>bkuURI</em>, welcher die gew&auml;hlte B&uuml;rgerkartenumgebung enth&auml;lt, im Authentifizierungsrequest an MOA-ID-Auth &uuml;bergeben werden (siehe <a href="#saml1_startauth">Protokoll SAML 1</a>). Die folgenden Parameter stehen bei Verwendung des Legacy Modus unabh&auml;ngig vom verwendeten Protokoll zur Verf&uuml;gung und bilden den gesamten Umfang der B&uuml;rgerkartenauswahl, wie aus MOA-ID 1.5.1 bekannt, ab.</p>
+<table border="1" width="1247">
+ <tbody>
+ <tr>
+ <th scope="col" width="170">Name</th>
+ <th scope="col" width="221">Beispielwert</th>
+ <th scope="col" width="834">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>bkuURI=&lt;bku-url&gt;</td>
+ <td>https://127.0.0.1:3496/https-security-layer-request</td>
+ <td><p>URL auf die B&uuml;rgerkartenumgebung, welche f&uuml;r die Authentifizierung der BenutzerIn oder des Benutzers verwendet werden soll. F&uuml;r den Anmeldevorgang sind jedoch nur jene URLs auf B&uuml;rgerkartenumgebungen erlaubt die auch in der <a href="./../config/config.html#konfigurationsparameter_oa_bku">online-applikationsspezifischen Konfiguration als zu verwendente BKUs</a> eingetragen sind.</p>
+ <p><strong>Hinweis:</strong> Wird dieser Parameter nicht &uuml;bertragen, antwortet das Modul MOA-ID-Auth mit einem bei MOA-ID-Auth hinterlegten <a href="./../config/config.html#import_template_bku">B&uuml;rgerkartentemplate</a>.</p></td>
+ </tr>
+ <tr>
+ <td>Template=&lt;template-url&gt;</td>
+ <td>https://demo.egiz.gv.at/moa-id-auth/template_onlineBKU.html</td>
+ <td><strong>Optional:</strong> URL auf die HTML Vorlage f&uuml;r den Security-Layer Request, welcher f&uuml;r die Kommunikation mit der B&uuml;rgerkartenumgebumg verwendet wird. Die URL muss in der online-applikationsspezifischen Konfiguration von MOA-ID-Auth hinterlegt werden (<a href="file:///D:/Projekte/svn/moa-id/moa-idspss/id/server/doc/handbook/config/config.html#konfigurationsparameter_oa_bku">siehe Parameter <em>SecurityLayerTemplates</em></a>).<br>
+ Ist dieser Parameter nicht vorhanden, verwendet MOA-ID-Auth das f&uuml;r diese Online-Applikation hinterlegten Security-Layer Template (<a href="file:///D:/Projekte/svn/moa-id/moa-idspss/id/server/doc/handbook/config/config.html#konfigurationsparameter_oa_bku">siehe Parameter <em>SecurityLayerTemplates</em></a>).</td>
+ </tr>
+ <tr>
+ <td>useMandate=&lt;true/false&gt;</td>
+ <td>true / false</td>
+ <td><strong>Optional:</strong> Gibt an ob eine Anmeldung im Online-Vollmachten-Modus durchgef&uuml;hrt werden soll (=true) oder nicht (=false);</td>
+ </tr>
+ <tr>
+ <td>CCC=&lt;ccc&gt;</td>
+ <td>BE, SI, </td>
+ <td><strong>Optional:</strong> Gibt an ob die Anmeldung mittels STORK im angegebenen Land erfolgen soll. Die Angabe erfolgt mit dem L&auml;ndercode (Bsp: PT, LU, ES, ...) des jeweiligen Landes.</td>
+ </tr>
+ </tbody>
+</table>
+<p>&nbsp;</p>
+<p><strong>Hinweis:</strong> Bei einer vollst&auml;ndigen Neukonfiguration ist der Legacy Modus standardm&auml;&szlig;ig f&uuml;r alle Protokolle deaktiviert.</p>
+<p><strong>Hinweis:</strong> Bei der Verwendung des Legacy Request f&uuml;r die B&uuml;rgerkartenauswahl ist jedoch zu beachten dass im Falle einer aktiven Single Sign-On Session, MOA-ID-Auth mit einer Abfrage zum SSO Anmeldevorgang antwortet.</p>
<h1><a name="pvp21"></a>2 PVP 2.1</h1>
<p>Die PVP 2.1 Implementierung des Modules MOA-ID-Auth bezieht sich auf das <a href="#referenzierte_spezifikation">S-Profil der PVP 2 Spezifikation</a>. Das S - Profil von PVP 2 verwendet SAML WebSSO f&uuml;r die Authentifizierung von Benutzern mit Webbrowser. Dadurch wird die direkte Kommunikation des Browsers mit der Anwendung erm&ouml;glicht, was in Anwendungsf&auml;llen notwendig ist, wo Anwendungen nicht kompatibel mit dem Reverse - Proxy - Verfahren sind, datenschutzrechtliche Probleme bestehen oder SAML WebSSO als Industriestandard unterst&uuml;tzt werden soll.</p>
<p>Bevor PVP 2.1 als Authentifizierungsprotokoll verwendet werden kann muss das Modul MOA-ID-Auth entsprechend konfiguriert werden. Detailinformationen zur Konfiguration finden Sie <a href="../config/config.html">hier</a>.</p>
<h2><a name="pvp21_sequenz" id="pvp21_sequenz"></a>2.1 Ablauf einer Anmeldung mittels PVP 2.1</h2>
-<p>Die nachfolgende Abbildung zeigt das Sequenzdiagramm eines Anmeldevorgangs mittels PVP 2.1 und des Modules MOA-ID-Auth als Identityprovider. Aus Gr&uuml;nden der &Uuml;bersichtlichkeit wurden die Teile welche die Kommunikation mit der B&uuml;rgerkartenumgebung oder die Vollmachten-Auswahl betreffen bewusst nicht ber&uuml;cksichtigt.</p>
-<p>&nbsp;</p>
+<p>Die nachfolgende Abbildung zeigt das Sequenzdiagramm eines Anmeldevorgangs mittels PVP 2.1 und des Modules MOA-ID-Auth als Identity Provider. Aus Gr&uuml;nden der &Uuml;bersichtlichkeit wurden die Teile welche die Kommunikation mit der B&uuml;rgerkartenumgebung oder die Vollmachten-Auswahl betreffen bewusst nicht ber&uuml;cksichtigt.</p>
+<p><img src="pvp21_sequence.png" width="968" height="687" alt="Sequenzdiagramm PVP 2.1"></p>
+<ol>
+ <li>Der Benutzer verbindet sich zu einem Web-Portal (Service Provider) &uuml;ber das die Online-Applikation erreichbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang ausgel&ouml;st.</li>
+ <li>Der Service Provider holt die Metadaten des Identity Providers am Modul MOA-ID-Auth ab und validiert die Signatur der Metadaten mit dem am Service Provider hinterlegten Zertifikat. Ist die Validierung erfolgt wird der Anmeldevorgang fortgesetzt.</li>
+ <li>Der Service Provider extrahiert Informationen aus den Metadaten und generiert einen Authentifizierungsrequest und sendet diesen &uuml;ber den Browser an das Modul MOA-ID-Auth.</li>
+ <li>MOA-ID Auth holt die Metadaten des Service Providers und validiert die Signatur der Metadaten mit dem in der MOA-ID-Auth Konfiguration f&uuml;r diesen Service Provider (Online-Applikation) hinterlegten Zertifikat. Ist die Validierung erfolgreich wird der Anmeldevorgang vorgesetzt.</li>
+ <li>MOA-ID-Auth validiert den Authentifizierungsrequest mit den Informationen aus dem Metadaten des Service Providers. Ist die Validierung erfolgreich wird der Anmeldevorgang vorgesetzt.</li>
+ <li>MOA-ID-Auth leitet die BenutzerIn oder den Benutzer zur B&uuml;rgerkartenauswahl.
+ <ol>
+ <li>Die BenutzerIn oder der Benutzer Authentifiziert sich mit der gew&auml;hlten Methode.</li>
+ </ol>
+ </li>
+ <li>War die Authentifizierung der BenutzerIn oder des Benutzers erfolgreich generiert MOA-ID-Auth die Assertion mit den Anmeldedaten des Benutzers.</li>
+ <li>MOA-ID-Auth senden die Assertion &uuml;ber den Browser an den Service Provider.</li>
+ <li>Der Service Provider validiert die Assertion mit den Informationen aus den Metadaten des Modules MOA-ID-Auth.
+ <ol>
+ <li>Ist die Validierung erfolgreich wird die BenutzerIn oder der Benutzer an der Online-Applikation angemeldet.</li>
+ </ol>
+ </li>
+</ol>
<h2><a name="pvp21_metadata" id="pvp21_metadata"></a>2.2 Metadaten</h2>
<p>Das Modul MOA-ID-Auth stellt f&uuml;r Service-Provider (Online-Applikationen) Metadaten bereit welche alle PVP 2.1 spezifischen Informationen der MOA-ID-Auth Instanz beinhalten. Diese Metadaten werden durch das Modul MOA-ID-Auth signiert, wodurch Service Provider die Authentizit&auml;t der Metadaten verifizieren k&ouml;nnen. Ein Beispiel f&uuml;r Metadaten von MOA-ID-Auth finden sie <a href="#idp_metadata.xml">hier</a>. Die aktuellen Metadaten zu Ihrer MOA-ID-Auth Instanz k&ouml;nnen unter folgender URL abgerufen werden.</p>
<pre>http://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
@@ -442,14 +615,14 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
<p>Wollen Sie f&uuml;r Ihre Online-Applikation PVP 2.1 als Authentifizierungsprotokoll nutzen m&uuml;ssen f&uuml;r jede Online-Applikation Metadaten erstellt und durch den Service Provider signiert werden. Zus&auml;tzlich muss die URL auf die Metadaten und das entsprechende Signaturzertifikat zur Pr&uuml;fung der Signatur in der online-applikationsspezifischen <a href="../config/config.html#konfigurationsparameter_oa_protocol_pvp21">PVP 2.1 Konfiguration</a> von MOA-ID-Auth hinterlegt sein. Ein Beispiel f&uuml;r online-applikationsspezifische Metadaten finden Sie <a href="serviceprovider_metadata.xml">hier</a>.</p>
<p>Die nachfolgenden Anforderungen an die online-applikationsspezifischen Metadaten .</p>
<ul>
- <li>Das XML Attribut <code>entityID</code> im Element <code>md:EntitiesDescriptor/md:EntityDescriptor</code> (siehe <a href="#serviceprovider_metadata.xml">Beispiel</a>) den <a href="../config/config.html#konfigurationsparameter_oa_general">eindeutigen Identifier</a> enth&auml;lt der f&uuml;r diese Online-Applikation bei MOA-ID-Auth hinterlegt ist. </li>
- <li>Die Metadaten m&uuml;ssen ein Zertifikat zur Pr&uuml;fung der Signatur am Authentifizierungsrequest beinhalten. Hierf&uuml;r muss das XML Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:KeyDescriptor</code> mit dem Attribut <code>use=&quot;signing&quot;</code> vorhanden sein (siehe <a href="#serviceprovider_metadata.xml">Beispiel</a>).</li>
+ <li>Das XML Attribut <code>entityID</code> im Element <code>md:EntitiesDescriptor/md:EntityDescriptor</code> (siehe <a href="./serviceprovider_metadata.xml">Beispiel</a>) den <a href="../config/config.html#konfigurationsparameter_oa_general">eindeutigen Identifier</a> enth&auml;lt der f&uuml;r diese Online-Applikation bei MOA-ID-Auth hinterlegt ist. </li>
+ <li>Die Metadaten m&uuml;ssen ein Zertifikat zur Pr&uuml;fung der Signatur am Authentifizierungsrequest beinhalten. Hierf&uuml;r muss das XML Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:KeyDescriptor</code> mit dem Attribut <code>use=&quot;signing&quot;</code> vorhanden sein (siehe <a href="./serviceprovider_metadata.xml">Beispiel</a>).</li>
<li>Die Metadaten m&uuml;ssen mindestens ein XML Element<br>
<code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:AssertionConsumerService</code> enthalten welches das gew&uuml;nschte Binding und die URL zur Auslieferung der Assertion beinhaltet. </li>
<li>Werden zus&auml;tzlich zum bereichsspezifischen Personenkennzeichen (bPK / wbPK) weitere <a href="#allgemeines_attribute">Attribute</a> durch den Service Provider ben&ouml;tigt m&uuml;ssen diese &uuml;ber die Metadaten angefordert werden. <br>
- Hierf&uuml;r steht das Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:AttributeConsumingService</code> zur Verf&uuml;gung wobie die als Kindelemente <code>md:RequestedAttribute </code>die einzelnen ben&ouml;tigten Attribute definieren (siehe <a href="#serviceprovider_metadata.xml">Beispiel</a>).</li>
+ Hierf&uuml;r steht das Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:AttributeConsumingService</code> zur Verf&uuml;gung wobei die als Kindelemente <code>md:RequestedAttribute </code>die einzelnen ben&ouml;tigten Attribute definieren (siehe <a href="./serviceprovider_metadata.xml">Beispiel</a>).</li>
</ul>
-<p>Zus&auml;tzlich unterst&uuml;tzt das Modul MOA-ID-Auth auch die Verschl&uuml;sselung PVP 2.1 Assertion mit einem vom Service-Provider definierten Zertifikat. Um diese Funktion zu nutzen muss in den Metadaten ein zweites XML Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:KeyDescriptor</code> mit dem Attribut <code>use=&quot;encryption&quot;</code> vorhanden sein (siehe <a href="#serviceprovider_metadata.xml">Beispiel</a>). In diesem Fall verwendet das Modul MOA-ID-Auth, dass in diesem Element hinterlegte Zertifikat zur Verschl&uuml;sselung der PVP 2.1 Assertion.</p>
+<p>Zus&auml;tzlich unterst&uuml;tzt das Modul MOA-ID-Auth auch die Verschl&uuml;sselung PVP 2.1 Assertion mit einem vom Service-Provider definierten Zertifikat. Um diese Funktion zu nutzen muss in den Metadaten ein zweites XML Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:KeyDescriptor</code> mit dem Attribut <code>use=&quot;encryption&quot;</code> vorhanden sein (siehe <a href="./serviceprovider_metadata.xml">Beispiel</a>). In diesem Fall verwendet das Modul MOA-ID-Auth, dass in diesem Element hinterlegte Zertifikat zur Verschl&uuml;sselung der PVP 2.1 Assertion.</p>
<p><strong>Hinweis:</strong> Fehlt im XML Element <code>md:EntitiesDescriptor/md:EntityDescriptormd:SPSSODescriptor/md:KeyDescriptor</code> das Attribut <code>use</code> wird das in diesem Element hinterlegte Zertifikat sowohl zur Pr&uuml;fung der Signatur des Authentifizierungsrequest als auch zur Verschl&uuml;sselung der PVP 2.1 Assertion verwendet.</p>
<h2><a name="pvp21_binding" id="pvp21_binding"></a>2.3 Zugangspunkte</h2>
<p>F&uuml;r die Kommunikation zwischen Service Provider und dem Modul MOA-ID-Auth stellt MOA-ID-Auth aktuell zwei PVP 2.1 spezifische Zugangspunkte zur Verf&uuml;gung. Detailinformationen zu den beiden Zugangspunkten (Bindings) entnehmen finden Sie in der <a href="#referenzierte_spezifikation">SAML2 Spezifikation</a>. </p>
@@ -467,23 +640,152 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
<p>Folgende Minimalanforderungen an den Authentifizierungsrequest m&uuml;ssen erf&uuml;llt sein.</p>
<ul>
<li>Der Request muss durch den Service Provider signiert sein (sie <a href="AuthRequest.xml">Beispiel</a>). Die Signatur wird durch das Modul MOA-ID-Auth mit Hilfe des in den <a href="#pvp21_metadata">Metadaten hinterlegten Zertifikats</a> validiert. Schl&auml;gt die Signaturpr&uuml;fung fehl oder ist keine Signatur vorhanden wird der Request abgewiesen und MOA-ID-Auth antwortet mit http Code <em>400</em> und der Fehlermeldung <em>NO valid protocol request received!</em>.</li>
- <li>Das der Wert des XML Element <code>saml2p:AuthnRequest/saml2:Issuer</code> muss den <a href="../config/config.html#konfigurationsparameter_oa_general">eindeutigen Identifier</a> enthalten der f&uuml;r diese Online-Applikation bei MOA-ID-Auth hinterlegt ist (sie <a href="AuthRequest.xml">Beispiel</a>).</li>
+ <li>
+ <table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>saml2p:AuthnRequest/saml2:Issuer</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Der Wert dieses Elements muss den <a href="../config/config.html#konfigurationsparameter_oa_general">eindeutigen Identifier</a> enthalten der f&uuml;r diese Online-Applikation bei MOA-ID-Auth hinterlegt ist (sie <a href="AuthRequest.xml">Beispiel</a>).</p></td>
+ </tr>
+ </table>
+ </li>
+ <li>
+ <table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:AuthnRequest/@ID</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Attribut beinhaltet einen vom Service Provider generierten Identifikator f&uuml;r diesen Authentifizierungsrequest.</p></td>
+ </tr>
+ </table>
+ </li>
</ul>
<p>Einen Beispielrequest finden Sie <a href="AuthRequest.xml">hier</a>.</p>
<p><strong>Hinweis:</strong> Detailinformationen finden Sie im Abschnitt <a href="#referenzierte_spezifikation">Spezifikationen</a> in der PVP 2.1 Spezifikation und der SAML2 Spezifikation.</p>
<h3><a name="pvp21_binding_response" id="pvp21_binding3"></a>2.3.2 Authentifizierungsresponse</h3>
-<p>Nach erfolgreicher Authentifizierung antwortet das Modul MOA-ID-Auth mit einer PVP 2.1 Assertion. Zur &Uuml;bertragung der Assertion erfolgt an das in den Metadaten der Online-Applikation angegebene <em>AssertionConsumerService</em> (siehe <a href="#pvp21_metadata">Metadaten</a>). </p>
+<p>Nach erfolgreicher Authentifizierung antwortet das Modul MOA-ID-Auth mit einer PVP 2.1 Assertion. Zur &Uuml;bertragung der Assertion erfolgt an das in den Metadaten der Online-Applikation angegebene <em>AssertionConsumerService</em> (siehe <a href="#pvp21_metadata">Metadaten</a>).</p>
+<p>Aktuell werden vom Modul MOA-ID-Auth zwei Bindings zur &Uuml;bertragung der Assertion unterst&uuml;tzt.</p>
+<ul>
+ <li><strong>POST Binding</strong>: In diesem Fall erfolgt die &Uuml;bertragung mittels eines http POST Formulars welches aus dem Browser der BenutzerIn oder des Benutzers an den Service Provider gesendet wird..</li>
+</ul>
+<ul>
+ <li><strong>Redirect Binding</strong>: In diesem Fall erfolgt die &Uuml;bertragung mittels eines Redirects wobei die Daten als GET Parameter in der URL enthalten sind.</li>
+</ul>
+<p>Der Inhalt der Assertion unterscheidet sich je nachdem welche Attribute in den Metadaten angefordert wurden und ob w&auml;hrend des Anmeldevorgangs ein Fehler aufgetreten ist. Die nachfolgende Aufstellung gibt eine &Uuml;bersicht &uuml;ber jede Elemente die in der Assertion enthalten sind, wenn keine zus&auml;tzlichen Attribute angefordert wurden. Diese Aufstellung beschreibt jedoch nur einige markante Elemente und ist somit nicht vollst&auml;ndig. Detailinformationen zu allen Elementen und Attributen finden Sie in der PVP 2.1 oder der SAML2 Spezifikation. Eine Beispielresponse finden Sie <a href="./Assertion.xml">hier</a>. </p>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/ds:Signature</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Element enth&auml;lt die Signatur, mit welchem die Assertion vom Modul MOA-ID-Auth unterschieben wurde. Das Zertifikat zur Pr&uuml;fung der Signatur wird in den Metadaten des Modules MOA-ID-Auth bereitgestellt.</p></td>
+ </tr>
+</table>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/saml2p:Status/saml2p:StatusCode</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Element beinhaltet als Attribut den Status Code des Anmeldevorgangs. Nochfolgend die wichtigsten Statuscodes und eine kurze Beschreibung.</p>
+ <ul>
+ <li><em>urn:oasis:names:tc:SAML:2.0:status:Success</em>: Der Anmeldevorgang konnte Erfolgreich durchgef&uuml;hrt werden. </li>
+ <li><em>MOA-ID-Auth Fehlercode</em>: W&auml;hrenddes Anmeldevorgangs ist ein Fehler aufgetreten wobei f&uuml;r diesen Fehler in Fehlercode existiert. Zus&auml;tzlich beinhaltet der Wert dieses Elements eine kurze Fehlerbeschreibung.</li>
+ <li><em>urn:oasis:names:tc:SAML:2.0:status:Responder</em>: W&auml;hrend des Anmeldevorgangs ist ein Fehler aufgetreten wobei diesem Fehler kein Fehlercode zugeordnet ist (Allgemeiner Fehler). Zus&auml;tzlich beinhaltet der Wert dieses Elements jedoch eine kurze Fehlerbeschreibung.</li>
+ <li><em>urn:oasis:names:tc:SAML:2.0:status:NoPassive</em>: Die BenutzerIn oder der Benutzer ist aktuell keine aktive und g&uuml;ltige Single Sign-On Session mit MOA-ID-Auth. N&auml;here Details zum <em>isPassiv</em> Authentifizierungsrequest finden Sie in der PVP 2.1 oder der SAML2 Spezifikation.</li>
+ </ul></td>
+ </tr>
+</table>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:NameID</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Element beinhaltet das bereichsspezifischen Personenkennzeichen (bPK / wbPK) der authentifizierten Person.</p></td>
+ </tr>
+</table>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:NameID/@NameQualifier</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Attribut beinhaltet den Bereich des bereichsspezifikschen Personkennzeichens (bPK / wbPK)</p></td>
+ </tr>
+</table>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:SubjectConfirmation/saml2:SubjectConfirmationData/@InResponseTo</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Attribut beinhaltet den vom Service Provider im Authentifizierungsrequest generierten Identifikator.</p></td>
+ </tr>
+</table>
+<table border="1" cellpadding="2" class="fixedWidth">
+ <tr>
+ <td width="8%">Name</td>
+ <td width="92%"><code>/saml2p:Response/saml2:Assertion/saml2:Subject/saml2:SubjectConfirmation/saml2:SubjectConfirmationData/@NotOnOrAfter</code></td>
+ </tr>
+ <tr>
+ <td> Gebrauch</td>
+ <td>Ein Mal</td>
+ </tr>
+ <tr>
+ <td>Erl&auml;uterung</td>
+ <td><p>Dieses Attribut beinhaltet einen von MOA-ID-Auth ausgestellten G&uuml;ltigkeitszeitraum f&uuml;r diese Assertion. Aktuell betr&auml;gt der G&uuml;ltigkeitszeitraum f&uuml;nf Minuten ab dem Ausstellzeitpunkt.</p></td>
+ </tr>
+</table>
<h1><a name="openid"></a>3 OpenID Connect </h1>
-<p>OpenID Connect ist ein Authentifizierungsprotkoll welches auf dem OAuth 2.0 Protokoll aufbaut. Dieses Protokoll erlaubt Online-Applikationen die Identifizierung und Authentifizierung von Benutzern, mit Hilfe des Modules MOA-ID-Auth. Der Vorteil von OpenID Connect im Vergleich zu auf SAML basierten Protkollen (PVP 2.1, SAML 1) ist der einfachere Aufbau der einzelnen Protokollnachrichten. Zusätzlich existieren einige frei Verfügbare Bibliotheken für unterschiedliche Programmiersprachen, welche OpenID Connect implementieren.</p>
-<p>Bevor OpenID Connect in Kombination mit dem Modul MOA-ID-Auth verwendet werden kann muss das Modul MOA-ID-Auth konfiguriert werden. Detailinformationen zur <a href="" >Allgemeinen Konfiguration</a> und zur <a href="">online-applikationsspezifischen Konfiguration</a> finden Sie im jeweiligen Abschnitt des Kapitels Konfiguration. TODO!</p>
+<p>OpenID Connect ist ein Authentifizierungsprotkoll welches auf dem OAuth 2.0 Protokoll aufbaut. Dieses Protokoll erlaubt Online-Applikationen die Identifizierung und Authentifizierung von Benutzern, mit Hilfe des Modules MOA-ID-Auth. Der Vorteil von OpenID Connect im Vergleich zu auf SAML basierten Protokollen (PVP 2.1, SAML 1) ist der einfachere Aufbau der einzelnen Protokollnachrichten. Zusätzlich existieren einige frei Verfügbare Bibliotheken für unterschiedliche Programmiersprachen, welche OpenID Connect implementieren.</p>
+<p>Bevor OpenID Connect in Kombination mit dem Modul MOA-ID-Auth verwendet werden kann muss das Modul MOA-ID-Auth konfiguriert werden. Detailinformationen zur <a href="./../config/config.html#basisconfig_moa_id_auth_param_protocol_openid" >Allgemeinen Konfiguration</a> und zur <a href="./../config/config.html#konfigurationsparameter_oa_protocol_openIDConnect">online-applikationsspezifischen Konfiguration</a> finden Sie im jeweiligen Abschnitt des Kapitels Konfiguration.</p>
<p>Die nachfolgende Beschreibung gibt einen kurzen Überblick zur Verwendung des Protkolls OpenID Connect in Kombination mit dem Modul MOA-ID-Auth. Detailinformationen zu OpenID Connect entnehmen Sie bitte der aktuellen <a href="#referenzierte_spezifikation">OpenID Connect Spezifikation</a></p>
<h2><a name="openid_sequenzdiagramm"></a>3.1 Ablauf einer Anmeldung mittels OpenID Connect</h2>
-<p>Die nachfolgende Abbildung zeigt das Sequenzdiagramm eines Anmeldevorgangs mittels OpenID Connect und des Modules MOA-ID-Auth als Identityprovider. Aus Gründen der Übersichtlichkeit wurden die Teile welche die Kommunikation mit der Bürgerkartenumgebung oder die Vollmachten-Auswahl betreffen bewusst nicht berücksichtigt.</p>
+<p>Die nachfolgende Abbildung zeigt das Sequenzdiagramm eines Anmeldevorgangs mittels OpenID Connect und des Modules MOA-ID-Auth als Identity Provider. Aus Gründen der Übersichtlichkeit wurden die Teile welche die Kommunikation mit der Bürgerkartenumgebung oder die Vollmachten-Auswahl betreffen bewusst nicht berücksichtigt.</p>
<p><img src="openIDconnect_sequenz.png" width="1138" height="705" alt="Sequenzdiagramm OpenID Connect"></p>
<ol>
- <li>Der Benutzer verbindet sich zu einem Web-Portal (Service Provider) &uuml;ber das die Online-Applikation erreichtbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang ausgel&ouml;st.</li>
+ <li>Der Benutzer verbindet sich zu einem Web-Portal (Service Provider) &uuml;ber das die Online-Applikation erreichbar ist. Nach der Bet&auml;tigung eines Login-Buttons wird der Anmeldevorgang ausgel&ouml;st.</li>
<li>Der Service Provider generiert den <a href="#openid_req_authnreq">AuchCode Request</a> und sendet diesen &uuml;ber den Browser an das Modul MOA-ID-Auth.</li>
<li>MOA-ID-Auth validiert den AuthCode Request.</li>
<li>MOA-ID-Auth leitet die BenutzerIn oder den Benutzer zur B&uuml;rgerkartenauswahl
@@ -492,7 +794,7 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
</ol>
</li>
<li>Nach erfolgreicher Authentifizierung erzeugt MOA-ID-Auth die <a href="#openid_req_authnresp">AuthCode Response</a>.
-<ol>
+ <ol>
<li>Die AuthCode Response wird mittels Redirect an den Service Provider retourniert.</li>
</ol>
</li>
@@ -500,7 +802,7 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
<li>Der Service Provider generiert den <a href="#openid_req_tokenreq">AccessToken Request</a> und sendet diesen an MOA-ID-Auth zum Abholen der Benutzerdaten.</li>
<li>MOA-ID-Auth validiert den AccessToken Request</li>
<li>MOA-ID-Auth generiert die <a href="#openid_req_tokenresp">AccessToken Response</a>
-<ol>
+ <ol>
<li>Retournierung der AccessToken Response an den Service Provider</li>
</ol>
</li>
@@ -513,10 +815,9 @@ https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/pvp2/metadata
<h2><a name="openid_interface"></a>3.2 Zugangspunkte</h2>
<p>Zur Verwendung von OpenID Connect stellt das Modul MOA-ID-Auth zwei Zugangspunkte zur Kommunikation mit der Online-Applikation zur Verfügung. Diese Zugangspunkte bezeichnen die URLs unter welchen das Modul MOA-ID-Auth die entsprechenden OpenID Connect Nachrichten entgegennimmt.</p>
<ul>
-<li><b>AuthCode-Request:</b> <em>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/oauth2/auth</em><br> Unter dieser URL wird der Authn Request entgegengenommen. Dieser Request startet den Authentifizierungsvorgang an der Online-Applikation. Hier finden Sie Detailinformationen zum <a href="#openid_req_authnreq"> Request </a>und zur <a href="#openid_req_authnresp">Response</a>.</li>
-<li><b>AccessToken-Request:</b> <em>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/oauth2/token</em><br> Unter dieser URL können nach erfolgreicher Authentifizierung die eigentlichen Authentifizierungsdaten am Modul MOA-ID-Auth abgeholt werden. Hier finden Sie Detailinformationen zum <a href="#openid_req_tokenreq"> Request </a>und zur <a href="#openid_req_tokenresp">Response</a>.</li>
+ <li><b>AuthCode-Request:</b> <em>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/oauth2/auth</em><br> Unter dieser URL wird der Authn Request entgegengenommen. Dieser Request startet den Authentifizierungsvorgang an der Online-Applikation. Hier finden Sie Detailinformationen zum <a href="#openid_req_authnreq"> Request </a>und zur <a href="#openid_req_authnresp">Response</a>.</li>
+ <li><b>AccessToken-Request:</b> <em>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/oauth2/token</em><br> Unter dieser URL können nach erfolgreicher Authentifizierung die eigentlichen Authentifizierungsdaten am Modul MOA-ID-Auth abgeholt werden. Hier finden Sie Detailinformationen zum <a href="#openid_req_tokenreq"> Request </a>und zur <a href="#openid_req_tokenresp">Response</a>.</li>
</ul>
-
<h2><a name="openid_requests"></a>3.3 Beschreibung der Nachrichten</h2>
<p>Dieser Abschnitt beschreibt die einzelnen OpenID Connect spezifischen Nachrichten, welche zwischen der Online-Applikation und dem Modul MOA-ID-Auth während eines Authentifizierungsvorgangs ausgetauscht werden. Hierbei wird auch auf das Sequenzdiagramm aus <a href="#openid_sequenzdiagramm">Abschnitt 3.1</a> Bezug genommen.</p>
@@ -532,7 +833,7 @@ Folgende Parameter müssen mit dem AuthCode-Request mitgesendet werden, wobei für
<tr>
<td>client_id</td>
<td>https://demo.egiz.gv.at/demoportal-openID_demo</td>
- <td>Ist der eindeutige Identifikatior f&uuml;r die Online-Applikation. Dieser MUSS mit dem<a href="../config/config.html#konfigurationsparameter_oa_protocol_openIDConnect"> Identifikatior aus der Konfiguration</a> identisch sein.</td>
+ <td>Ist der eindeutige Identifikator f&uuml;r die Online-Applikation. Dieser MUSS mit dem<a href="../config/config.html#konfigurationsparameter_oa_protocol_openIDConnect"> Identifikatior aus der Konfiguration</a> identisch sein.</td>
</tr>
<tr>
<td>response_type</td>
@@ -598,7 +899,7 @@ Folgende Parameter müssen mit dem AuthCode-Request mitgesendet werden, wobei für
</tr>
</table>
<p>&nbsp;</p>
-<p>Nochfolgend ein Beispiel f&uuml;r eine AuthCode Response.</p>
+<p>Nachfolgend ein Beispiel f&uuml;r eine AuthCode Response.</p>
<pre>https://demo.egiz.gv.at/demoportal-openID_demo/securearea.action?state=1425782214234&amp;code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7 </pre>
<h3><a name="openid_req_tokenreq"></a>3.2.3 AccessToken Request</h3>
<p>Mit dem AccessToken Request k&ouml;nnen vom Service Provider der Online-Applikation die Anmeldedaten an der MOA-ID-Auth Instanz abgeholt werden. F&uuml;r die Abholung m&uuml;ssen folgende Parameter mit dem AccessToken Request an MOA-ID-Auth &uuml;bertragen werden, wobei f&uuml;r die &Uuml;bertragung der Parameter sowohl http GET als auch http POST verwendet werden kann.</p>
@@ -626,7 +927,7 @@ Folgende Parameter müssen mit dem AuthCode-Request mitgesendet werden, wobei für
<tr>
<td>client_id</td>
<td>https://demo.egiz.gv.at/demoportal-openID_demo</td>
- <td>Ist der eindeutige Identifikatior f&uuml;r die Online-Applikation. Dieser MUSS mit dem<a href="../config/config.html#konfigurationsparameter_oa_protocol_openIDConnect"> Identifikatior aus der Konfiguration</a> identisch sein.</td>
+ <td>Ist der eindeutige Identifikator f&uuml;r die Online-Applikation. Dieser MUSS mit dem<a href="../config/config.html#konfigurationsparameter_oa_protocol_openIDConnect"> Identifikatior aus der Konfiguration</a> identisch sein.</td>
</tr>
<tr>
<td>client_secret</td>
@@ -669,7 +970,7 @@ Folgende Parameter müssen mit dem AuthCode-Request mitgesendet werden, wobei für
<tr>
<td>expires_in</td>
<td>3600</td>
- <td>G&uuml;ltigkeitszeitraum der Response (TODO)</td>
+ <td>G&uuml;ltigkeitszeitraum der Response</td>
</tr>
<tr>
<td>scope</td>
@@ -701,8 +1002,127 @@ Folgende Parameter müssen mit dem AuthCode-Request mitgesendet werden, wobei für
XUVrWOLrLl0nx7RkKU8NXNHq-rvKMzqg&quot;
} </pre>
-<h1><a name="saml1"></a>3 SAML 1 </h1>
-
+<h1><a name="saml1"></a>3 SAML 1</h1>
+<p>SAML 1 wird durch MOA-ID-Auth 2.0 auch weiterhin, aus Gr&uuml;nden der Abw&auml;rtskompatibilit&auml;t, als Authentifizierungsprotokoll unterst&uuml;tzt. Es wird jedoch der Umstieg auf ein aktuelles Authentifizierungsprotokoll wie PVP 2.1 oder OpenID Connect empfohlen.</p>
+<p>Die nachfolgenden Abschnitte beschreiben den Anmeldevorgang unter Verwendung von SAML1 wobei die Funktionalit&auml;t, wie sie aus MOA-ID &lt;= 1.5.1 bekannt ist, auch weiterhin unterst&uuml;tzt wird (B&uuml;rgerkartenauswahl auf Seiten des Service Provider). Zus&auml;tzlich steht f&uuml;r SAML 1 jedoch auch die Funktionalit&auml;t der automatischen Generierung der B&uuml;rgerkartenauswahl durch das Modul MOA-ID-Auth zur Verf&uuml;gung.</p>
+<h2><a name="saml1_sequence" id="saml1_sequence"></a>3.1 Ablauf einer Anmeldung mittels SAML 1</h2>
+<p>Die nachfolgende Abbildung zeigt das Sequenzdiagramm eines Anmeldevorgangs mittels SAML 1 und des Modules MOA-ID-Auth als Identity Provider. Hierbei wird die aus MOA-ID 1.5.1 bekannte Variante der B&uuml;rgerkartenauswahl beim Service Provider verwenden. Aus Gr&uuml;nden der &Uuml;bersichtlichkeit wurden die Teile welche die Kommunikation mit der B&uuml;rgerkartenumgebung oder die Vollmachten-Auswahl betreffen bewusst nicht ber&uuml;cksichtigt.</p>
+<p><img src="saml1_sequence.png" width="936" height="592" alt="Sequenzdiagramm f&uuml;r SAML 1"></p>
+<ol>
+ <li>Der Benutzer verbindet sich zu einem Web-Portal (Service Provider) &uuml;ber das die Online-Applikation erreichbar ist. </li>
+ <li>Der Service Provider antwortet mit einer &ouml;ffentlichen Portalseite welche einen Login Bereich mit B&uuml;rgerkartenauswahl beinhaltet.</li>
+ <li>Nach Auswahl der gew&uuml;nschten Authentifizierungsmethode (B&uuml;rgerkarte oder Handy-Signatur) wird der Anmeldevorgang ausgel&ouml;st und der StartAuthentication Request wird an das Modul MOA-ID-Auth gesendet.</li>
+ <li>MOA-ID-Auth validiert den StartAuthentication Request. Ist die Validierung erfolgreich wird der Anmeldevorgang vorgesetzt.</li>
+ <li>Die BenutzerIn oder der Benutzer wird zur gew&auml;hlten B&uuml;rgerkartenumgebung weitergeleitet.
+ <ol>
+ <li>Die BenutzerIn oder der Benutzer Authentifiziert sich mit der gew&auml;hlten Methode.</li>
+ </ol>
+ </li>
+ <li>War die Authentifizierung der BenutzerIn oder des Benutzers erfolgreich generiert MOA-ID-Auth die Assertion mit den Anmeldedaten des Benutzers.</li>
+ <li>MOA-ID-Auth senden das SAML 1 Artifact, welches zur Abholung der Assertion verwendet werden kann, &uuml;ber den Browser an den Service Provider.</li>
+ <li>Der Service Provider stellt einen GetAuthenticationData Request an MOA-ID-Auth unter Verwendung des zuvor &uuml;bermittelten Artifacts.</li>
+ <li>MOA-ID-Auth validiert das Artifact. Ist die Validierung erfolgreich antwortet MOA-ID-Auth mit der SAML 1 Assertion, welche die Anmeldedaten beinhaltet. </li>
+ <li>Der Service Provider verarbeitet die Assertion und danach ist der Benutzer an der Online-Applikation angemeldet.</li>
+</ol>
+<h2><a name="saml1_zugang" id="saml1_zugang"></a>3.2 Zugangspunkte</h2>
+<p>Zur Verwendung von SAML 1 stellt das Modul MOA-ID-Auth zwei Zugangspunkte zur Kommunikation mit der Online-Applikation (Service Provider) zur Verf&uuml;gung. Diese Zugangspunkte bezeichnen die URLs unter welchen das Modul MOA-ID-Auth die entsprechenden SAML1 Nachrichten entgegennimmt.</p>
+<ul>
+ <li><strong>StartAuthentication Request:</strong> <em>https://&lt;host&gt;:&lt;port&gt;/moa-id-auth/StartAuthentication</em><br>
+ Unter dieser URL wird der Authn Request entgegengenommen. Dieser Request startet den Authentifizierungsvorgang an der Online-Applikation.</li>
+ <li><strong>GetAuthenticationData:</strong> <em>http(s)://&lt;host&gt;:&lt;port&gt;/moa-id-auth/services/GetAuthenticationData</em><br>
+ Unter dieser URL k&ouml;nnen nach erfolgreicher Authentifizierung die eigentlichen Authentifizierungsdaten am Modul MOA-ID-Auth abgeholt werden.</li>
+</ul>
+<h2><a name="saml1_startauth" id="saml1_zugang2"></a>3.3 StartAuthentication Request</h2>
+<p>MOA-ID-Auth wird immer durch eine andere (verweisende) Webseite aufgerufen. Diese Webseite kann z.B. Teil eines Portals sein. Der Aufruf erfolgt durch einen Verweis der Form, wobei die Parameter sowohl als http GET als auch als http POST an MOA-ID-Auth &uuml;bergeben werden k&ouml;nnen.</p>
+<pre>&lt;a href="https://&lt;moa-id-server-und-pfad&gt;/StartAuthentication
+ ?Target=&lt;gesch&auml;ftsbereich&gt;
+ &amp;OA=&lt;oa-url&gt;
+ &amp;bkuURI=&lt;bku-url&gt;
+ &amp;Template=&lt;template-url&gt;
+ &amp;useMandate=false
+ &amp;CCC=&lt;ccc&gt;"&gt;</pre>
+<table width="1247" border="1">
+ <tr>
+ <th width="170" scope="col">Name</th>
+ <th width="221" scope="col">Beispielwert</th>
+ <th width="834" scope="col">Beschreibung</th>
+ </tr>
+ <tr>
+ <td>&lt;moa-id-server-und-pfad&gt;</td>
+ <td>https://demo.egiz.gv.at/<br>
+ demoportal_moaid-2.0/</td>
+ <td><p>Server und Pfad, wo MOA-ID-AUTH installiert ist</p></td>
+ </tr>
+ <tr>
+ <td>Target=&lt;gesch&auml;ftsbereich&gt;</td>
+ <td>BF</td>
+ <td><p>Angabe, f&uuml;r welches Verfahren (&ouml;ffentlicher Bereich) der Benutzer authentisiert werden soll. Dieser Parameter wird jedoch durch den in entsprechenden Parameter in der <a href="./../config/config.html#konfigurationsparameter_oa_general_public">online-applikationsspezifischen Konfiguration</a> &uuml;berschrieben.</p></td>
+ </tr>
+ <tr>
+ <td>OA=&lt;oa-url&gt;</td>
+ <td>https://demo.egiz.gv.at/demoportal-demologin/securearea.action</td>
+ <td>Webseite, auf die der Browser nach erfolgter Authentisierung weitergeleitet werden soll</td>
+ </tr>
+ <tr>
+ <td>bkuURI=&lt;bku-url&gt;</td>
+ <td>https://127.0.0.1:3496/https-security-layer-request</td>
+ <td><p>URL auf die B&uuml;rgerkartenumgebung, welche f&uuml;r die Authentifizierung der BenutzerIn oder des Benutzers verwendet werden soll. </p>
+ <p><strong>Hinweis:</strong> Wird dieser Parameter nicht &uuml;bertragen, antwortet das Modul MOA-ID-Auth mit einem bei MOA-ID-Auth hinterlegten B&uuml;rgerkartentemplate.</p></td>
+ </tr>
+ <tr>
+ <td>Template=&lt;template-url&gt;</td>
+ <td>https://demo.egiz.gv.at/moa-id-auth/template_onlineBKU.html</td>
+ <td><strong>Optional:</strong> URL auf die HTML Vorlage f&uuml;r den Security-Layer Request, welcher f&uuml;r die Kommunikation mit der B&uuml;rgerkartenumgebung verwendet wird. Die URL muss in der online-applikationsspezifischen Konfiguration von MOA-ID-Auth hinterlegt werden (<a href="./../config/config.html#konfigurationsparameter_oa_bku">siehe Parameter <em>SecurityLayerTemplates</em></a>).<br>
+ Ist dieser Parameter nicht vorhanden, verwendet MOA-ID-Auth das f&uuml;r diese Online-Applikation hinterlegten Security-Layer Template (<a href="./../config/config.html#konfigurationsparameter_oa_bku">siehe Parameter <em>SecurityLayerTemplates</em></a>).</td>
+ </tr>
+ <tr>
+ <td>useMandate=&lt;true/false&gt;</td>
+ <td>true / false</td>
+ <td><strong>Optional:</strong> Gibt an ob eine Anmeldung im Online-Vollmachten-Modus durchgef&uuml;hrt werden soll (=true) oder nicht (=false);</td>
+ </tr>
+ <tr>
+ <td>CCC=&lt;ccc&gt;</td>
+ <td>BE, SI, </td>
+ <td><strong>Optional:</strong> Gibt an ob die Anmeldung mittels STORK im angegebenen Land erfolgen soll. Die Angabe erfolgt mit dem L&auml;ndercode (Bsp: PT, LU, ES, ...) des jeweiligen Landes.</td>
+ </tr>
+ <tr>
+ <td>sourceID=&lt;xxxxxxx&gt;</td>
+ <td>abcdef141245</td>
+ <td><strong>Optional:</strong> Die sourceID flie&szlig;t in die Genierung des SAML1 Artifacts, welches an den Service Provider returniert wird, ein. Detailinformationen zur Genierierung des SAML1 Artifacts und zur sourceID finden Sie in der <a href="#referenzierte_spezifikation">SAML1 Spezifikation</a>.</td>
+ </tr>
+</table>
+<h2><a name="saml1_getassertion" id="saml1_zugang3"></a>3.4 GetAuthenticationData Request</h2>
+<p>Nach erfolgter Authentisierung stehen in MOA-ID-AUTH Anmeldedaten zum Abholen bereit, und MOA-ID-AUTH veranlasst einen Redirect zur Online-Applikation (OA). <br>
+ <br>
+In diesem Redirect werden der Gesch&auml;ftsbereich und ein SAML-Artifact als Parameter &uuml;bergeben. </p>
+<pre>&lt;a href="https://&lt;oa-url&gt;?Target=&lt;gesch&auml;ftsbereich&gt;&amp;SAMLArtifact=&lt;saml-artifact&gt;"&gt;</pre>
+<table border="1">
+ <tbody valign="baseline">
+ <tr>
+ <td>oa-url&gt;</td>
+ <td>URL, der beim Aufruf von MOA-ID-AUTH als Parameter "OA" &uuml;bergeben wurde</td>
+ </tr>
+ <tr>
+ <td>Target=&lt;gesch&auml;ftsbereich&gt;</td>
+ <td>Parameter, der beim Aufruf von MOA-ID-AUTH &uuml;bergeben wurde</td>
+ </tr>
+ <tr>
+ <td>SAMLArtifact=&lt;saml-artifact&gt;</td>
+ <td>SAML-Artifact, das von MOA-ID-AUTH zu den Anmeldedaten erstellt wurde. Mithilfe dieses SAML-Artifacts kann die OA die Anmeldedaten von MOA-ID-AUTH abholen.</td>
+ </tr>
+ </tbody>
+</table>
+<p>&nbsp;</p>
+<p>Der Service Provider kann anschlie&szlig;end die Assertion, welche die Anmeldedaten oder eine Fehlermeldung beinhaltet, unter Verwendung des SAMLArtifact, am Modul MOA-ID-Auth abholen.</p>
+<p>Das MOA-ID-AUTH Web Service wird &uuml;ber einen &lt;samlp:Request&gt; aufgerufen. Der &lt;samlp:Request&gt; enth&auml;lt in einem &lt;samlp:AssertionArtifact&gt; das von MOA-ID-AUTH &uuml;bergebene SAML-Artifact. <br>
+ <br>
+MOA-ID-AUTH liefert als Antwort einen &lt;samlp:Response&gt;. Die Anmeldedaten sind im &lt;samlp:Response&gt; in Form einer &lt;saml:Assertion&gt; enthalten. </p>
+<ul>
+ <li> <a href="file:///D:/Projekte/svn/moa-id/moa-idspss/id/server/doc/cs-sstc-schema-protocol-01.xsd">SAML 1.0 Protocol Schema</a> <br>
+ </li>
+ <li> <a href="file:///D:/Projekte/svn/moa-id/moa-idspss/id/server/doc/cs-sstc-schema-assertion-01.xsd">SAML 1.0 Assertion Schema</a></li>
+</ul>
+<p>Der detaillierte Aufbau der &lt;saml:Assertion&gt; zu den Anmeldedaten ist in der <a href="file:///D:/Projekte/svn/moa-id/moa-idspss/id/server/doc/MOA_ID_1.4_20070306.pdf">Spezifikation MOA-ID 1.4</a> beschrieben. </p>
<h1><a name="referenzierte_spezifikation" id="uebersicht_zentraledatei_aktualisierung30"></a>A Referenzierte Spezifikation</h1>
<table class="fixedWidth" border="1" cellpadding="2">
<tbody>
diff --git a/id/server/doc/handbook/protocol/pvp21_sequence.png b/id/server/doc/handbook/protocol/pvp21_sequence.png
new file mode 100644
index 000000000..c915531cc
--- /dev/null
+++ b/id/server/doc/handbook/protocol/pvp21_sequence.png
Binary files differ
diff --git a/id/server/doc/handbook/protocol/saml1_sequence.png b/id/server/doc/handbook/protocol/saml1_sequence.png
new file mode 100644
index 000000000..e863d74c1
--- /dev/null
+++ b/id/server/doc/handbook/protocol/saml1_sequence.png
Binary files differ
diff --git a/id/server/doc/handbook/protocol/sso_sequence.png b/id/server/doc/handbook/protocol/sso_sequence.png
new file mode 100644
index 000000000..19e50100d
--- /dev/null
+++ b/id/server/doc/handbook/protocol/sso_sequence.png
Binary files differ
diff --git a/id/server/doc/old/MOA ID 1.x.wsdl b/id/server/doc/handbook/spec/MOA ID 1.x.wsdl
index 4d1c8d71d..d83556540 100644
--- a/id/server/doc/old/MOA ID 1.x.wsdl
+++ b/id/server/doc/handbook/spec/MOA ID 1.x.wsdl
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by patrick peck (anecon) -->
-<definitions name="MOA" targetNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
- <import namespace="http://reference.e-government.gv.at/namespace/moa/20020822#" location="MOA-SPSS-2.0.0.xsd"/>
- <message name="GetAuthenticationDataInput">
- <part name="body" element="samlp:Request"/>
- </message>
- <message name="GetAuthenticationDataOutput">
- <part name="body" element="samlp:Response"/>
- </message>
- <message name="MOAFault">
- <part name="body" element="moa:ErrorResponse"/>
- </message>
- <portType name="IdentificationPortType">
- <operation name="getAuthenticationData">
- <input message="tns:GetAuthenticationDataInput"/>
- <output message="tns:GetAuthenticationDataOutput"/>
- <fault name="MOAFault" message="tns:MOAFault"/>
- </operation>
- </portType>
- <binding name="IdentificationBinding" type="tns:IdentificationPortType" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/soap/ http://schemas.xmlsoap.org/wsdl/soap/">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="getAuthenticationData">
- <soap:operation soapAction="urn:GetAuthenticationDataAction"/>
- <input>
- <soap:body use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
- </output>
- <fault name="MOAFault">
- <soap:fault name="MOAFault" use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
- </fault>
- </operation>
- </binding>
- <service name="GetAuthenticationDataService">
- <port name="IdentificationPort" binding="tns:IdentificationBinding">
- <soap:address location="http://localhost/Identification"/>
- </port>
- </service>
-</definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by patrick peck (anecon) -->
+<definitions name="MOA" targetNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
+ <import namespace="http://reference.e-government.gv.at/namespace/moa/20020822#" location="MOA-SPSS-2.0.0.xsd"/>
+ <message name="GetAuthenticationDataInput">
+ <part name="body" element="samlp:Request"/>
+ </message>
+ <message name="GetAuthenticationDataOutput">
+ <part name="body" element="samlp:Response"/>
+ </message>
+ <message name="MOAFault">
+ <part name="body" element="moa:ErrorResponse"/>
+ </message>
+ <portType name="IdentificationPortType">
+ <operation name="getAuthenticationData">
+ <input message="tns:GetAuthenticationDataInput"/>
+ <output message="tns:GetAuthenticationDataOutput"/>
+ <fault name="MOAFault" message="tns:MOAFault"/>
+ </operation>
+ </portType>
+ <binding name="IdentificationBinding" type="tns:IdentificationPortType" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/soap/ http://schemas.xmlsoap.org/wsdl/soap/">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getAuthenticationData">
+ <soap:operation soapAction="urn:GetAuthenticationDataAction"/>
+ <input>
+ <soap:body use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
+ </output>
+ <fault name="MOAFault">
+ <soap:fault name="MOAFault" use="literal" namespace="http://reference.e-government.gv.at/namespace/moa/20020822#"/>
+ </fault>
+ </operation>
+ </binding>
+ <service name="GetAuthenticationDataService">
+ <port name="IdentificationPort" binding="tns:IdentificationBinding">
+ <soap:address location="http://localhost/Identification"/>
+ </port>
+ </service>
+</definitions>
diff --git a/id/server/doc/old/MOA_ID_1.2_20040315.pdf b/id/server/doc/handbook/spec/MOA_ID_1.2_20040315.pdf
index 0c89c2730..0c89c2730 100644
--- a/id/server/doc/old/MOA_ID_1.2_20040315.pdf
+++ b/id/server/doc/handbook/spec/MOA_ID_1.2_20040315.pdf
Binary files differ
diff --git a/id/server/doc/old/MOA_ID_1.3_20060315.pdf b/id/server/doc/handbook/spec/MOA_ID_1.3_20060315.pdf
index c9b0d160c..c9b0d160c 100644
--- a/id/server/doc/old/MOA_ID_1.3_20060315.pdf
+++ b/id/server/doc/handbook/spec/MOA_ID_1.3_20060315.pdf
Binary files differ
diff --git a/id/server/doc/old/MOA_ID_1.4_20070802.pdf b/id/server/doc/handbook/spec/MOA_ID_1.4_20070802.pdf
index a3a2f1177..a3a2f1177 100644
--- a/id/server/doc/old/MOA_ID_1.4_20070802.pdf
+++ b/id/server/doc/handbook/spec/MOA_ID_1.4_20070802.pdf
Binary files differ
diff --git a/id/server/doc/old/MOA_ID_1.4_Anhang.pdf b/id/server/doc/handbook/spec/MOA_ID_1.4_Anhang.pdf
index 0c923666f..0c923666f 100644
--- a/id/server/doc/old/MOA_ID_1.4_Anhang.pdf
+++ b/id/server/doc/handbook/spec/MOA_ID_1.4_Anhang.pdf
Binary files differ
diff --git a/id/server/doc/old/MOA_ID_1.5_Anhang.pdf b/id/server/doc/handbook/spec/MOA_ID_1.5_Anhang.pdf
index ed2743d3c..ed2743d3c 100644
--- a/id/server/doc/old/MOA_ID_1.5_Anhang.pdf
+++ b/id/server/doc/handbook/spec/MOA_ID_1.5_Anhang.pdf
Binary files differ
diff --git a/id/server/doc/old/OID-1-0-3.pdf b/id/server/doc/handbook/spec/OID-1-0-3.pdf
index 4beab3e41..4beab3e41 100644
--- a/id/server/doc/old/OID-1-0-3.pdf
+++ b/id/server/doc/handbook/spec/OID-1-0-3.pdf
Binary files differ
diff --git a/id/server/doc/old/cs-sstc-schema-assertion-01.xsd b/id/server/doc/handbook/spec/cs-sstc-schema-assertion-01.xsd
index 8bc5af147..d41f3e817 100644
--- a/id/server/doc/old/cs-sstc-schema-assertion-01.xsd
+++ b/id/server/doc/handbook/spec/cs-sstc-schema-assertion-01.xsd
@@ -1,194 +1,194 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by Phill Hallam-Baker (VeriSign Inc.) -->
-<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
- <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
- <annotation>
- <documentation>
- Document identifier: cs-sstc-schema-assertion-01
- Location: http://www.oasis-open.org/committees/security/docs/
- </documentation>
- </annotation>
- <simpleType name="IDType">
- <restriction base="string"/>
- </simpleType>
- <simpleType name="IDReferenceType">
- <restriction base="string"/>
- </simpleType>
- <simpleType name="DecisionType">
- <restriction base="string">
- <enumeration value="Permit"/>
- <enumeration value="Deny"/>
- <enumeration value="Indeterminate"/>
- </restriction>
- </simpleType>
- <element name="AssertionIDReference" type="saml:IDReferenceType"/>
- <element name="Assertion" type="saml:AssertionType"/>
- <complexType name="AssertionType">
- <sequence>
- <element ref="saml:Conditions" minOccurs="0"/>
- <element ref="saml:Advice" minOccurs="0"/>
- <choice maxOccurs="unbounded">
- <element ref="saml:Statement"/>
- <element ref="saml:SubjectStatement"/>
- <element ref="saml:AuthenticationStatement"/>
- <element ref="saml:AuthorizationDecisionStatement"/>
- <element ref="saml:AttributeStatement"/>
- </choice>
- <element ref="ds:Signature" minOccurs="0"/>
- </sequence>
- <attribute name="MajorVersion" type="integer" use="required"/>
- <attribute name="MinorVersion" type="integer" use="required"/>
- <attribute name="AssertionID" type="saml:IDType" use="required"/>
- <attribute name="Issuer" type="string" use="required"/>
- <attribute name="IssueInstant" type="dateTime" use="required"/>
- </complexType>
- <element name="Conditions" type="saml:ConditionsType"/>
- <complexType name="ConditionsType">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="saml:AudienceRestrictionCondition"/>
- <element ref="saml:Condition"/>
- </choice>
- <attribute name="NotBefore" type="dateTime" use="optional"/>
- <attribute name="NotOnOrAfter" type="dateTime" use="optional"/>
- </complexType>
- <element name="Condition" type="saml:ConditionAbstractType"/>
- <complexType name="ConditionAbstractType" abstract="true"/>
- <element name="AudienceRestrictionCondition" type="saml:AudienceRestrictionConditionType"/>
- <complexType name="AudienceRestrictionConditionType">
- <complexContent>
- <extension base="saml:ConditionAbstractType">
- <sequence>
- <element ref="saml:Audience" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="Audience" type="anyURI"/>
- <element name="Advice" type="saml:AdviceType"/>
- <complexType name="AdviceType">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="saml:AssertionIDReference"/>
- <element ref="saml:Assertion"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- </complexType>
- <element name="Statement" type="saml:StatementAbstractType"/>
- <complexType name="StatementAbstractType" abstract="true"/>
- <element name="SubjectStatement" type="saml:SubjectStatementAbstractType"/>
- <complexType name="SubjectStatementAbstractType" abstract="true">
- <complexContent>
- <extension base="saml:StatementAbstractType">
- <sequence>
- <element ref="saml:Subject"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="Subject" type="saml:SubjectType"/>
- <complexType name="SubjectType">
- <choice>
- <sequence>
- <element ref="saml:NameIdentifier"/>
- <element ref="saml:SubjectConfirmation" minOccurs="0"/>
- </sequence>
- <element ref="saml:SubjectConfirmation"/>
- </choice>
- </complexType>
- <element name="NameIdentifier" type="saml:NameIdentifierType"/>
- <complexType name="NameIdentifierType">
- <simpleContent>
- <extension base="string">
- <attribute name="NameQualifier" type="string" use="optional"/>
- <attribute name="Format" type="anyURI" use="optional"/>
- </extension>
- </simpleContent>
- </complexType>
- <element name="SubjectConfirmation" type="saml:SubjectConfirmationType"/>
- <complexType name="SubjectConfirmationType">
- <sequence>
- <element ref="saml:ConfirmationMethod" maxOccurs="unbounded"/>
- <element ref="saml:SubjectConfirmationData" minOccurs="0"/>
- <element ref="ds:KeyInfo" minOccurs="0"/>
- </sequence>
- </complexType>
- <element name="SubjectConfirmationData" type="anyType"/>
- <element name="ConfirmationMethod" type="anyURI"/>
- <element name="AuthenticationStatement" type="saml:AuthenticationStatementType"/>
- <complexType name="AuthenticationStatementType">
- <complexContent>
- <extension base="saml:SubjectStatementAbstractType">
- <sequence>
- <element ref="saml:SubjectLocality" minOccurs="0"/>
- <element ref="saml:AuthorityBinding" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="AuthenticationMethod" type="anyURI" use="required"/>
- <attribute name="AuthenticationInstant" type="dateTime" use="required"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="SubjectLocality" type="saml:SubjectLocalityType"/>
- <complexType name="SubjectLocalityType">
- <attribute name="IPAddress" type="string" use="optional"/>
- <attribute name="DNSAddress" type="string" use="optional"/>
- </complexType>
- <element name="AuthorityBinding" type="saml:AuthorityBindingType"/>
- <complexType name="AuthorityBindingType">
- <attribute name="AuthorityKind" type="QName" use="required"/>
- <attribute name="Location" type="anyURI" use="required"/>
- <attribute name="Binding" type="anyURI" use="required"/>
- </complexType>
- <element name="AuthorizationDecisionStatement" type="saml:AuthorizationDecisionStatementType"/>
- <complexType name="AuthorizationDecisionStatementType">
- <complexContent>
- <extension base="saml:SubjectStatementAbstractType">
- <sequence>
- <element ref="saml:Action" maxOccurs="unbounded"/>
- <element ref="saml:Evidence" minOccurs="0"/>
- </sequence>
- <attribute name="Resource" type="anyURI" use="required"/>
- <attribute name="Decision" type="saml:DecisionType" use="required"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="Action" type="saml:ActionType"/>
- <complexType name="ActionType">
- <simpleContent>
- <extension base="string">
- <attribute name="Namespace" type="anyURI"/>
- </extension>
- </simpleContent>
- </complexType>
- <element name="Evidence" type="saml:EvidenceType"/>
- <complexType name="EvidenceType">
- <choice maxOccurs="unbounded">
- <element ref="saml:AssertionIDReference"/>
- <element ref="saml:Assertion"/>
- </choice>
- </complexType>
- <element name="AttributeStatement" type="saml:AttributeStatementType"/>
- <complexType name="AttributeStatementType">
- <complexContent>
- <extension base="saml:SubjectStatementAbstractType">
- <sequence>
- <element ref="saml:Attribute" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="AttributeDesignator" type="saml:AttributeDesignatorType"/>
- <complexType name="AttributeDesignatorType">
- <attribute name="AttributeName" type="string" use="required"/>
- <attribute name="AttributeNamespace" type="anyURI" use="required"/>
- </complexType>
- <element name="Attribute" type="saml:AttributeType"/>
- <complexType name="AttributeType">
- <complexContent>
- <extension base="saml:AttributeDesignatorType">
- <sequence>
- <element ref="saml:AttributeValue" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="AttributeValue" type="anyType"/>
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by Phill Hallam-Baker (VeriSign Inc.) -->
+<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
+ <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
+ <annotation>
+ <documentation>
+ Document identifier: cs-sstc-schema-assertion-01
+ Location: http://www.oasis-open.org/committees/security/docs/
+ </documentation>
+ </annotation>
+ <simpleType name="IDType">
+ <restriction base="string"/>
+ </simpleType>
+ <simpleType name="IDReferenceType">
+ <restriction base="string"/>
+ </simpleType>
+ <simpleType name="DecisionType">
+ <restriction base="string">
+ <enumeration value="Permit"/>
+ <enumeration value="Deny"/>
+ <enumeration value="Indeterminate"/>
+ </restriction>
+ </simpleType>
+ <element name="AssertionIDReference" type="saml:IDReferenceType"/>
+ <element name="Assertion" type="saml:AssertionType"/>
+ <complexType name="AssertionType">
+ <sequence>
+ <element ref="saml:Conditions" minOccurs="0"/>
+ <element ref="saml:Advice" minOccurs="0"/>
+ <choice maxOccurs="unbounded">
+ <element ref="saml:Statement"/>
+ <element ref="saml:SubjectStatement"/>
+ <element ref="saml:AuthenticationStatement"/>
+ <element ref="saml:AuthorizationDecisionStatement"/>
+ <element ref="saml:AttributeStatement"/>
+ </choice>
+ <element ref="ds:Signature" minOccurs="0"/>
+ </sequence>
+ <attribute name="MajorVersion" type="integer" use="required"/>
+ <attribute name="MinorVersion" type="integer" use="required"/>
+ <attribute name="AssertionID" type="saml:IDType" use="required"/>
+ <attribute name="Issuer" type="string" use="required"/>
+ <attribute name="IssueInstant" type="dateTime" use="required"/>
+ </complexType>
+ <element name="Conditions" type="saml:ConditionsType"/>
+ <complexType name="ConditionsType">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="saml:AudienceRestrictionCondition"/>
+ <element ref="saml:Condition"/>
+ </choice>
+ <attribute name="NotBefore" type="dateTime" use="optional"/>
+ <attribute name="NotOnOrAfter" type="dateTime" use="optional"/>
+ </complexType>
+ <element name="Condition" type="saml:ConditionAbstractType"/>
+ <complexType name="ConditionAbstractType" abstract="true"/>
+ <element name="AudienceRestrictionCondition" type="saml:AudienceRestrictionConditionType"/>
+ <complexType name="AudienceRestrictionConditionType">
+ <complexContent>
+ <extension base="saml:ConditionAbstractType">
+ <sequence>
+ <element ref="saml:Audience" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="Audience" type="anyURI"/>
+ <element name="Advice" type="saml:AdviceType"/>
+ <complexType name="AdviceType">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="saml:AssertionIDReference"/>
+ <element ref="saml:Assertion"/>
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ </complexType>
+ <element name="Statement" type="saml:StatementAbstractType"/>
+ <complexType name="StatementAbstractType" abstract="true"/>
+ <element name="SubjectStatement" type="saml:SubjectStatementAbstractType"/>
+ <complexType name="SubjectStatementAbstractType" abstract="true">
+ <complexContent>
+ <extension base="saml:StatementAbstractType">
+ <sequence>
+ <element ref="saml:Subject"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="Subject" type="saml:SubjectType"/>
+ <complexType name="SubjectType">
+ <choice>
+ <sequence>
+ <element ref="saml:NameIdentifier"/>
+ <element ref="saml:SubjectConfirmation" minOccurs="0"/>
+ </sequence>
+ <element ref="saml:SubjectConfirmation"/>
+ </choice>
+ </complexType>
+ <element name="NameIdentifier" type="saml:NameIdentifierType"/>
+ <complexType name="NameIdentifierType">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="NameQualifier" type="string" use="optional"/>
+ <attribute name="Format" type="anyURI" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <element name="SubjectConfirmation" type="saml:SubjectConfirmationType"/>
+ <complexType name="SubjectConfirmationType">
+ <sequence>
+ <element ref="saml:ConfirmationMethod" maxOccurs="unbounded"/>
+ <element ref="saml:SubjectConfirmationData" minOccurs="0"/>
+ <element ref="ds:KeyInfo" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <element name="SubjectConfirmationData" type="anyType"/>
+ <element name="ConfirmationMethod" type="anyURI"/>
+ <element name="AuthenticationStatement" type="saml:AuthenticationStatementType"/>
+ <complexType name="AuthenticationStatementType">
+ <complexContent>
+ <extension base="saml:SubjectStatementAbstractType">
+ <sequence>
+ <element ref="saml:SubjectLocality" minOccurs="0"/>
+ <element ref="saml:AuthorityBinding" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="AuthenticationMethod" type="anyURI" use="required"/>
+ <attribute name="AuthenticationInstant" type="dateTime" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="SubjectLocality" type="saml:SubjectLocalityType"/>
+ <complexType name="SubjectLocalityType">
+ <attribute name="IPAddress" type="string" use="optional"/>
+ <attribute name="DNSAddress" type="string" use="optional"/>
+ </complexType>
+ <element name="AuthorityBinding" type="saml:AuthorityBindingType"/>
+ <complexType name="AuthorityBindingType">
+ <attribute name="AuthorityKind" type="QName" use="required"/>
+ <attribute name="Location" type="anyURI" use="required"/>
+ <attribute name="Binding" type="anyURI" use="required"/>
+ </complexType>
+ <element name="AuthorizationDecisionStatement" type="saml:AuthorizationDecisionStatementType"/>
+ <complexType name="AuthorizationDecisionStatementType">
+ <complexContent>
+ <extension base="saml:SubjectStatementAbstractType">
+ <sequence>
+ <element ref="saml:Action" maxOccurs="unbounded"/>
+ <element ref="saml:Evidence" minOccurs="0"/>
+ </sequence>
+ <attribute name="Resource" type="anyURI" use="required"/>
+ <attribute name="Decision" type="saml:DecisionType" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="Action" type="saml:ActionType"/>
+ <complexType name="ActionType">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="Namespace" type="anyURI"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <element name="Evidence" type="saml:EvidenceType"/>
+ <complexType name="EvidenceType">
+ <choice maxOccurs="unbounded">
+ <element ref="saml:AssertionIDReference"/>
+ <element ref="saml:Assertion"/>
+ </choice>
+ </complexType>
+ <element name="AttributeStatement" type="saml:AttributeStatementType"/>
+ <complexType name="AttributeStatementType">
+ <complexContent>
+ <extension base="saml:SubjectStatementAbstractType">
+ <sequence>
+ <element ref="saml:Attribute" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AttributeDesignator" type="saml:AttributeDesignatorType"/>
+ <complexType name="AttributeDesignatorType">
+ <attribute name="AttributeName" type="string" use="required"/>
+ <attribute name="AttributeNamespace" type="anyURI" use="required"/>
+ </complexType>
+ <element name="Attribute" type="saml:AttributeType"/>
+ <complexType name="AttributeType">
+ <complexContent>
+ <extension base="saml:AttributeDesignatorType">
+ <sequence>
+ <element ref="saml:AttributeValue" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AttributeValue" type="anyType"/>
+</schema>
diff --git a/id/server/doc/old/cs-sstc-schema-protocol-01.xsd b/id/server/doc/handbook/spec/cs-sstc-schema-protocol-01.xsd
index ecad05b0f..d939fa732 100644
--- a/id/server/doc/old/cs-sstc-schema-protocol-01.xsd
+++ b/id/server/doc/handbook/spec/cs-sstc-schema-protocol-01.xsd
@@ -1,127 +1,127 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Phillip Hallam-Baker (Phillip Hallam-Baker) -->
-<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
- <import namespace="urn:oasis:names:tc:SAML:1.0:assertion" schemaLocation="cs-sstc-schema-assertion-01.xsd"/>
- <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
- <annotation>
- <documentation>
- Document identifier: cs-sstc-schema-protocol-01
- Location: http://www.oasis-open.org/committees/security/docs/
- </documentation>
- </annotation>
- <complexType name="RequestAbstractType" abstract="true">
- <sequence>
- <element ref="samlp:RespondWith" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="ds:Signature" minOccurs="0"/>
- </sequence>
- <attribute name="RequestID" type="saml:IDType" use="required"/>
- <attribute name="MajorVersion" type="integer" use="required"/>
- <attribute name="MinorVersion" type="integer" use="required"/>
- <attribute name="IssueInstant" type="dateTime" use="required"/>
- </complexType>
- <element name="RespondWith" type="QName"/>
- <element name="Request" type="samlp:RequestType"/>
- <complexType name="RequestType">
- <complexContent>
- <extension base="samlp:RequestAbstractType">
- <choice>
- <element ref="samlp:Query"/>
- <element ref="samlp:SubjectQuery"/>
- <element ref="samlp:AuthenticationQuery"/>
- <element ref="samlp:AttributeQuery"/>
- <element ref="samlp:AuthorizationDecisionQuery"/>
- <element ref="saml:AssertionIDReference" maxOccurs="unbounded"/>
- <element ref="samlp:AssertionArtifact" maxOccurs="unbounded"/>
- </choice>
- </extension>
- </complexContent>
- </complexType>
- <element name="AssertionArtifact" type="string"/>
- <element name="Query" type="samlp:QueryAbstractType"/>
- <complexType name="QueryAbstractType" abstract="true"/>
- <element name="SubjectQuery" type="samlp:SubjectQueryAbstractType"/>
- <complexType name="SubjectQueryAbstractType" abstract="true">
- <complexContent>
- <extension base="samlp:QueryAbstractType">
- <sequence>
- <element ref="saml:Subject"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="AuthenticationQuery" type="samlp:AuthenticationQueryType"/>
- <complexType name="AuthenticationQueryType">
- <complexContent>
- <extension base="samlp:SubjectQueryAbstractType">
- <attribute name="AuthenticationMethod" type="anyURI"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="AttributeQuery" type="samlp:AttributeQueryType"/>
- <complexType name="AttributeQueryType">
- <complexContent>
- <extension base="samlp:SubjectQueryAbstractType">
- <sequence>
- <element ref="saml:AttributeDesignator" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="Resource" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="AuthorizationDecisionQuery" type="samlp:AuthorizationDecisionQueryType"/>
- <complexType name="AuthorizationDecisionQueryType">
- <complexContent>
- <extension base="samlp:SubjectQueryAbstractType">
- <sequence>
- <element ref="saml:Action" maxOccurs="unbounded"/>
- <element ref="saml:Evidence" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="Resource" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
- <complexType name="ResponseAbstractType" abstract="true">
- <sequence>
- <element ref="ds:Signature" minOccurs="0"/>
- </sequence>
- <attribute name="ResponseID" type="saml:IDType" use="required"/>
- <attribute name="InResponseTo" type="saml:IDReferenceType" use="optional"/>
- <attribute name="MajorVersion" type="integer" use="required"/>
- <attribute name="MinorVersion" type="integer" use="required"/>
- <attribute name="IssueInstant" type="dateTime" use="required"/>
- <attribute name="Recipient" type="anyURI" use="optional"/>
- </complexType>
- <element name="Response" type="samlp:ResponseType"/>
- <complexType name="ResponseType">
- <complexContent>
- <extension base="samlp:ResponseAbstractType">
- <sequence>
- <element ref="samlp:Status"/>
- <element ref="saml:Assertion" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <element name="Status" type="samlp:StatusType"/>
- <complexType name="StatusType">
- <sequence>
- <element ref="samlp:StatusCode"/>
- <element ref="samlp:StatusMessage" minOccurs="0" maxOccurs="1"/>
- <element ref="samlp:StatusDetail" minOccurs="0"/>
- </sequence>
- </complexType>
- <element name="StatusCode" type="samlp:StatusCodeType"/>
- <complexType name="StatusCodeType">
- <sequence>
- <element ref="samlp:StatusCode" minOccurs="0"/>
- </sequence>
- <attribute name="Value" type="QName" use="required"/>
- </complexType>
- <element name="StatusMessage" type="string"/>
- <element name="StatusDetail" type="samlp:StatusDetailType"/>
- <complexType name="StatusDetailType">
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Phillip Hallam-Baker (Phillip Hallam-Baker) -->
+<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">
+ <import namespace="urn:oasis:names:tc:SAML:1.0:assertion" schemaLocation="cs-sstc-schema-assertion-01.xsd"/>
+ <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
+ <annotation>
+ <documentation>
+ Document identifier: cs-sstc-schema-protocol-01
+ Location: http://www.oasis-open.org/committees/security/docs/
+ </documentation>
+ </annotation>
+ <complexType name="RequestAbstractType" abstract="true">
+ <sequence>
+ <element ref="samlp:RespondWith" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="ds:Signature" minOccurs="0"/>
+ </sequence>
+ <attribute name="RequestID" type="saml:IDType" use="required"/>
+ <attribute name="MajorVersion" type="integer" use="required"/>
+ <attribute name="MinorVersion" type="integer" use="required"/>
+ <attribute name="IssueInstant" type="dateTime" use="required"/>
+ </complexType>
+ <element name="RespondWith" type="QName"/>
+ <element name="Request" type="samlp:RequestType"/>
+ <complexType name="RequestType">
+ <complexContent>
+ <extension base="samlp:RequestAbstractType">
+ <choice>
+ <element ref="samlp:Query"/>
+ <element ref="samlp:SubjectQuery"/>
+ <element ref="samlp:AuthenticationQuery"/>
+ <element ref="samlp:AttributeQuery"/>
+ <element ref="samlp:AuthorizationDecisionQuery"/>
+ <element ref="saml:AssertionIDReference" maxOccurs="unbounded"/>
+ <element ref="samlp:AssertionArtifact" maxOccurs="unbounded"/>
+ </choice>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AssertionArtifact" type="string"/>
+ <element name="Query" type="samlp:QueryAbstractType"/>
+ <complexType name="QueryAbstractType" abstract="true"/>
+ <element name="SubjectQuery" type="samlp:SubjectQueryAbstractType"/>
+ <complexType name="SubjectQueryAbstractType" abstract="true">
+ <complexContent>
+ <extension base="samlp:QueryAbstractType">
+ <sequence>
+ <element ref="saml:Subject"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AuthenticationQuery" type="samlp:AuthenticationQueryType"/>
+ <complexType name="AuthenticationQueryType">
+ <complexContent>
+ <extension base="samlp:SubjectQueryAbstractType">
+ <attribute name="AuthenticationMethod" type="anyURI"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AttributeQuery" type="samlp:AttributeQueryType"/>
+ <complexType name="AttributeQueryType">
+ <complexContent>
+ <extension base="samlp:SubjectQueryAbstractType">
+ <sequence>
+ <element ref="saml:AttributeDesignator" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="Resource" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="AuthorizationDecisionQuery" type="samlp:AuthorizationDecisionQueryType"/>
+ <complexType name="AuthorizationDecisionQueryType">
+ <complexContent>
+ <extension base="samlp:SubjectQueryAbstractType">
+ <sequence>
+ <element ref="saml:Action" maxOccurs="unbounded"/>
+ <element ref="saml:Evidence" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="Resource" type="anyURI" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="ResponseAbstractType" abstract="true">
+ <sequence>
+ <element ref="ds:Signature" minOccurs="0"/>
+ </sequence>
+ <attribute name="ResponseID" type="saml:IDType" use="required"/>
+ <attribute name="InResponseTo" type="saml:IDReferenceType" use="optional"/>
+ <attribute name="MajorVersion" type="integer" use="required"/>
+ <attribute name="MinorVersion" type="integer" use="required"/>
+ <attribute name="IssueInstant" type="dateTime" use="required"/>
+ <attribute name="Recipient" type="anyURI" use="optional"/>
+ </complexType>
+ <element name="Response" type="samlp:ResponseType"/>
+ <complexType name="ResponseType">
+ <complexContent>
+ <extension base="samlp:ResponseAbstractType">
+ <sequence>
+ <element ref="samlp:Status"/>
+ <element ref="saml:Assertion" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="Status" type="samlp:StatusType"/>
+ <complexType name="StatusType">
+ <sequence>
+ <element ref="samlp:StatusCode"/>
+ <element ref="samlp:StatusMessage" minOccurs="0" maxOccurs="1"/>
+ <element ref="samlp:StatusDetail" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <element name="StatusCode" type="samlp:StatusCodeType"/>
+ <complexType name="StatusCodeType">
+ <sequence>
+ <element ref="samlp:StatusCode" minOccurs="0"/>
+ </sequence>
+ <attribute name="Value" type="QName" use="required"/>
+ </complexType>
+ <element name="StatusMessage" type="string"/>
+ <element name="StatusDetail" type="samlp:StatusDetailType"/>
+ <complexType name="StatusDetailType">
+ <sequence>
+ <any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+</schema>
diff --git a/id/server/doc/htmlTemplates/BKU-selection.html b/id/server/doc/htmlTemplates/BKU-selection.html
index 9d6ad4085..b9d3eafa7 100644
--- a/id/server/doc/htmlTemplates/BKU-selection.html
+++ b/id/server/doc/htmlTemplates/BKU-selection.html
@@ -628,6 +628,10 @@
document.getElementById("localBKU").style.display="block";
return;
}
+ function bkuLocalClicked() {
+ setMandateSelection();
+ }
+
function bkuOnlineClicked() {
if (isMetro())
document.getElementById("metroDetected").style.display="block";
@@ -796,9 +800,11 @@
type="hidden" name="CCC" id="ccc"> <input type="hidden"
name="MODUL" value="#MODUL#"> <input type="hidden"
name="ACTION" value="#ACTION#"> <input type="hidden"
- name="MOASessionID" value="#SESSIONID#"> <input
- type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
- role="button" class="hell">
+ name="MOASessionID" value="#SESSIONID#">
+ <input type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
+ role="button" class="hell"
+ onclick="setMandateSelection();"
+ >
<!--p>
<small>Alternativ können Sie eine lokal installierte BKU verwenden.</small>
</p-->
diff --git a/id/server/doc/moa_id/examples/BKUSelectionTemplate.html b/id/server/doc/moa_id/examples/BKUSelectionTemplate.html
deleted file mode 100644
index 731cc36fd..000000000
--- a/id/server/doc/moa_id/examples/BKUSelectionTemplate.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>MOA ID - Auswahl der B&uuuml;rgerkartenumgebung</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="Author" content="Max Mustermann">
- <meta name="keywords" content="MOA-ID">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/main.css">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/display.css" media="screen,projection,tv,handheld">
-</head>
-
-<body>
-<img src="/moaid-templates/SampleLogo.gif" alt='Organisation XY'>
-<h1 align="center">Auswahl der B&uuml;rgerkartenumgebung</h1>
-<p></p>
-<p>Sie haben sich f&uuml;r Anmeldung mit Ihrer B&uuml;rgerkarte entschieden. Da es verschiedene Formen der B&uuml;rgerkarte gibt, m&uuml;ssen Sie nun w&auml;hlen, welche Sie bei der Anmeldung verwenden wollen.</p>
-<h3>Auswahl der B&uuml;rgerkarte</h3>
-<form name="CustomizedForm" method="post" action="<StartAuth>">
- <BKUSelect>
- <input type="submit" value="Ausw&auml;hlen"/>
-</form>
-<br/>
-<p></p>
-
- <input type="hidden" value="Weitere Info"/>
-</form>
-
-<h4>Hinweise: </h4>
-<ul>
- <li>
- <p>Wollen Sie eine A-Trust B&uuml;rgerkarte erwerben? Hier finden Sie Informationen
- dazu: <a href="http://www.a-trust.at/" target="_blank">A-Trust
- B&uuml;rgerkarte.</a> Bei der Anmeldung mit der A-Trust B&uuml;rgerkarte
- ben&ouml;tigen Sie eine funktionsf&auml;hige B&uuml;rgerkartensoftware sowie
- einen passenden Kartenleser.</p>
- </li>
-</ul>
-
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/examples/ChainingModes.txt b/id/server/doc/moa_id/examples/ChainingModes.txt
deleted file mode 100644
index 820b60d06..000000000
--- a/id/server/doc/moa_id/examples/ChainingModes.txt
+++ /dev/null
@@ -1,6 +0,0 @@
- <ChainingModes systemDefaultMode="pkix">
- <TrustAnchor mode="chaining">
- <dsig:X509IssuerName>CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT</dsig:X509IssuerName>
- <dsig:X509SerialNumber>536</dsig:X509SerialNumber>
- </TrustAnchor>
- </ChainingModes>
diff --git a/id/server/doc/moa_id/examples/IdentityLinkSigners.txt b/id/server/doc/moa_id/examples/IdentityLinkSigners.txt
deleted file mode 100644
index 15269ad79..000000000
--- a/id/server/doc/moa_id/examples/IdentityLinkSigners.txt
+++ /dev/null
@@ -1,9 +0,0 @@
- <!-- Gueltige Signatoren des IdentityLink, der von der Buergerkarte gelesen wird -->
- <IdentityLinkSigners>
- <!-- Personenbindung alt (Ausgabe vor 05.2004) -->
- <X509SubjectName>CN=zmr,OU=BMI-IV-2,O=BMI,C=AT</X509SubjectName>
- <!-- Personenbindung neu (ab 05.2004, mit Stammzahl) mit Typo -->
- <X509SubjectName>T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission</X509SubjectName>
- <!-- Personenbindung neu (ab 05.2004, mit Stammzahl) jedoch ohne Typo -->
- <X509SubjectName>T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission</X509SubjectName>
- </IdentityLinkSigners> \ No newline at end of file
diff --git a/id/server/doc/moa_id/examples/LoginServletExample.txt b/id/server/doc/moa_id/examples/LoginServletExample.txt
deleted file mode 100644
index 587ef5e97..000000000
--- a/id/server/doc/moa_id/examples/LoginServletExample.txt
+++ /dev/null
@@ -1,171 +0,0 @@
-import java.io.IOException;
-import java.util.Vector;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.rpc.Call;
-import javax.xml.rpc.Service;
-import javax.xml.rpc.ServiceFactory;
-
-import org.apache.axis.message.SOAPBodyElement;
-import org.apache.xml.serialize.LineSeparator;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.jaxen.JaxenException;
-import org.jaxen.SimpleNamespaceContext;
-import org.jaxen.dom.DOMXPath;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Beispiel für ein Login-Servlet, das von MOA-ID-AUTH über einen Redirect aufgerufen wird.
- * Es werden demonstriert:
- * - Parameterübergabe von MOA-ID-AUTH
- * - Aufruf des MOA-ID-AUTH Web Service zum Abholen der Anmeldedaten über das Apache Axis Framework
- * - Parsen der Anmeldedaten mittels der XPath Engine "Jaxen"
- * - Speichern der Anmeldedaten in der HTTPSession
- * - Redirect auf die eigentliche Startseite der OA
- *
- * @author Paul Ivancsics
- */
-public class LoginServletExample extends HttpServlet {
-
- // Web Service QName und Endpoint
- private static final QName SERVICE_QNAME = new QName("GetAuthenticationData");
- private static final String ENDPOINT =
- "http://localhost:8080/moa-id-auth/services/GetAuthenticationData";
- // NamespaceContext für Jaxen
- private static SimpleNamespaceContext NS_CONTEXT;
- static {
- NS_CONTEXT = new SimpleNamespaceContext();
- NS_CONTEXT.addNamespace("saml", "urn:oasis:names:tc:SAML:1.0:assertion");
- NS_CONTEXT.addNamespace("samlp", "urn:oasis:names:tc:SAML:1.0:protocol");
- NS_CONTEXT.addNamespace("pr", "http://reference.e-government.gv.at/namespace/persondata/20020228#");
- }
-
- /**
- * Servlet wird von MOA-ID-AUTH nach erfolgter Authentisierung über ein Redirect aufgerufen.
- */
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
-
- // Parameter "Target" und "SAMLArtifact" aus dem Redirect von MOA-ID-AUTH lesen
- String target = req.getParameter("Target");
- String samlArtifact = req.getParameter("SAMLArtifact");
-
- try {
- // DOMBuilder instanzieren
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
-
- // <samlp:Request> zusammenstellen und in einen DOM-Baum umwandeln
- String samlRequest =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><samlp:Request IssueInstant=\"2003-01-01T00:00:00+02:00\" MajorVersion=\"1\" MinorVersion=\"0\" RequestID=\"12345678901234567890\" xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\"><samlp:AssertionArtifact>"
- + samlArtifact
- + "</samlp:AssertionArtifact></samlp:Request>";
- Document root_request = builder.parse(new ByteArrayInputStream(samlRequest.getBytes()));
-
- // Neues SOAPBodyElement anlegen und mit dem DOM-Baum füllen
- SOAPBodyElement body = new SOAPBodyElement(root_request.getDocumentElement());
- SOAPBodyElement[] params = new SOAPBodyElement[] { body };
-
- // AXIS-Service für Aufruf von MOA-ID-AUTH instanzieren
- Service service = ServiceFactory.newInstance().createService(SERVICE_QNAME);
-
- // Axis-Call erzeugen und mit Endpoint verknüpfen
- Call call = service.createCall();
- call.setTargetEndpointAddress(ENDPOINT);
-
- // Call aufrufen und die Antwort speichern
- System.out.println("Calling MOA-ID-AUTH ...");
- Vector responses = (Vector) call.invoke(params);
-
- // erstes BodyElement auslesen
- SOAPBodyElement response = (SOAPBodyElement) responses.get(0);
-
- // <samlp:Response> als DOM-Baum holen
- Document responseDocument = response.getAsDocument();
- Element samlResponse = responseDocument.getDocumentElement();
-
- // <samlp:Response> auf System.out ausgeben
- System.out.println("Response received:");
- OutputFormat format = new OutputFormat((Document) responseDocument);
- format.setLineSeparator(LineSeparator.Windows);
- format.setIndenting(true);
- format.setLineWidth(0);
- XMLSerializer serializer = new XMLSerializer(System.out, format);
- serializer.asDOMSerializer();
- serializer.serialize(responseDocument);
-
- // <samlp:StatusCode> auslesen
- Attr statusCodeAttr = (Attr)getNode(samlResponse, "/samlp:Response/samlp:Status/samlp:StatusCode/@Value");
- String samlStatusCode = statusCodeAttr.getValue();
- System.out.println("StatusCode: " + samlStatusCode);
-
- // <saml:Assertion> auslesen
- if ("samlp:Success".equals(samlStatusCode)) {
- Element samlAssertion = (Element)getNode(samlResponse, "/samlp:Response/saml:Assertion");
-
- // FamilyName aus der <saml:Assertion> parsen
- Node familyNameNode = getNode(samlAssertion, "//saml:AttributeStatement/saml:Attribute[@AttributeName=\"PersonData\"]/saml:AttributeValue/pr:Person/pr:Name/pr:FamilyName");
- String familyName = getText(familyNameNode);
- System.out.println("Family name: " + familyName);
-
- // weitere Anmeldedaten aus der <saml:Assertion> parsen
- // ...
-
- // Anmeldedaten und Target in der HTTPSession speichern
- HttpSession session = req.getSession();
- session.setAttribute("UserFamilyName", familyName);
- session.setAttribute("Geschaeftsbereich", target);
-
- // weitere Anmeldedaten in der HTTPSession speichern
- // ...
-
- // Redirect auf die eigentliche Startseite
- resp.sendRedirect("/index.jsp");
- }
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- /** Returns the first node matching an XPath expression. */
- private static Node getNode(Node contextNode, String xpathExpression) throws JaxenException {
- DOMXPath xpath = new DOMXPath(xpathExpression);
- xpath.setNamespaceContext(NS_CONTEXT);
- return (Node) xpath.selectSingleNode(contextNode);
- }
- /** Returns the text that a node contains. */
- public static String getText(Node node) {
- if (!node.hasChildNodes()) {
- return "";
- }
-
- StringBuffer result = new StringBuffer();
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node subnode = list.item(i);
- if (subnode.getNodeType() == Node.TEXT_NODE) {
- result.append(subnode.getNodeValue());
- } else if (subnode.getNodeType() == Node.CDATA_SECTION_NODE) {
- result.append(subnode.getNodeValue());
- } else if (subnode.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- // Recurse into the subtree for text
- // (and ignore comments)
- result.append(getText(subnode));
- }
- }
- return result.toString();
- }
-}
diff --git a/id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml b/id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml
deleted file mode 100644
index f31730a06..000000000
--- a/id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<MOA-IDConfiguration xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:sl10="http://www.buergerkarte.at/namespaces/securitylayer/20020225#" xmlns:sl11="http://www.buergerkarte.at/namespaces/securitylayer/20020831#">
- <!-- Konfiguration fuer MOA-ID-AUTH -->
- <AuthComponent>
- <!-- Transformationen fuer die Anzeige des AUTH-Block im Secure Viewer -->
- <SecurityLayer>
- <!-- Wählen Sie hier den deutschen oder englischen Auswahltext -->
- <TransformsInfo filename="transforms/TransformsInfoAuthBlockTable_DE.xml"/>
- <!-- <TransformsInfo filename="transforms/TransformsInfoAuthBlockTable_EN.xml"/>-->
- </SecurityLayer>
- <MOA-SP>
- <!-- URL und akzeptierte TLS-Server-Zertifikate des MOA-SP Web Service, falls MOA-SP ueber Web Service angesprochen wird.
- Wenn MOA-SP direkt ueber API aufgerufen werden soll, so wird das Element auskommentiert -->
- <!-- ConnectionParameter URL="http://localhost:8080/moa-spss/services/SignatureVerification"/ -->
- <!-- <AcceptedServerCertificates>certs/server-certs</AcceptedServerCertificates> -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- <!-- </ConnectionParameter> -->
- <!-- TrustProfile fuer den IdentityLink der Buergerkarte (muss in MOA-SP konfiguriert sein) -->
- <VerifyIdentityLink>
- <TrustProfileID>MOAIDBuergerkartePersonenbindung</TrustProfileID>
- </VerifyIdentityLink>
- <!-- TrustProfile fuer die Signatur des Benutzers mit der Buergerkarte (muss in MOA-SP konfiguriert sein) -->
- <VerifyAuthBlock>
- <TrustProfileID>MOAIDBuergerkarteAuthentisierungsDaten</TrustProfileID>
- <!-- VerifyTransformsInfoProfile mit den Transformationen fuer die Anzeige der Anmeldedaten im Secure Viewer (muss in MOA-SP konfiguriert sein) -->
- <!-- Wählen Sie hier entsprechende der Sprachauswahl im Element <SecurityLayer><TransformsInfo> das deutsche oder englische Profil -->
- <VerifyTransformsInfoProfileID>MOAIDTransformAuthBlockTable_DE</VerifyTransformsInfoProfileID>
- <!--<VerifyTransformsInfoProfileID>MOAIDTransformAuthBlockTable_EN</VerifyTransformsInfoProfileID>-->
- </VerifyAuthBlock>
- </MOA-SP>
- <VerifyInfoboxes>
- <DefaultTrustProfile>
- <TrustProfileID>GlobalVIDefaultTrust</TrustProfileID>
- </DefaultTrustProfile>
- <Infobox Identifier="InfoboxA"/>
- <Infobox Identifier="InfoboxB" required="true" provideStammzahl="true" provideIdentityLink="false">
- <FriendlyName>Beispiel Infobox B</FriendlyName>
- <TrustProfileID>GlobalInfoboxBTrust</TrustProfileID>
- <SchemaLocations>
- <Schema namespace="http://ns1.ns1" schemaLocation="schemas/ns1.xsd"/>
- <Schema namespace="http://ns2.ns2" schemaLocation="schemas/ns2.xsd"/>
- </SchemaLocations>
- <ApplicationSpecificParameters>
- <Parameter1>content1</Parameter1>
- <Parameter2>content2</Parameter2>
- <Parameter3>
- <Parameter3a>content3a</Parameter3a>
- <Parameter3b>content3b</Parameter3b>
- </Parameter3>
- </ApplicationSpecificParameters>
- </Infobox>
- </VerifyInfoboxes>
- <!-- Einstellungen für den Zugriff auf das Stammzahlenregister-Gateway - für ausländische Personen -->
- <ForeignIdentities>
- <!-- Echtsystem (Eintragung ins ERnP nur mit Echtkarten gemäß E-Government Gleichwertigkeits Verordnung) -->
- <ConnectionParameter URL="https://gateway.stammzahlenregister.gv.at/services/IdentityLinkCreation">
- <!-- Testsystem (Eintragung ins ERnP - auch für Testkarten) -->
- <!--<ConnectionParameter URL="https://gateway.stammzahlenregister.gv.at:8443/services/IdentityLinkCreation">-->
- <!-- Geben Sie hier ihren Client Keystore für den Zugriff auf das Stammzahlenregister-Gateway an -->
- <!-- Voraussetzung: A-Trust oder A-CERT Zertifikat mit Verwaltungseigenschaft oder Dienstleistereigenschaft. -->
- <!-- Wenn ihr MOA-ID Zertifikat diese Voraussetzung erfüllt, können Sie dieses hier angeben. -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- </ConnectionParameter>
- </ForeignIdentities>
- <!-- Einstellungen für den Zugriff auf das Online-Vollmachten Service -->
- <!-- <OnlineMandates> -->
- <!-- Echtsystem -->
- <!-- <ConnectionParameter URL="https://vollmachten.stammzahlenregister.gv.at/mis/MandateIssueRequest">-->
- <!-- Testsystem -->
- <!-- <ConnectionParameter URL="https://vollmachten.stammzahlenregister.gv.at/mis-test/MandateIssueRequest">-->
- <!-- Geben Sie hier ihren Client Keystore für den Zugriff auf das Online-Vollmachten System an -->
- <!-- Voraussetzung: A-Trust oder A-CERT Zertifikat mit Verwaltungseigenschaft oder Dienstleistereigenschaft. -->
- <!-- Wenn ihr MOA-ID Zertifikat diese Voraussetzung erfüllt, können Sie dieses hier angeben. -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- <!-- </ConnectionParameter> -->
- <!-- Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu aktivieren, müssen Sie das Vollmachten Profil angeben -->
- <!-- (siehe Element OnlineMandates unter MOA-IDConfiguration/AuthComponent/OnlineMandates)-->
- <!-- </OnlineMandates> -->
- </AuthComponent>
- <!-- Eintragung fuer jede Online-Applikation -->
- <!-- publicURLPrefix referenziert hier keine richtige Online Applikation; muss angepasst werden -->
- <!-- erste Online-Applikation -->
- <OnlineApplication publicURLPrefix="https://OA1/">
- <!-- fuer MOA-ID-AUTH -->
- <AuthComponent slVersion="1.2">
- <VerifyInfoboxes>
- <DefaultTrustProfile>
- <TrustProfileID>LocalOA1DefaultTrust</TrustProfileID>
- </DefaultTrustProfile>
- <!-- InfoboxB -->
- <Infobox Identifier="InfoboxB" required="true">
- <FriendlyName>Demo Infobox B</FriendlyName>
- <ValidatorClass>oa1.validate.InfoboxBValidator</ValidatorClass>
- <SchemaLocations>
- <Schema namespace="http://ns1.ns1" schemaLocation="schemas/local/ns1oa1.xsd"/>
- <Schema namespace="http://ns2.ns2" schemaLocation="schemas/local/ns2oa1.xsd"/>
- </SchemaLocations>
- </Infobox>
- <!-- InfoboxC -->
- <Infobox Identifier="InfoboxC">
- <FriendlyName>Demo Infobox C</FriendlyName>
- <TrustProfileID>LocalInfoboxOA1CTrust</TrustProfileID>
- </Infobox>
- <!-- InfoboxD -->
- <Infobox Identifier="InfoboxD"/>
- </VerifyInfoboxes>
- </AuthComponent>
- </OnlineApplication>
- <!-- zweite Online-Applikation -->
- <OnlineApplication publicURLPrefix="https://OA2/">
- <!-- fuer MOA-ID-AUTH -->
- <AuthComponent>
- <VerifyInfoboxes>
- <!-- InfoboxA -->
- <Infobox Identifier="InfoboxA">
- <TrustProfileID>LocalInfoboxOA2ATrust</TrustProfileID>
- </Infobox>
- <!-- InfoboxB -->
- <Infobox Identifier="InfoboxB"/>
- </VerifyInfoboxes>
- </AuthComponent>
- </OnlineApplication>
- <!-- dritte Online-Applikation -->
- <OnlineApplication publicURLPrefix="https://OA3/">
- <AuthComponent provideStammzahl="true"/>
- </OnlineApplication>
- <!-- ChainingModes fuer die Zertifikatspfadueberpruefung der TLS-Zertifikate -->
- <ChainingModes systemDefaultMode="pkix">
- </ChainingModes>
- <!-- fuer MOA-ID-AUTH: CA-Zertifikat des Servers MOA-SP, falls dieses Service ueber HTTPS angesprochen wird
- zusaeztlich: CA-Zertifikat aller Online-Applikationen, die ueber HTTPS angesprochen werden -->
- <TrustedCACertificates>certs/ca-certs</TrustedCACertificates>
- <!-- Cache-Verzeichnis fuer-Zertifikate -->
- <!-- Hinweis: wenn TC in linux oder unix betrieben wird vollstaendigen pfad fuer DirectoryCertStoreParameters.RootDir verwenden -->
- <GenericConfiguration name="DirectoryCertStoreParameters.RootDir" value="certs/certstore"/>
- <!-- Time-Out fuer die Anmeldung von Beginn bis zum Anlegen der Anmeldedaten, in Sekunden -->
- <GenericConfiguration name="AuthenticationSession.TimeOut" value="600"/>
- <!-- Time-Out fuer die Anmeldung vom Anlegen bis zum Abholen der Anmeldedaten, in Sekunden -->
- <GenericConfiguration name="AuthenticationData.TimeOut" value="120"/>
- <!-- Alternatives Data URL prefix (falls Webserver vorgeschaltet wird) -->
- <!--GenericConfiguration name="FrontendServlets.DataURLPrefix" value="https://<your_webserver>/moa-id-auth/"/ -->
- <!-- HTTP Verbindung auf Frontend Servlets zulassen / verbieten (falls Webserver vorgeschaltet wird) -->
- <!-- GenericConfiguration name="FrontendServlets.EnableHTTPConnection" value="true"/ -->
- <!-- URL Liste der vertrauenwürdigen Bürgekartenumgebungen -->
- <TrustedBKUs>
- <BKUURL>https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx</BKUURL>
- <BKUURL>https://www.a-trust.at/mobile/https-security-layer-request/default.aspx</BKUURL>
- </TrustedBKUs>
-</MOA-IDConfiguration>
diff --git a/id/server/doc/moa_id/examples/Template.html b/id/server/doc/moa_id/examples/Template.html
deleted file mode 100644
index 5074f5beb..000000000
--- a/id/server/doc/moa_id/examples/Template.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>MOA ID - Identifizierter Zugang mit B&uuml;rgerkarte</title>
-</head>
-
-<body>
-<img src="/moaid-templates/SampleLogo.gif" alt='Organisation XY'>
-<h1 align="center">Sicherer Zugang zur Online-Anwendung mit B&uuml;rgerkarte</h1>
-<p></p>
-
-Der identifizierte Zugang erfolgt &uuml;ber die Module f&uuml;r Online Applikationen (MOA) unter Verwendung einer B&uuml;rgerkarte und deren Signaturfunktion.
-
-<p></p>
-<p>Wenn Sie in Folge die Schaltfl&auml;che "Anmeldung mit B&uuml;rgerkarte"
-aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese
-signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.</p>
-
-
-<form name="CustomizedForm" action="<BKU>" method="post">
-<div align="center">
-<input type="hidden"
-name="XMLRequest"
-value="<XMLRequest>"/>
-<input type="hidden"
-name="DataURL"
-value="<DataURL>"/>
-<input type="hidden"
-name="PushInfobox"
-value="<PushInfobox>"/>
-
-<input type="submit" value="Anmeldung mit B&uuml;rgerkarte" name="submit"/>
-</div>
-</form>
-<form name="CustomizedInfoForm"
-action="<BKU>"
-method="post">
-<input type="hidden"
-name="XMLRequest"
-value="<CertInfoXMLRequest>"/>
-<input type="hidden"
-name="DataURL"
-value="<CertInfoDataURL>"/>
-
-
-<input type="hidden" value="Weitere Info"/>
-</form>
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/examples/TransformsInfoAuthBlockTable_DE.xml b/id/server/doc/moa_id/examples/TransformsInfoAuthBlockTable_DE.xml
deleted file mode 100644
index 4ec0f94ae..000000000
--- a/id/server/doc/moa_id/examples/TransformsInfoAuthBlockTable_DE.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<sl10:TransformsInfo>
- <dsig:Transforms xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
- <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" exclude-result-prefixes="pr saml">
- <xsl:output method="xml" xml:space="default"/>
- <xsl:template match="/" xmlns="http://www.w3.org/1999/xhtml">
- <html>
- <head>
- <title>Signatur der Anmeldedaten</title>
- <style type="text/css" media="screen">
- .normalstyle { font-size: medium; }
- .italicstyle { font-size: medium; font-style: italic; }
- .titlestyle{ text-decoration:underline; font-weight:bold; font-size: medium; }
- .h4style{ font-size: large; }
- </style>
- </head>
- <body>
- <h4 class="h4style">Anmeldedaten:</h4>
- <p class="titlestyle">Daten zur Person</p>
- <table class="parameters">
- <xsl:if test="normalize-space(//@Issuer)">
- <tr>
- <td class="italicstyle">Name:</td>
- <td class="normalstyle">
- <xsl:value-of select="//@Issuer"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="string(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue)">
- <tr>
- <td class="italicstyle">Geburtsdatum:</td>
- <td class="normalstyle">
- <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,9,2)"/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,6,2)"/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring(//saml:Attribute[@AttributeName='Geburtsdatum']/saml:AttributeValue,1,4)"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='OIDTextualDescription']">
- <tr>
- <td class="italicstyle">Rolle:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='OIDTextualDescription']/saml:AttributeValue"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='mandateReferenceValue']">
- <tr>
- <td class="italicstyle">Vollmacht:</td>
- <td class="normalstyle">
- <xsl:text>Ich melde mich in Vertretung an. Im nächsten Schritt wird mir eine Liste der für mich verfügbaren Vertretungsverhältnisse angezeigt, aus denen ich eines auswählen werde.</xsl:text>
- </td>
- </tr>
- </xsl:if>
- </table>
- <p class="titlestyle">Daten zur Anwendung</p>
- <table class="parameters">
- <tr>
- <td class="italicstyle">Name:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='oaFriendlyName']/saml:AttributeValue"/>
- </td>
- </tr>
- <tr>
- <td class="italicstyle">Staat:</td>
- <td class="normalstyle">Österreich</td>
- </tr>
- </table>
- <p class="titlestyle">Technische Parameter</p>
- <table class="parameters">
- <tr>
- <td class="italicstyle">URL:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='OA']/saml:AttributeValue"/>
- </td>
- </tr>
- <xsl:if test="//saml:Attribute[@AttributeName='Geschaeftsbereich']">
- <tr>
- <td class="italicstyle">Bereich:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='Geschaeftsbereich']/saml:AttributeValue"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='mandateReferenceValue']">
- <tr>
- <td class="italicstyle">
- Vollmachten-Referenz:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='mandateReferenceValue']"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='IdentityLinkDomainIdentifierType']">
- <tr>
- <td class="italicstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='IdentityLinkDomainIdentifierType']"/>:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='wbPK']/saml:AttributeValue/pr:Identification/pr:Type"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='bPK'] or //saml:Attribute[@AttributeName='wbPK']">
- <tr>
- <td class="italicstyle">Identifikator:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='bPK']/saml:AttributeValue/pr:Identification/pr:Value"/>
- <xsl:value-of select="//saml:Attribute[@AttributeName='wbPK']/saml:AttributeValue/pr:Identification/pr:Value"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='OIDTextualDescription']">
- <tr>
- <td class="italicstyle">OID:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='OID']/saml:AttributeValue"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="//saml:Attribute[@AttributeName='HPI']">
- <tr>
- <td class="italicstyle">HPI:</td>
- <td class="normalstyle">
- <xsl:value-of select="//saml:Attribute[@AttributeName='HPI']/saml:AttributeValue"/>
- </td>
- </tr>
- </xsl:if>
- <tr>
- <td class="italicstyle">Datum:</td>
- <td class="normalstyle">
- <xsl:value-of select="substring(//@IssueInstant,9,2)"/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring(//@IssueInstant,6,2)"/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring(//@IssueInstant,1,4)"/>
- </td>
- </tr>
- <tr>
- <td class="italicstyle">Uhrzeit:</td>
- <td class="normalstyle">
- <xsl:value-of select="substring(//@IssueInstant,12,2)"/>
- <xsl:text>:</xsl:text>
- <xsl:value-of select="substring(//@IssueInstant,15,2)"/>
- <xsl:text>:</xsl:text>
- <xsl:value-of select="substring(//@IssueInstant,18,2)"/>
- </td>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </dsig:Transform>
- <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
- </dsig:Transforms>
- <sl10:FinalDataMetaInfo>
- <sl10:MimeType>application/xhtml+xml</sl10:MimeType>
- </sl10:FinalDataMetaInfo>
-</sl10:TransformsInfo>
diff --git a/id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml b/id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml
deleted file mode 100644
index 2cdc61653..000000000
--- a/id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<MOA-IDConfiguration xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:sl10="http://www.buergerkarte.at/namespaces/securitylayer/20020225#" xmlns:sl11="http://www.buergerkarte.at/namespaces/securitylayer/20020831#">
- <!-- Konfiguration fuer MOA-ID-AUTH -->
- <AuthComponent>
- <!-- Transformationen fuer die Anzeige des AUTH-Block im Secure Viewer -->
- <SecurityLayer>
- <!-- Wählen Sie hier den deutschen oder englischen Auswahltext -->
- <TransformsInfo filename="transforms/TransformsInfoAuthBlockTable_DE.xml"/>
- <!-- <TransformsInfo filename="transforms/TransformsInfoAuthBlockTable_EN.xml"/>-->
- </SecurityLayer>
- <MOA-SP>
- <!-- URL und akzeptierte TLS-Server-Zertifikate des MOA-SP Web Service, falls MOA-SP ueber Web Service angesprochen wird.
- Wenn MOA-SP direkt ueber API aufgerufen werden soll, so wird das Element auskommentiert -->
- <!-- ConnectionParameter URL="http://localhost:8080/moa-spss/services/SignatureVerification"/ -->
- <!-- <AcceptedServerCertificates>certs/server-certs</AcceptedServerCertificates> -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- <!-- </ConnectionParameter> -->
- <!-- TrustProfile fuer den IdentityLink der Buergerkarte (muss in MOA-SP konfiguriert sein) -->
- <VerifyIdentityLink>
- <TrustProfileID>MOAIDBuergerkartePersonenbindung</TrustProfileID>
- </VerifyIdentityLink>
- <!-- TrustProfile fuer die Signatur des Benutzers mit der Buergerkarte (muss in MOA-SP konfiguriert sein) -->
- <VerifyAuthBlock>
- <TrustProfileID>MOAIDBuergerkarteAuthentisierungsDaten</TrustProfileID>
- <!-- VerifyTransformsInfoProfile mit den Transformationen fuer die Anzeige der Anmeldedaten im Secure Viewer (muss in MOA-SP konfiguriert sein) -->
- <!-- Wählen Sie hier entsprechende der Sprachauswahl im Element <SecurityLayer><TransformsInfo> das deutsche oder englische Profil -->
- <VerifyTransformsInfoProfileID>MOAIDTransformAuthBlockTable_DE</VerifyTransformsInfoProfileID>
- <!--<VerifyTransformsInfoProfileID>MOAIDTransformAuthBlockTable_EN</VerifyTransformsInfoProfileID>-->
- </VerifyAuthBlock>
- </MOA-SP>
- <!-- Einstellungen für den Zugriff auf das Stammzahlenregister-Gateway - für ausländische Personen -->
- <ForeignIdentities>
- <!-- Echtsystem (Eintragung ins ERnP nur mit Echtkarten gemäß E-Government Gleichwertigkeits Verordnung) -->
- <ConnectionParameter URL="https://gateway.stammzahlenregister.gv.at/services/IdentityLinkCreation">
- <!-- Testsystem (Eintragung ins ERnP - auch für Testkarten) -->
- <!--<ConnectionParameter URL="https://gateway.stammzahlenregister.gv.at:8443/services/IdentityLinkCreation">-->
- <!-- Geben Sie hier ihren Client Keystore für den Zugriff auf das Stammzahlenregister-Gateway an -->
- <!-- Voraussetzung: A-Trust oder A-CERT Zertifikat mit Verwaltungseigenschaft oder Dienstleistereigenschaft. -->
- <!-- Wenn ihr MOA-ID Zertifikat diese Voraussetzung erfüllt, können Sie dieses hier angeben. -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- </ConnectionParameter>
- </ForeignIdentities>
- <!-- Einstellungen für den Zugriff auf das Online-Vollmachten Service -->
- <!-- <OnlineMandates> -->
- <!-- Echtsystem -->
- <!-- <ConnectionParameter URL="https://vollmachten.stammzahlenregister.gv.at/mis/MandateIssueRequest">-->
- <!-- Testsystem -->
- <!-- <ConnectionParameter URL="https://vollmachten.stammzahlenregister.gv.at/mis-test/MandateIssueRequest">-->
- <!-- Geben Sie hier ihren Client Keystore für den Zugriff auf das Online-Vollmachten System an -->
- <!-- Voraussetzung: A-Trust oder A-CERT Zertifikat mit Verwaltungseigenschaft oder Dienstleistereigenschaft. -->
- <!-- Wenn ihr MOA-ID Zertifikat diese Voraussetzung erfüllt, können Sie dieses hier angeben. -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- <!-- </ConnectionParameter> -->
- <!-- Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu aktivieren, müssen Sie das Vollmachten Profil angeben -->
- <!-- (siehe Element OnlineMandates unter MOA-IDConfiguration/AuthComponent/OnlineMandates)-->
- <!-- </OnlineMandates> -->
- </AuthComponent>
-
- <!-- Konfiguration fuer MOA-ID-PROXY -->
- <ProxyComponent>
- <!-- URL und akzeptierte TLS-Server-Zertifikate des MOA-ID-AUTH Web Service -->
- <AuthComponent>
- <ConnectionParameter URL="http://localhost:8080/moa-id-auth/services/GetAuthenticationData">
- <!-- <AcceptedServerCertificates>certs/server-certs</AcceptedServerCertificates> -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- </ConnectionParameter>
- </AuthComponent>
- </ProxyComponent>
-
- <!-- Eintragung fuer jede Online-Applikation -->
- <!-- Demo Online-Applikation: Zugriff auf www.digitales.oesterreich.gv.at ueber MOA-ID-PROXY -->
- <OnlineApplication publicURLPrefix="https://localhost:8443/">
- <!-- fuer MOA-ID-AUTH -->
- <AuthComponent>
- <!-- Spezifikation der Stammzahl des Wirtschaftsunternehmens bei type = "businessService" -->
- <!-- <IdentificationNumber> -->
- <!-- Beispiel Firmenbuchnummer -->
- <!-- <pr:Firmenbuchnummer xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#">468924i</pr:Firmenbuchnummer> -->
- <!-- </IdentificationNumber> -->
- </AuthComponent>
- <!-- fuer MOA-ID-PROXY -->
- <ProxyComponent configFileURL="oa/SampleOAConfiguration.xml" sessionTimeOut="600">
- <!-- <ProxyComponent configFileURL="oa/SampleOAConfiguration.xml" sessionTimeOut="600" loginParameterResolverImpl="at.gv.egovernment.moa.id.proxy.DefaultLoginParameterResolver" loginParameterResolverConfiguration="" connectionBuilderImpl="at.gv.egovernment.moa.id.proxy.DefaultConnectionBuilder"> -->
- <!-- URL und akzeptierte TLS-Server-Zertifikate der Online-Applikation -->
- <ConnectionParameter URL="http://www.digitales.oesterreich.gv.at/">
- <!-- <AcceptedServerCertificates>certs/server-certs</AcceptedServerCertificates> -->
- <!-- <ClientKeyStore password="Keystore Pass">file_to_clientkeystore</ClientKeyStore> -->
- </ConnectionParameter>
- </ProxyComponent>
- </OnlineApplication>
-
- <!-- ChainingModes fuer die Zertifikatspfadueberpruefung der TLS-Zertifikate -->
- <ChainingModes systemDefaultMode="pkix">
- </ChainingModes>
-
- <!-- fuer MOA-ID-AUTH: CA-Zertifikat des Servers MOA-SP, falls dieses Service ueber HTTPS angesprochen wird
- fuer MOA-ID-PROXY: CA-Zertifikat des Servers MOA-ID-AUTH, falls dieses Service ueber HTTPS angesprochen wird
- zusaeztlich: CA-Zertifikat aller Online-Applikationen, die ueber HTTPS angesprochen werden -->
- <TrustedCACertificates>certs/ca-certs</TrustedCACertificates>
-
- <!-- Cache-Verzeichnis fuer-Zertifikate -->
- <!-- Hinweis: wenn TC in linux oder unix betrieben wird vollstaendigen pfad fuer DirectoryCertStoreParameters.RootDir verwenden -->
- <GenericConfiguration name="DirectoryCertStoreParameters.RootDir" value="certs/certstore"/>
- <!-- Time-Out fuer die Anmeldung von Beginn bis zum Anlegen der Anmeldedaten, in Sekunden -->
- <GenericConfiguration name="AuthenticationSession.TimeOut" value="600"/>
- <!-- Time-Out fuer die Anmeldung vom Anlegen bis zum Abholen der Anmeldedaten, in Sekunden -->
- <GenericConfiguration name="AuthenticationData.TimeOut" value="120"/>
-
- <!-- Alternatives Data URL prefix (falls Webserver vorgeschaltet wird) -->
- <!--GenericConfiguration name="FrontendServlets.DataURLPrefix" value="https://<your_webserver>/moa-id-auth/"/ -->
- <!-- HTTP Verbindung auf Frontend Servlets zulassen / verbieten (falls Webserver vorgeschaltet wird) -->
- <!-- GenericConfiguration name="FrontendServlets.EnableHTTPConnection" value="true"/ -->
- <!-- URL Liste der vertrauenwürdigen Bürgekartenumgebungen -->
- <TrustedBKUs>
- <BKUURL>https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx</BKUURL>
- <BKUURL>https://www.a-trust.at/mobile/https-security-layer-request/default.aspx</BKUURL>
- </TrustedBKUs>
-</MOA-IDConfiguration>
diff --git a/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml
deleted file mode 100644
index fc99cea79..000000000
--- a/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Demokonfiguration fuer eine Online Applikation (OA) welche 401 Basic Authentication zur Uebergabe der Parameter verwendet -->
-<Configuration xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:sl10="http://www.buergerkarte.at/namespaces/securitylayer/20020225#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <LoginType>stateless</LoginType>
- <BasicAuth>
- <UserID>MOAFamilyName</UserID>
- <Password>MOAGivenName</Password>
- </BasicAuth>
-</Configuration>
diff --git a/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml
deleted file mode 100644
index 4d34c3646..000000000
--- a/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Demokonfiguration fuer eine Online Applikation (OA) welche Header Authentication zur Uebergabe der Parameter verwendet -->
-<Configuration xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:sl10="http://www.buergerkarte.at/namespaces/securitylayer/20020225#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <LoginType>stateless</LoginType>
- <HeaderAuth>
- <!-- zusaetzlicher Header GivenName -->
- <Header Name="X-MOAParameterGivenName" Value="MOAGivenName"></Header>
- <Header Name="X-MOAParameterFamilyName" Value="MOAFamilyName"></Header>
- </HeaderAuth>
-</Configuration>
diff --git a/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml
deleted file mode 100644
index 979faca95..000000000
--- a/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Demokonfiguration fuer eine Online Applikation (OA) welche Parameter Authentication verwendet -->
-<Configuration xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:sl10="http://www.buergerkarte.at/namespaces/securitylayer/20020225#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <LoginType>stateless</LoginType>
- <ParamAuth>
- <!-- URL Parameter GivenName und FamilyName -->
- <Parameter Name="GivenName" Value="MOAGivenName"></Parameter>
- <Parameter Name="FamilyName" Value="MOAFamilyName"></Parameter>
- </ParamAuth>
-</Configuration>
diff --git a/id/server/doc/moa_id/examples/moa-id-env.sh.txt b/id/server/doc/moa_id/examples/moa-id-env.sh.txt
deleted file mode 100644
index 466b2762e..000000000
--- a/id/server/doc/moa_id/examples/moa-id-env.sh.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-rem insert Tomcat 4.1.x home directory (no trailing path separator)
-set CATALINA_HOME=<Tomcat home directory>
-
-CONFIG_OPT_SPSS=-Dmoa.spss.server.configuration=$CATALINA_HOME/conf/moa-spss/SampleMOASPSSConfiguration.xml
-CONFIG_OPT_ID=-Dmoa.id.configuration=$CATALINA_HOME/conf/moa-id/SampleMOAIDConfiguration.xml
-
-
-LOGGING_OPT=-Dlog4j.configuration=file:$CATALINA_HOME/conf/moa-id/log4j.properties
-# TRUST_STORE_OPT=-Djavax.net.ssl.trustStore=truststore.jks
-# TRUST_STORE_PASS_OPT=-Djavax.net.ssl.trustStorePassword=changeit
-# TRUST_STORE_TYPE_OPT=-Djavax.net.ssl.trustStoreType=jks
-
-export CATALINA_OPTS="$CONFIG_OPT_SPSS $CONFIG_OPT_ID $LOGGING_OPT $TRUST_STORE_OPT $TRUST_STORE_PASS_OPT $TRUST_STORE_TYPE_OPT"
-echo CATALINA_OPTS=$CATALINA_OPTS
-
diff --git a/id/server/doc/moa_id/examples/startTomcat.bat.txt b/id/server/doc/moa_id/examples/startTomcat.bat.txt
deleted file mode 100644
index 29588120c..000000000
--- a/id/server/doc/moa_id/examples/startTomcat.bat.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-rem ----------------------------------------------------------------------------------------------
-rem Modify these entries according to your needs
-
-rem JDK home directory (no trailing path separator)
-set JAVA_HOME=<jdk home directory>
-
-rem Tomcat 4.1.x home directory (no trailing path separator)
-set CATALINA_HOME=<Tomcat 4.1.x home directory>
-
-rem ----------------------------------------------------------------------------------------------
-
-set CONFIG_OPT_SPSS=-Dmoa.spss.server.configuration=%CATALINA_HOME%/conf/moa-spss/SampleMOASPSSConfiguration.xml
-set CONFIG_OPT_ID=-Dmoa.id.configuration=%CATALINA_HOME%/conf/moa-id/SampleMOAIDConfiguration.xml
-set LOGGING_OPT=-Dlog4j.configuration=file:%CATALINA_HOME%/conf/moa-id/log4j.properties
-
-set PARAMS_MOA=%CONFIG_OPT_SPSS% %CONFIG_OPT_ID% %LOGGING_OPT%
-
-rem set PARAM_TRUST_STORE=-Djavax.net.ssl.trustStore=truststore.jks
-rem set PARAM_TRUST_STORE_PASS=-Djavax.net.ssl.trustStorePassword=changeit
-rem set PARAM_TRUST_STORE_TYPE=-Djavax.net.ssl.trustStoreType=jks
-rem set PARAMS_SSL=%PARAM_TRUST_STORE% %PARAM_TRUST_STORE_PASS% %PARAM_TRUST_STORE_TYPE%
-
-set CATALINA_OPTS=%PARAMS_MOA% %PARAMS_SSL%
-
-cd %CATALINA_HOME%
-bin\catalina.bat start \ No newline at end of file
diff --git a/id/server/doc/moa_id/faqs.htm b/id/server/doc/moa_id/faqs.htm
deleted file mode 100644
index 5752f1123..000000000
--- a/id/server/doc/moa_id/faqs.htm
+++ /dev/null
@@ -1,147 +0,0 @@
-<html>
-<head>
- <title>MOA-ID FAQs</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
-<p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">FAQ - H&auml;ufig gestellte Fragen </p>
- <hr/>
-
-
- <dl>
- <dt>
- <!-- Projekt-Logo -->
- </dt>
- <p><b><a href="#frage1">Frage</a><a href="#frage4">&nbsp;</a><a href="#frage1">1</a></b> Mit dem Internet Explorer kommt es bei einer Anmeldung an der lokal
- installierten Version von MOA-ID zu Fehlern beim Redirect. Warum?</p>
- <p> <b><a href="#frage2">Frage</a><a href="#frage4">&nbsp;</a><a href="#frage2">2</a></b> Wenn die Proxy-Komponente lokal l&auml;uft und per TLS/SSL aufgerufen
- wird, kommt es zu einer Fehlermeldung. Wie kann dies verhindert werden?</p>
- <p><b><a href="#frage3">Frage</a><a href="#frage4">&nbsp;</a><a href="#frage3">3</a></b> Es soll serverseitig lediglich starke TLS/SSL Verschl&uuml;sselung (&gt;100
- Bit) unterst&uuml;tzt werden. Wie kann dies erzwungen werden?</p>
- <p><b><a href="#frage4">Frage&nbsp;4 </a></b>Beim Starten von
- MOA ID bzw. MOA SPSS tritt folgende Exception auf: <tt>java.lang.ClassCastException:
- iaik.asn1.structures.Name</tt>. Was kann der Fehler sein?<b><a href="#frage3"></a></b></p>
- <p><b><a href="#frage5">Frage&nbsp;5</a></b> Ich m&ouml;chte
- MOA in einer Umgebung betreiben, die einen Internet-Zugang nur &uuml;ber
- einen Proxy erlaubt. Funktioniert das?</p>
- <p><b><a href="#frage6">Frage&nbsp;6</a></b> Tomcat: W&auml;rend
- des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException.
- Wie kann dies verhindert werden?</p>
- <hr>
- <p></p>
- <p><a name="frage1"></a><b>Frage 1</b></p>
- <p><b>Q: </b>Mit dem Internet Explorer kommt es bei einer Anmeldung
- an der lokal installierten Version von MOA-ID zu Fehlern beim Redirect.
- Warum?</p>
- <p><b>A:</b> Aufgrund eines Fehlers in Microsofts Internet
- Explorer schl&auml;gt der (lokale) Redirect auf dem lokal installierten
- Tomcat fehl.</p>
- <p> Als Workaround empfiehlt es sich, zum lokalen Testen einen
- alternativen Browser wie <a href="http://www.opera.com/">Opera</a>, <a href="http://www.mozilla.org/">Mozilla</a> oder <a href="http://www.netscape.org/">Netscape</a> zu verwenden, da diese Probleme dort nicht auftreten. Von einem anderen
- Rechner aus kann jedoch die Anmeldung an MOA-ID auch mit dem Internet
- Explorer erfolgen. </p>
- <hr />
- <p><a name="frage2"></a><b>Frage 2</b></p>
- <p> <b>Q: </b>Wenn die Proxy-Komponente lokal l&auml;uft und
- per TLS/SSL aufgerufen wird, kommt es zu einer Fehlermeldung. Wie kann
- dies verhindert werden?</p>
- <p> <b>A:</b> Wenn in der Konfiguration statt 'localhost' der
- eigene Rechnername verwendet wird, funktioniert die Proxy-Komponente
- wie gewohnt.<br>
- <br />
- Zum Herausfinden des Rechnernamens wechselt man unter Windows auf die
- Kommandozeile und kann mittels 'ipconfig /all' den Rechnernamen herausfinden.
- Unix/Linux-Anwender sehen bspw. mittels 'cat' in der Datei /etc/hosts
- nach, der Texteintrag hinter der eigenen IP-Adresse spezifiziert den
- Rechnernamen. </p>
- <hr />
- <p><a name="frage3"></a><b>Frage 3</b></p>
- <p> <b>Q: </b>Es soll serverseitig lediglich starke TLS/SSL
- Verschl&uuml;sselung (&gt;100 Bit) unterst&uuml;tzt werden. Wie kann
- dies erzwungen werden?</p>
- <p> <b>A: </b>Tomcat bietet (bis dato) keine einfache M&ouml;glichkeit
- die serverseitig verwendeten TLS/SSL Verschl&uuml;sselungsalgorithmen
- zu konfigurieren. Daher empfiehlt es sich in diesem Fall, einen Web-Server
- wie Apache oder den Microsoft Internet-Information-Server f&uuml;r das
- SSL-Handling vorzuschalten und dort in der jeweiligen Konfiguration
- starke Verschl&uuml;sselung zu erzwingen.<b> </b></p>
- <hr />
- <p><b><a name="frage4"></a><b>Frage 4</b></b></p>
-Q: Beim Starten von MOA SPSS tritt folgende Exception auf: <tt>java.lang.ClassCastException:
- iaik.asn1.structures.Name</tt>. Was kann der Fehler sein?
- <p> <b>A:</b> Auf Grund einer mangelhaften Implementierung
- in einigen Versionen des JDK 1.3.1 kann es beim Betrieb von MOA zu folgendem
- Problem kommen: Sun macht in der Implementierung von PKCS7.getCertificate()
- einen Downcast vom Interface java.security.Principal auf die eigene
- Implementierung, was zu einer ClassCastException f&uuml;hrt, wenn der JCE-Provider
- von Sun nicht an erster Stelle in der List der Security-Provider installiert
- ist. MOA geht nun aber so vor, dass der JCE-Provider des IAIK an die
- erste Stelle installiert wird, wenn er zum Zeitpunkt der Konfiguration
- noch nicht installiert war. Wird dann von irgendeinem ClassLoader der
- jar-Verifier ben&uuml;tzt, wird PKCS7.getCertificate() verwendet, und
- es kommt zu einer ClassCastException. </p>
- <p> Wird MOA &uuml;ber die API-Schnittstelle verwendet, ist ein
- Workaround die manuelle Installation des IAIK-JCE-Providers nach dem
- Sun JCE-Provider (etwa an die letzte Stelle), bevor die MOA-Konfiguration
- aufgerufen wird. Bei Verwendung der Webservices ist die M&ouml;glichkeit
- der statischen Konfiguration der JCE-Provider mittels Angabe in der
- Datei $JAVA_HOME/jre/lib/security/java.security der einzige bekannte
- Workaround. Hierzu m&uuml;ssen die Eintr&auml;ge
- <pre>
- security.provider.1=sun.security.provider.Sun
- security.provider.2=com.sun.rsajca.Provider
- </pre>
-durch folgenden Eintrag erg&auml;nzt werden:
-<pre>
- security.provider.3=iaik.security.provider.IAIK
-</pre>
-<p></p>
-<hr />
-<p><a name="frage5"></a><b>Frage 5</b></p>
- <p><b>Q: </b>Ich m&ouml;chte MOA in einer Umgebung betreiben,
- die einen Internet-Zugang nur &uuml;ber einen Proxy erlaubt. Funktioniert
- das?</p>
- <p> <b>A:</b> Ja, zumindest f&uuml;r Zugriffe &uuml;ber HTTP.
- Sie m&uuml;ssen dazu die nachfolgenden JAVA System-Properties setzen:</p>
- <blockquote>
- <p><tt>http.proxyHost=&lt;proxyhost&gt;<br>
- http.proxyPort=&lt;proxyport&gt;<br>
- http.nonProxyHosts=&quot;&lt;exceptionhosts&gt;&quot;</tt></p>
- </blockquote>
- <p><tt>&lt;proxyhost&gt;</tt> gibt den Namen oder die IP-Adresse des
- Proxies an.</p>
- <p><tt>&lt;proxyport&gt;</tt> gibt den Port des Proxies an.</p>
- <p><tt>&lt;exceptionhosts&gt;</tt> enth&auml;lt eine Liste von Rechnernamen,
- die nicht &uuml;ber den Proxy laufen sollen. Jedenfalls m&uuml;ssen
- sie hier <tt>localhost</tt> angeben. Einzelne Namen sind durch eine
- Pipe (<tt>|</tt>) zu trennen. Bitte beachten Sie, dass IP-Addressen
- nicht angegeben werden d&uuml;rfen, sowie die verpflichtend zu verwendenen
- Anf&uuml;hrungszeichen.</p>
-<hr />
-<p><a name="frage6"><b>Frage 6</b></a></p>
-<p><b>Q:</b> Tomcat: W&auml;rend des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException.
- Wie kann dies verhindert werden?</p>
-<p>org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException:
- org.apache.commons.logging.LogConfigurationException<br>
- : Class org.apache.commons.logging.impl.Jdk14Logger does not implement
- Log</p>
-<p><b>A:</b> Dies ist ein Fehler in tomcat in der Version 4.1.27. $CATALINA_HOME\server\lib\tomcat-util.jar muss gegen eine
- gepatchte Version ausgetauscht werden, da ein BUG in der Originalversion
- von tomcat 4.1.27. Diese gepatchte Version ist in der MOA-ID Distribution
- im Verzeichnis $MOA_ID_INST_AUTH\tomcat\tomcat-util-4.1.27-patched\
- zu finden.
-<br />
-</p>
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-admin.htm b/id/server/doc/moa_id/id-admin.htm
deleted file mode 100644
index 56bb80dc8..000000000
--- a/id/server/doc/moa_id/id-admin.htm
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Administration</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Administration </p>
- <hr/>
- <dl>
- <dt><a href="id-admin_0.htm">&Uuml;berblick</a></dt>
- <dd>&Uuml;berblick &uuml;ber die Installation, Konfiguration und optionale Komponenten.</dd>
- <dt><a href="id-admin_1.htm">Basis-Installation</a></dt>
- <dd>Detaillierte Anleitung f&uuml;r die BasisInstallation.</dd>
- <dt><a href="id-admin_2.htm">Konfiguration</a></dt>
- <dd>Detaillierte Anleitung f&uuml;r die Konfiguration.</dd>
- <dt><a href="id-admin_3.htm">Optionale Komponenten</a></dt>
- <dd>Konfiguration optionaler Komponenten. </dd>
- </dl>
-
- <hr/>
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-admin_0.htm b/id/server/doc/moa_id/id-admin_0.htm
deleted file mode 100644
index e7c0ba886..000000000
--- a/id/server/doc/moa_id/id-admin_0.htm
+++ /dev/null
@@ -1,175 +0,0 @@
-<html>
-<head>
- <title>MOA ID-Administration</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Administration-&Uuml;berblick</p>
- <hr/>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#uebersicht">&Uuml;bersicht</a></p>
- </li>
- <li>
- <p><a href="#basisauth">Basis-Installation von MOA-ID-AUTH</a></p>
- </li>
- <li>
- <p><a href="#basisproxy">Basis-Installation von MOA-ID-PROXY</a></p>
- </li>
- <li>
- <p><a href="#webserver">Konfiguration mit vorgeschaltetem Webserver (optional)</a></p>
- </li>
- <li>
- <p><a href="#sql">Konfiguration mit PostgreSQL (optional)</a></p>
- </li>
- <li>
- <p><a href="#software">Referenzierte Software</a></p>
- </li>
-</ol>
- <hr/>
-<h1><a name="uebersicht" id="uebersicht"></a>1 &Uuml;bersicht</h1>
-
- <p>Die Komponenten des Moduls Identifikation (MOA-ID), MOA-ID-AUTH und MOA-ID-PROXY, sind als plattformunabh&auml;ngige Webapplikationen ausgelegt.
-MOA-ID-AUTH ist die Basiskomponente des Moduls, und MOA-ID-PROXY ist eine optionale Zusatzkomponente.
-F&uuml;r den Betrieb dieser Webapplikationen wird eine Java Virtual Machine und ein Java Servlet Container vorausgesetzt.
-<p>
-F&uuml;r den Betrieb von MOA-ID-AUTH sind unterschiedliche Szenarien m&ouml;glich, die unterschiedliche M&ouml;glichkeiten bieten und die Installation unterschiedlicher Software- und Hardware-Komponenten erfordern. Dieser Abschnitt gibt einen kurzen &Uuml;berblick &uuml;ber die notwendige Basis-Installation und optionale weitere Konfigurationsm&ouml;glichkeiten.</p>
-
-<h1><a name="basisauth" id="basisauth"></a>2 Basis-Installation von MOA-ID-AUTH</h1>
-
-<p>Die Basis-Installation stellt einerseits die minimalen Anforderungen f&uuml;r den Betrieb von MOA-ID-AUTH dar, andererseits dient sie als Ausgangspunkt f&uuml;r weitere (optionale) Konfigurations-M&ouml;glichkeiten. <br />
- <br />
- Folgende Software ist Voraussetzung f&uuml;r die Basis-Installation:
-<ul>
- <li>JDK 1.4.0, JDK 1.4.2, JDK 1.5.0 oder JDK 1.6*)</li>
- <li>Tomcat 4.1.31, Tomcat 5.0.28, Tomcat 5.5 oder Tomcat 6</li>
- <li>MOA-ID-AUTH 1.5 </li>
- <li>MOA SP/SS 1.5 oder neuer (entweder als WebService oder direkt als interne Bibliothek)</li>
-</ul>
- <p>*) F&uuml;r den Online-Vollmachten-Modus m&uuml;ssen zumindest JDK 6 Update 22, JDK 5 Update 26 oder JDK 1.4.2 Update 28 eingesetzt werden. </p>
-
- <p> Um m&ouml;glichen Versionskonflikten aus dem Weg zu gehen sollten stets die neuesten Versionen von MOA-ID als auch von MOA-SP/SS verwendet werden. <br/>
- In diesem Betriebs-Szenario wird MOA-ID-AUTH in Tomcat deployt. Tomcat fungiert gleichzeitig als HTTP- und HTTPS-Endpunkt f&uuml;r MOA-ID-AUTH. Beide Protokolle werden direkt in Tomcat konfiguriert. <br/>
- <br/>
- Die Webapplikation verwendet Log4j als Logging Toolkit.</p>
-
-<h1><a name="basisproxy" id="basisproxy"></a>3 Basis-Installation von MOA-ID-PROXY (optional)</h1>
-
-<p>Einer Online-Applikation, f&uuml;r die MOA-ID-AUTH die Authentisierung &uuml;bernimmt, kann die Komponente MOA-ID-PROXY vorgeschaltet werden. Diese Komponente &uuml;bernimmt die Anmeldedaten von MOA-ID-AUTH, f&uuml;hrt die Anmeldung an der Online Applikation durch und schleust in der Folge Daten an die Online-Applikation und Daten an den Benutzer durch.
-
-Die Basis-Installation von MOA-ID-PROXY geschieht im Wesentlichen analog zur Basis-Installation von MOA-ID-AUTH. <br/>
-<br/>
-MOA-ID-AUTH und MOA-ID-PROXY k&ouml;nnen in verschiedenen Konstellationen zum Einsatz gebracht werden: </p>
-<ul>
- <li>auf verschiedenen Rechnern</li>
- <li>auf ein und demselben Rechner in verschiedenen Java Servlet Containern</li>
- <li>auf ein und demselben Rechner in ein und demselben Java Servlet Container</li>
-</ul>
-Ausgehend von der Basis-Installation k&ouml;nnen die optionalen Konfigurationen, die in den nachfolgenden Abschnitten beschrieben werden, unabh&auml;ngig und in beliebiger Kombination aufgesetzt werden.</p>
-
-<h1><a name="webserver" id="webserver"></a>4 Konfiguration mit vorgeschaltetem Webserver (optional)</h1>
-
-<p>
-Den MOA ID Webapplikationen kann jeweils optional ein Webserver vorgeschaltet sein. Unter Microsoft Windows ist das im Regelfall der Microsoft Internet Information Server (MS IIS), auf Unix-Systemen kommt &uuml;blicherweise der Apache Webserver zum Einsatz.
-<br /><br />
- Folgende Software ist unter Windows Voraussetzung:
-
-<ul>
-<li>MS IIS 5.0 </li>
-<li>Jakarta mod_jk 1.2.2 </li>
-</ul>
-Folgende Software ist unter Unix/Linux Voraussetzung:
-<ul>
-<li>Apache Webserver 2.0.x mit mod_SSL </li>
-<li>Jakarta mod_jk 1.2.2 </li>
-</ul>
-</p>
-In diesem Fall &uuml;bernimmt der vorgeschaltete Webserver die Funktion des HTTP- und HTTPS-Endpunktes. Beide Protokolle werden im Webserver konfiguriert.
-<br /><br />
-Mittels mod_jk werden die Webservice-Aufrufe, die im vorgeschalteten Webserver eintreffen, an Tomcat weiter geleitet, bzw. die Antwort von Tomcat wieder an den Webserver zur&uuml;ck &uuml;bermittelt.
-<h1><a name="sql" id="sql"></a>5 Konfiguration mit PostgreSQL (optional)</h1>
-<p>Das MOA ID Webservice kann eine PostgreSQL Datenbank nutzen, um:
-<ul>
- <li>Log-Meldungen zu speichern </li>
-</ul>
-F&uuml;r den Zugriff auf PostgreSQL ist die Installation folgender Software Voraussetzung:
-<ul>
- <li>PostgreSQL 7.3</li>
-</ul>
-<h1><a name="software" id="software"></a>6 Referenzierte Software</h1>
-Die Versionsangaben beziehen sich auf die Versionen, mit denen die MOA ID Webapplikationen entwickelt und getestet wurde. Geringf&uuml;gig andere Software-Versionen stellen &uuml;blicherweise kein Problem dar.
-<br />
- <table border="1" width="48%" cellpadding="2" cellspacing="0">
- <tr>
- <th width="36%">Komponente</th>
- <th width="64%">Getestete Version</th>
- </tr>
- <tr>
- <td width="36%"><b>JDK (SDK)</b></td>
- <td width="64%"><p>min. <a href="http://java.sun.com/j2se/1.4.0/download.html">1.4.0</a> bzw. <a href="http://java.sun.com/j2se/1.4.2/download.html"><br>
- 1.4.2</a><br/>
- <a href="http://java.sun.com/j2se/1.5.0/download.html">1.5.0</a><br/>
- <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">1.6.0</a> </p></td>
- </tr>
- <tr>
- <td width="36%" height="21"><b>Tomcat</b></td>
- <td width="64%" height="21"><p><a href="http://archive.apache.org/dist/tomcat/tomcat-4/v4.1.31/bin/jakarta-tomcat-4.1.31.zip">4.1.31</a><br/>
- <a href="http://tomcat.apache.org/download-55.cgi">5.5.x</a><br/>
- <a href="http://tomcat.apache.org/download-60.cgi">6.0.x</a></p></td>
- </tr>
- <tr>
- <td width="36%"><b>MOA-ID-AUTH </b></td>
- <td width="64%"><a href="http://egovlabs.gv.at/frs/?group_id=6&release_id=5">1.5 (neueste Version) </a></td>
- </tr>
- <tr>
- <td width="36%"><b>MOA-ID-PROXY </b></td>
- <td width="64%"><a href="http://egovlabs.gv.at/frs/?group_id=6&release_id=5">1.5 (neueste Version)</a></td>
- </tr>
- <tr>
- <td width="36%"><b>MOA-SPSS </b></td>
- <td width="64%"><a href="http://egovlabs.gv.at/frs/?group_id=6&release_id=5">1.5 (neueste Version)</a>&#160;</td>
- </tr>
- <tr>
- <td width="36%"><b>Apache Webserver </b></td>
- <td width="64%"><a href="http://httpd.apache.org/">1.3.X</a> bzw.<br>
- <a href="http://httpd.apache.org/">2.0.X</a></td>
- </tr>
- <tr>
- <td width="36%"><b>Microsoft Internet Information Server </b></td>
- <td width="64%"><a href="http://www.microsoft.com/windows2000/en/server/iis/default.asp">5.0</a>&#160; <br/>
- <a href="http://www.microsoft.com/WindowsServer2003/iis/default.mspx">6.0</a>&#160; </td>
- </tr>
- <tr>
- <td width="36%"><b>mod_SSL </b></td>
- <td width="64%">(<a href="http://httpd.apache.org/docs-2.0/ssl/">**</a>)&#160; </td>
- </tr>
- <tr>
- <td width="36%"><b>Jakarta mod_jk </b></td>
- <td width="64%"><a href="http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/">1.2.2&#160;</a></td>
- </tr>
- <tr>
- <td width="36%"><b>Jakarta Log4j </b></td>
- <td width="64%"><a href="http://jakarta.apache.org/log4j/docs/index.html">1.2.8</a>&#160; </td>
- </tr>
- <tr>
- <td width="36%"><b>PostgreSQL </b></td>
- <td width="64%"><a href="http://techdocs.postgresql.org/installguides.php">7.3</a>&#160; </td>
- </tr>
- </table>
-<br />
-(**) passend zur Version des Apache Webservers
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-admin_1.htm b/id/server/doc/moa_id/id-admin_1.htm
deleted file mode 100644
index 940ef4d2d..000000000
--- a/id/server/doc/moa_id/id-admin_1.htm
+++ /dev/null
@@ -1,393 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Administration</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Basis-Installation</p>
- <hr/>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#vorbereitung">Vorbereitung</a></p>
- </li>
- <li>
- <p><a href="#Tomcat">Konfiguration von Tomcat</a></p>
- </li>
- <li>
- <p><a href="#deployment_ak">Deployment von MOA-ID-AUTH in Tomcat</a></p>
- </li>
- <li>
- <p><a href="#deployment_pk">Deployment von MOA-ID-PROXY in Tomcat</a></p>
- </li>
- <li>
- <p><a href="#Tomcat_Start">Starten und Stoppen von Tomcat</a></p>
- </li>
- <li>
- <p><a href="#Logging">Logging</a></p>
- </li>
-</ol>
- <hr/>
-<h1><a name="vorbereitung" id="vorbereitung">1 Vorbereitung</a></h1>
-<p>Bei der Basis-Installation von MOA-ID-AUTH und von MOA-ID-PROXY ist grunds&auml;tzlich gleichartig vorzugehen.
-Unterschiede sind in der Installationsanweisung angef&uuml;hrt.</p>
-<p><b>Installation des JDK</b><br />
-Installieren Sie das JDK in ein
- beliebiges Verzeichnis. Das Wurzelverzeichnis der JDK-Installation
- wird im weiteren Verlauf als $JAVA_HOME bezeichnet. <br />
- <br />
- <b>Installation von Tomcat</b><br />
-Installieren Sie Tomcat in ein Verzeichnis, das <b>keine Leer- und
- Sonderzeichen</b> im Pfadnamen enth&auml;lt. Am Besten verwenden
- die referenzierte Version von Tomcat im zip-Format. (Hinweis f.
- Windows: nicht die selbstinstallierende exe Version verwenden.)
- Das Wurzelverzeichnis der Tomcat-Installation wird im weiteren Verlauf
- als $CATALINA_HOME bezeichnet.<br />
- <br />
- <b>Entpacken der MOA ID Webapplikation</b><br />
-Entpacken Sie die ausgelieferten Dateien der Webapplikation (moa-id-auth-x.y.zip
- oder moa-id-proxy-x.y.zip; ersetzen Sie x.y durch die Releasenummer
- von MOA-ID-AUTH bzw. MOA-ID-PROXY) in ein beliebiges Verzeichnis.
- Diese Verzeichnisse werden im weiteren Verlauf als $MOA_ID_INST_AUTH
- bzw. $MOA_ID_INST_PROXY bezeichnet. <br />
- <br />
- <b>Installation der IAIK JCE und des IAIK LDAP Protocol Handlers</b><br />
-Die Dateien aus dem Verzeichnis $MOA_ID_INST_AUTH/ext (oder $MOA_ID_INST_PROXY/ext)
- m&uuml;ssen in das Verzeichnis $JAVA_HOME/jre/lib/ext kopiert werden.
- Anschlie&szlig;end steht eine Unterst&uuml;tzung f&uuml;r Kryptographie
- und SSL jeder Java-Anwendung die dieses JDK verwendet zur Verf&uuml;gung.<br>
- <br />
-Zus&auml;tzlich m&uuml;ssen die so genannten Unlimited Strength
- Jurisdiction Policy Files heruntergeladen, entpackt
-und ins Verzeichnis $JAVA_HOME/jre/lib/security kopiert werden. </p>
-<p>Der Download f&uuml;r diese Dateien findet sich am unteren Ende
- der Download-Seite des jeweiligen JDK in der Sektion "Other
- Downloads". D.h. JDK <a href="http://java.sun.com/j2se/1.4.0/download.html"> hier f&uuml;r 1.4.0</a>, das JDK <a href="http://java.sun.com/j2se/1.4.2/download.html">hier
- f&uuml;r 1.4.2</a>, das JDK <a href="http://java.sun.com/j2se/1.5.0/download.html">hier
- f&uuml;r 1.5.0</a> bzw. das JDK <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">hier
- f&uuml;r 1.6.0</a></p>
-
-
-<h1><a name="Tomcat" id="Tomcat"></a>2 Konfiguration von Tomcat</h1>
-<b>Minimale Konfiguration</b> <br />
- Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grunds&auml;tzlich mit
- einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enth&auml;lt und viele Ports
- offen l&auml;sst. Die Datei server.xml im Verzeichnis mit der Versionsnummer des verwendeten Tomcats unter $MOA_ID_INST_AUTH/tomcat (bzw. $MOA_ID_INST_PROXY/tomcat) enth&auml;lt eine minimale
- Tomcat-Konfiguration, die je einen Connector f&uuml;r HTTP und f&uuml;r HTTPS freischaltet. Die jeweilige Datei server.mod_jk.xml schaltet zus&auml;tzlich den AJP Connector Port f&uuml;r den Apache Webserver frei (falls diese Datei verwendet werden soll ist sie zuvor noch auf server.xml umzubenennen).<br />
- <br />
- <b>SSL</b><br />
- F&uuml;r den sicheren Betrieb von MOA-ID-AUTH ist die Verwendung von SSL Voraussetzung, sofern nicht ein vorgelagerter WebServer (Apache oder IIS) das SSL-Handling &uuml;bernimmt.
- Ebenso kann SSL auch f&uuml;r MOA-ID-PROXY verwendet werden.
- Das Dokument <a href="http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html" target="_new">Tomcat SSL Configuration HOW-TO</a> gibt einen guten &Uuml;berblick &uuml;ber die Konfiguration von SSL in Tomcat. Da die f&uuml;r SSL notwendigen Bibliotheken bereits im Abschnitt "Vorbereitung" eingebunden wurden, sind nur noch folgende Schritte notwendig:<ul>
- <li>Erstellung eines Server-Keystores, welches den privaten Schl&uuml;ssel des Servers sowie das Server-Zertifikat enth&auml;lt,
- z.B. mit dem <a href="http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html" target="_new"> Java Keytool</a>. <br />
- <b>Hinweis:</b> Standardm&auml;&szlig;ig wird beim Erzeugen eines neuen Keystores im Home-Verzeichnis des Benutzers die Datei ".keystore" angelegt. M&ouml;chte man den Dateinamen und Pfad &auml;ndern, kann man das dem SSL-Connector in $CATALINA_HOME/conf/server.xml durch hinzuf&uuml;gen des Attributes <i>keystoreFile="NAME DES KEYSTORES"</i> im Element &lt;Factory&gt; bekannt machen. Das zum Keystore geh&ouml;rende Passwort &uuml;bergibt man Tomcat mittels des Attributes <i>keystorePass= "PASSWORT DES KEYSTORES"</i> im Element &lt;Factory&gt;. </li>
- <li>Erstellung eines Keystores mit vertrauensw&uuml;rdigen Client-Zertifikaten, z.B. mit dem <a href="http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html" target="_new"> Java Keytool</a> (nur, wenn SSL Client-Authentisierung verwendet werden soll) </li>
- <li>Falls eine Client-Authentisierung gew&uuml;nscht ist, muss die Konfiguration des SSL-Connectors in $CATALINA_HOME/conf/server.xml angepasst werden.</li>
-</ul>
-<b>MOA Administrator</b><br />
- Der Aufruf der URL f&uuml;r die dynamische Konfiguration von MOA-ID-AUTH ist durch eine Passwort-Abfrage gesch&uuml;tzt, und kann nur von Benutzern aufgerufen werden, die der Benutzer-Rolle <tt>moa-admin</tt> zugeordnet werden k&ouml;nnen.<br />
- Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, m&uuml;ssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tt>&lt;tomcat-users&gt;</tt> sinngem&auml;&szlig; folgende Eintr&auml;ge hinzugef&uuml;gt werden:
-<pre>
-&lt;role rolename="moa-admin"/&gt;
-&lt;user username="moa" password="moa" roles="moa-admin"/&gt;</pre>
-
-<h1><a name="deployment_ak" id="deployment_ak"></a>3 Deployment von MOA-ID-AUTH in Tomcat</h1>
-Um MOA-ID-AUTH in Tomcat f&uuml;r den Ablauf vorzubereiten, sind folgende Schritte notwendig: <br />
-
-<ul>
- <li>Die Datei $MOA_ID_INST_AUTH/moa-id-auth.war wird ins Verzeichnis
- $CATALINA_HOME/webapps kopiert. Dort wird sie beim ersten Start
- von Tomcat automatisch ins Verzeichnis $CATALINA_HOME/webapps/moa-id-auth
- entpackt. </li>
- <li>Die MOA-ID Konfigurationsdatei und die zugeh&ouml;rigen Verzeichnisse
- "certs" und "transforms" werden in ein beliebiges Verzeichnis
- im Filesystem kopiert (z.B. $CATALINA_HOME/conf/moa-id). <br />
- Im Verzeichnis $MOA_ID_INST_AUTH/conf/moa-id befinden sich
- acht verschiedene Beispielkonfigurationen, die als Ausgangspunkte
- f&uuml;r die Konfiguration von MOA-ID-AUTH dienen k&ouml;nnen:
- <ul>
- <li>SampleMOAIDConfiguration.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem &ouml;ffentlichen Bereich. <br>
- Karte: B&uuml;rgerkarte <br>
- Konfiguration ohne Proxykomponente</li>
- <li>SampleMOAIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID
- f&uuml;r eine Anwendung aus dem &ouml;ffentlichen Bereich. <br>
- Karte: B&uuml;rgerkarte und Testkarte <br>
- Konfiguration ohne Proxykomponente</li>
- <li>SampleMOAWIDConfiguration.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). <br>
- Karte: B&uuml;rgerkarte <br>
- Konfiguration ohne Proxykomponente</li>
- <li>SampleMOAWIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). <br>
- Karte: B&uuml;rgerkarte und Testkarte <br>
- Konfiguration ohne Proxykomponente</li>
- <li id="sampleProxyConfig">SampleMOAIDConfigurationProxy.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem &ouml;ffentlichen Bereich. <br>
- Karte: B&uuml;rgerkarte <br>
- Konfiguration mit <a href="#deployment_pk">Proxykomponente</a>.</li>
- <li>SampleMOAIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID
- f&uuml;r eine Anwendung aus dem &ouml;ffentlichen Bereich. <br>
- Karte: B&uuml;rgerkarte und Testkarte <br>
- Konfiguration mit <a href="#deployment_pk">Proxykomponente</a></li>
- <li>SampleMOAWIDConfigurationProxy.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). <br>
- Karte: B&uuml;rgerkarte <br>
- Konfiguration mit <a href="#deployment_pk">Proxykomponente</a></li>
- <li>SampleMOAWIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID f&uuml;r
- eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). <br>
- Karte: B&uuml;rgerkarte und Testkarte <br>
- Konfiguration mit <a href="#deployment_pk">Proxykomponente</a></li>
- </ul>
- </li>
- <li>Die endorsed Libraries f&uuml;r Tomcat m&uuml;ssen aus dem
- Verzeichnis $MOA_ID_INST_AUTH/endorsed in das Tomcat-Verzeichnis
- $CATALINA_HOME/common/endorsed kopieren werden. F&uuml;r Tomcat 6 m&uuml;ssen die Dateien in das Verzeichnis $CATALINA_HOME/endorsed kopiert werden (das Verzeichnis endorsed ist dabei im Allgemein erst anzulegen). Folgende Libraries
- sind f&uuml;r das Deployment im endorsed Verzeichnis vorgesehen:
- <ul>
- <li>xalan.jar</li>
- <li>serializer.jar (f&uuml;r Xalan ben&ouml;tigt)</li>
- <li>xml-apis.jar</li>
- <li id="klein2">xercesImpl.jar</li>
- </ul>
- Eventuell vorhandene Dateien mit dem gleichen Namen m&uuml;ssen
- ersetzt werden. Die ggf. in diesem Verzeichnis vorhandene Datei <code>xmlParserAPIs.jar</code> muss gel&ouml;scht werden.</li>
- <li>Folgende Java System Properties sind zu setzen: <br />
- <ul id="klein2">
- <li id="klein2">moa.id.configuration=Name der MOA ID Konfigurationsdatei.
- Eine beispielhafte MOA ID Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/
- SampleMOAIDConfiguration.xml enthalten.</li>
- <li id="klein2">log4j.configuration=URL der Log4j Konfigurationsdatei.
- Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties
- enthalten. </li>
- <li id="klein2">javax.net.ssl.trustStore=Name des Truststores
- f&uuml;r vertrauensw&uuml;rdige SSL Client-Zertifikate (optional;
- nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt werden
- soll). <br>
- </li>
- </ul>
- Diese Java System-Properties werden Tomcat &uuml;ber die Umgebungsvariable
- CATALINA_OPTS mitgeteilt (Beispiel-Skripte zum Setzen dieser
- Properties f&uuml;r <b>Windows</b> und f&uuml;r <b>Unix bzw.
- Linux</b> finden sie unter $MOA_ID_INST_AUTH/tomcat/win32 bzw.
- $MOA_ID_INST_AUTH/tomcat/unix). Diese Skripte k&ouml;nnen sie nach $CATALINA_HOME kopieren und in Folge von dort starten nachdem die Variablen CATALINA_HOME sowie JAVA_HOME in den Skripten entsprechend den Pfaden der Installation gesetzt wurden.
-</ul>
-<h1><a name="deployment_pk" id="deployment_pk"></a>4 Deployment von MOA-ID-PROXY in Tomcat</h1>
-Um MOA-ID-PROXY in Tomcat f&uuml;r den Ablauf vorzubereiten, sind folgende Schritte notwendig: <br />
-<ul>
- <li> <b>F&uuml;r Tomcat 4.1.31:</b>
- <ul>
- <li>Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war wird in ein
- beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) kopiert. <b>HINWEIS:
- Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!</b><br/>
- </li>
- <li>Anschlie&szlig;end muss in der Datei <tt>$CATALINA_HOME/conf/server.xml</tt> der
- Tomcat-Root-Context auf diese Datei gesetzt werden: wenn
- das war-file sich in $CATALINA_HOME/webappsProxy befindet, geschieht dies
- mit dem Einf&uuml;gen von folgendem Element innerhalb von <tt>&lt;Server&gt;...&lt;Service&gt;...&lt;Engine&gt;...&lt;Host&gt;</tt>:
- <pre>&lt;Context path=""
- docBase="../webappsProxy/moa-id-proxy.war"
- debug="0"/&gt;</pre>
- Anmerkung: Der Root-Context von Tomcat ist normalerweise auskommentiert. </li>
- </ul>
- </li>
- <li> <b>F&uuml;r Tomcat 5.0.28:</b>
- <ul>
- <li>Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war ist in ein
- beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) <b>zu entpacken</b> (diese Datei ist mittels ZIP Algorithmus komprimiert und kann mit jedem Tool,
- das mit .ZIP-Dateien umgehen kann, ge&ouml;ffnet werden). <b>HINWEIS:
- Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!</b><br/>
- </li>
- <li>Anschlie&szlig;end muss in der Datei <tt>$CATALINA_HOME/conf/server.xml</tt> der
- Tomcat-Root-Context auf diese Datei gesetzt werden: wenn die Proxy Web-Applikation
- nach $CATALINA_HOME\webappsProxy entpackt wurde, geschieht dies mit dem Einf&uuml;gen
- von folgendem Element innerhalb von <tt>&lt;Server&gt;...&lt;Service&gt;...&lt;Engine&gt;...&lt;Host&gt;</tt>: </li>
- <pre>&lt;Context path="" docBase="../webappsProxy"
- debug="0"/&gt;</pre>
- Alternativ kann statt die Datei server.xml zu &auml;ndern in <tt>$CATALINA_HOME\conf\Catalina\localhost</tt> eine Datei moa-id-proxy.xml mit vorhin angegebenen Inhalt erstellt werden.
- </ul>
- </li>
-</ul>
-<br />
-<b>Tomcat Konfiguration:</b>
-<ul>
- <li>Die MOA-ID Konfigurationsdatei und die zugeh&ouml;rigen
- Verzeichnisse "certs" und "oa" werden in ein beliebiges Verzeichnis
- im Filesystem kopiert (z.B. $CATALINA_HOME/ conf/moa-id). <br />
- Im Verzeichnis $MOA_ID_INST_PROXY/conf/moa-id befinden sich
- vier verschiedene <a href="#sampleProxyConfig">Beispielkonfigurationen</a>,
- die als Ausgangspunkte f&uuml;r die Konfiguration von MOA-ID-PROXY
- dienen k&ouml;nnen. </li>
- <li>Die endorsed Libraries f&uuml;r Tomcat m&uuml;ssen aus dem
- Verzeichnis $MOA_ID_INST_PROXY/endorsed in das Tomcat-Verzeichnis
- $CATALINA_HOME/common/endorsed kopiert werden. Folgende Libraries
- sind f&uuml;r das Deployment im endorsed Verzeichnis vorgesehen:
- <ul>
- <li id="klein3">Xerces-J-2.4.0 (bestehend aus xercesImpl.jar
- und xmlParserAPIs.jar)</li>
- </ul>
- Eventuell vorhandene Dateien mit dem gleichen Namen m&uuml;ssen
- ersetzt werden. </li>
- <li>Folgende Java System Properties sind zu setzen: <br />
- <ul id="klein3">
- <li id="klein3">moa.id.configuration=Name der MOA ID Konfigurationsdatei.
- Eine beispielhafte MOA ID Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/
- SampleMOAIDConfiguration.xml enthalten.</li>
- <li id="klein3">log4j.configuration=URL der Log4j Konfigurationsdatei.
- Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties
- enthalten. </li>
- <li id="klein3">javax.net.ssl.trustStore=Name des Truststores
- f&uuml;r vertrauensw&uuml;rdige SSL Client-Zertifikate
- (optional; nur, wenn SSL Client-Authentisierung durchgef&uuml;hrt
- werden soll). </li>
- </ul>
- </li>
- Diese Java System-Properties werden Tomcat &uuml;ber die Umgebungsvariable
- CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH <a href="examples/moa-id-env.sh.txt">moa-id-env.sh.txt</a>). <br>
- <br>
- Beispiel-Skripts zum Setzen von CATALINA_OPTS und zum Starten
- von Tomcat sind in $MOA_ID_INST_AUTH\tomcat\ zu finden - Sie
- k&ouml;nnen diese f&uuml;r Ihre Zwecke adaptieren (JAVA_HOME
- und $CATALINA_HOME setzen) und nach $CATALINA_HOME kopieren.
-</ul>
-<h1><a name="Tomcat_Start" id="Tomcat_Start"></a>5 Starten und Stoppen von Tomcat</h1>
-Nach dem Deployment und der Konfiguration kann
- Tomcat aus seinem Wurzelverzeichnis ($CATALINA_HOME) mit <br />
-<pre>
- startTomcat (unter Windows) oder
- moa-id-env.sh
- bin/catalina.sh start (unter Unix/Linux)
-</pre>
-gestartet werden. Das Stoppen von Tomcat erfolgt analog mit <br />
-<pre>
- bin\catalina stop (unter Windows) oder
- bin/catalina.sh stop (unter Unix/Linux)
-</pre>
-Ein erfolgreicher Startvorgang von MOA-ID-AUTH ist an folgender Log-Meldung ersichtlich: <br />
-<pre>
- INFO | 08 13:33:38,497 | main |
- MOA ID Authentisierung wurde
- erfolgreich gestartet
-</pre>
-Analog bei MOA-ID-PROXY: <br/>
-<pre>
- INFO | 08 13:35:49,876 | main |
- MOA ID Proxy wurde erfolgreich gestartet
-</pre>
-Nach dem erfolgreichen Starten von Tomcat steht MOA-ID-AUTH unter der URL
-<pre>
-http(s)://host:port/moa-id-auth/StartAuthentication
-</pre>
-zur Verf&uuml;gung. Der WebService ist unter
-<pre>
-http(s)://host:port/moa-id-auth/services/GetAuthenticationData
-</pre>
-<p>erreichbar. Die Verf&uuml;gbarkeit der Anwendung kann &uuml;berpr&uuml;ft werden, indem die URLs mit einem Web-Browser aufgerufen werden.</p>
-<p><strong>Musterseite (MOA-Template zur B&uuml;rgerkartenauswahl)</strong><br />
-Nach dem erfolgreichen Starten von Tomcat steht eine Musterseite unter der URL</p>
-<pre>
-http(s)://host:port/moa-id-auth/index.html</pre>
-<p>zur Verf&uuml;gung. Diese Musterseite bietet eine integrierte Darstellung der B&uuml;rgerkartenauswahl bei MOA-ID. Die Musterseite stellt dabei beispielhaft dar, wie eine B&uuml;rgerkartenauswahl m&ouml;glichst nahtlos in MOA-ID integriert werde kann. Sie umfa&szlig;t dabei vorkonfigurierte Loginm&ouml;glichkeiten mittels Online-BKU, lokaler BKU und Handy-BKU. <em>Anmerkung</em>: Um sich &uuml;ber die Musterseite einloggen zu k&ouml;nnen, m&uuml;ssen noch die Parameter f&uuml;r den MOA-ID Aufruf angegeben werden - siehe Dokumentation der Musterseite, die &uuml;ber die Musterseite verlinkt ist bzw. &uuml;ber folgende URL abgerufen werden kann</p>
-<pre>
-http(s)://host:port/moa-id-auth/BKAuswahl-MOA-Template-Howto.pdf </pre>
-<p><b>Dynamische Konfigurations-Updates</b><br />
- Dynamische Konfigurations-Updates k&ouml;nnen f&uuml;r MOA-ID-AUTH durch den Aufruf der URL http://hostname:port/moa-id-auth/ConfigurationUpdate (z.B. durch Eingabe in einem Browser) durchgef&uuml;hrt werden. Analog wird die Konfiguration von MOA-ID-PROXY mittels http://hostname:port/ConfigurationUpdate aktualisiert.<br />
- <br />
- <b>Hinweis: </b>Konfigurations&auml;nderungen f&uuml;r die Online-Applikationen betreffen grunds&auml;tzlich sowohl die Auth- als auch die Proxy-Komponente.
- Wenn bspw. das <tt>publicURLPrefix</tt> der OA ge&auml;ndert wird, muss sowohl f&uuml;r die Auth- als auch f&uuml;r die Proxy-Komponente ein ConfigurationUpdate durchgef&uuml;hrt werden. <br />
- <br />
- Konnte MOA-ID-AUTH bzw. MOA-ID-PROXY nicht ordnungsgem&auml;&szlig; konfiguriert und gestartet werden, geht das aus der Log-Meldung hervor: <br />
-</p>
-<pre>
-FATAL | 03 13:19:06,924 | main | Fehler
- beim Starten des Service MOA ID Authentisierung
-</pre>
-bzw.
-<pre>
-FATAL | 03 13:19:06,924 | main | Fehler
- beim Starten des Service MOA ID Proxy
-</pre>
-In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss &uuml;ber den genaueren Grund.
-<h1><a name="Logging" id="Logging"></a>6 Logging</h1>
-Die MOA ID Webapplikation verwendet Jakarta Log4j f&uuml;r die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsm&ouml;glichkeiten, die ausf&uuml;hrlich im <a href="http://jakarta.apache.org/log4j/docs/manual.html" target="_new">Log4j Handbuch</a> beschrieben sind. Unter anderem gibt es die M&ouml;glichkeit, folgende Einstellungen vorzunehmen: <br />
- <ul>
- <li id="klein4">Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL).</li>
- <li id="klein4">Name und maximale Gr&ouml;&szlig;e der Log-Datei(en).</li>
- <li id="klein4">Das Aussehen der Log-Eintr&auml;ge.</li>
- </ul>
- Es werden folgende Log-Hierarchien verwendet:
-<ul>
- <li>moa.id.auth f&uuml;r alle Log-Meldungen aus dem MOA-ID-AUTH Modul </li>
- <li>moa.id.proxy f&uuml;r alle Log-Meldungen aus dem MOA-ID-PROXY Modul </li>
- <li>moa.spss.server f&uuml;r alle Log-Meldungen aus dem MOA-SPSS Modul </li>
- <li>iaik.server f&uuml;r alle Log-Meldungen aus den IAIK Kryptographie-Modulen </li>
-</ul>
-Als Ausgangspunkt f&uuml;r die Logging-Konfiguration liegt die Datei $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties (bzw. $MOA_ID_INST_PROXY/conf/moa-id/log4j.properties) bei.
- Wird diese Datei als Logging-Konfiguration verwendet, so werden alle Log-Meldungen sowohl in die Konsole, als auch in die Datei <tt>$CATALINA_HOME/logs/moa-id.log</tt> geschrieben. <br />
- <br />
- <b>Format der Log-Meldungen</b><br />
- Anhand einer konkreten Log-Meldung wird das Format der MOA ID Log-Meldungen erl&auml;utert:
- <pre>
- INFO | 09 08:23:59,385 | Thread-8 |
- Anmeldedaten zu MOASession -5468974113772848113
- angelegt, SAML Artifakt
- AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
-</pre>
- Der Wert <tt>INFO</tt> besagt, dass die Log-Meldung im Log-Level <tt>INFO</tt> entstanden ist. Folgende Log-Levels existieren:<br />
- <ul>
- <li id="klein4"><tt>DEBUG:</tt> Log-Meldungen im Log-Level <tt>DEBUG</tt> geben Auskunft &uuml;ber die innere Arbeitsweise des Systems. Sie sind haupts&auml;chlich f&uuml;r Entwickler interessant.</li>
- <li id="klein4"><tt>INFO:</tt> Diese Log-Meldungen geben informative Status-Informationen &uuml;ber den Ablauf der Webapplikation, wie z.B., dass eine neue Anfrage eingelangt ist.</li>
- <li id="klein4"><tt>WARN:</tt> Bei der Ausf&uuml;hrung einer Operation sind leichte Fehler aufgetreten. Der Ablauf der Webapplikation ist nicht weiter beeintr&auml;chtigt.</li>
- <li id="klein4"><tt>ERROR:</tt> Die Ausf&uuml;hrung einer Operation musste abgebrochen werden. Die Webapplikation ist davon nicht beeintr&auml;chtigt. </li>
- <li id="klein4"><tt>FATAL:</tt> Es ist ein Fehler aufgetreten, der den weiteren Betrieb der Webapplikation nicht mehr sinnvoll macht.</li>
- </ul>
- Der n&auml;chste Wert <tt>09 08:23:59,385</tt>, gibt den Zeitpunkt an, an dem die Log-Meldung generiert wurde (in diesem Fall den 9. Tag im aktuellen Monat, sowie die genaue Uhrzeit). <br />
- Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist h&auml;ufig ein Java Stack-Trace angef&uuml;gt, der eine genauere Ursachen-Forschung erm&ouml;glicht. <br />
- <br />
- <b>Wichtige Log-Meldungen</b><br />
- Neben den im Abschnitt "Starten und Stoppen von Tomcat" beschriebenen Log-Meldungen, die anzeigen, ob die Webapplikation
- ordnungsgem&auml;&szlig; gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss &uuml;ber die Abarbeitung von Anfragen.
- Die Annahme einer Anfrage wird beispielsweise angezeigt durch:
-<pre>
- INFO | 09 08:37:17,663 | Thread-9 |
- MOASession 6576509775379152205 angelegt
-
- INFO | 09 08:37:20,828 | Thread-9 |
- Anmeldedaten zu MOASession 6576509775379152205
- angelegt, SAML Artifakt
- AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
-
-</pre>
-Die 1. Log-Meldung besagt, dass sich ein Benutzer an MOA-ID-AUTH angemeldet und eine eindeutige SessionID zugewiesen bekommen hat. <br />
- Die 2. Log-Meldung informiert dar&uuml;ber, dass die Anmeldedaten des Benutzers unter dem angezeigten SAML Artifakt abgeholt werden k&ouml;nnen.<br />
-Wenn nun versucht wird, eine Transaktion mit einer ung&uumlltigen SessionID fortzusetzen erh&auml;lt man folgende Log-Meldung:<br />
-<pre>
- ERROR | 09 09:34:27,105 | Thread-8 |
- at.gv.egovernment.moa.id.AuthenticationException:
- MOASessionID ist unbekannt
- (MOASessionID=-8650403497547200032)
-</pre>
- <p>In diesem Fall gibt der mitgeloggte Stacktrace Auskunft
- &uuml;ber die Art des Fehlers. Der Aufrufer der MOA ID
- Webapplikation bekommt einen Fehlercode sowie eine kurze
- Beschreibung des Fehlers als Antwort zur&uuml;ck. <br />
- <br />
- Die Tats&auml;chlich &uuml;bertragenen Anfragen bzw. Antworten
- werden aus Effizienzgr&uuml;nden nur im Log-Level DEBUG
- angezeigt.</p>
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-admin_2.htm b/id/server/doc/moa_id/id-admin_2.htm
deleted file mode 100644
index 286e9aee1..000000000
--- a/id/server/doc/moa_id/id-admin_2.htm
+++ /dev/null
@@ -1,1156 +0,0 @@
-<html>
-<head>
- <title>MOA ID-Administration</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
-<p class="subtitle">Konfiguration</p>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#moaid-konfiguration">Konfiguration von MOA-ID</a></p>
- </li>
- <li>
- <p><a href="#oa-config">Konfiguration der Online-Applikation</a></p>
- </li>
- <li>
- <p><a href="#sp-config">Konfiguration von MOA-SP</a></p>
- </li>
- <li>
- <p><a href="#online-config">&Auml;nderung der Konfiguration w&auml;hrend des Betriebs</a></p>
- </li>
- <li>
- <p><a href="#errorpages">&Auml;ndern der Default Errorpages</a></p>
- </li>
- <li>
- <p><a href="#security">Tomcat Security Manager</a></p>
- </li>
-</ol>
- <hr/>
-<h1><a name="moaid-konfiguration" id="moaid-konfiguration">1 Konfiguration von MOA-ID</a></h1>
-<p >Die Konfiguration von MOA ID wird mittels einer XML-basierten
- Konfigurationsdatei, die dem Schema <a href="../MOA-ID-Configuration-1.5.1.xsd" target="_new">MOA-ID-Configuration-1.5.1.xsd</a> entspricht, durchgef&uuml;hrt.
-<p />Der Ort der Konfigurationsdatei wird im Abschnitt <a href="id-admin_1.htm#deployment">Deployment
- der Web-Applikation in Tomcat</a> beschrieben.
-<p>Enth&auml;lt die Konfigurationsdatei relative Pfadangaben, werden
- diese relativ zum Verzeichnis in dem sich die MOA-ID Konfigurationsdatei
- befindet interpretiert.<br>
-</p>
-<p id="ConnectionParameter"> <b>ConnectionParameter</b> <br />
- Das Element <tt>ConnectionParameter</tt> enth&auml;lt Parameter,
- die MOA-ID f&uuml;r den Aufbau von Verbindungen zu anderen Komponenten
- ben&ouml;tigt. Dieses Element tritt mehrfach in der Konfigurationsdatei
- auf und wird daher vorab detailliert beschrieben.
-<p>Das Attribut <tt>URL</tt> enth&auml;lt die URL der Komponente zu
- der die Verbindung aufgebaut werden soll. Wird das Schema <tt>https</tt> verwendet, k&ouml;nnen die Kind-Elemente <tt>AcceptedServerCertificates</tt> und <tt>ClientKeyStore</tt> angegeben werden. Wird das Schema <tt>http</tt> verwendet m&uuml;ssen keine Kind-Elemente angegeben werden bzw.
- werden diese nicht ausgewertet. Andere Schemas werden nicht unterst&uuml;tzt.
-<p>Wird die Verbindung &uuml;ber TLS aufgebaut und erfordert der TLS-Server
- eine Client-Authentisierung mittels Zertifikate, dann muss das Kind-Element <tt>ClientKeyStore</tt> spezifiziert werden. Im Element <tt>ClientKeyStore</tt> wird der Filename des PKCS#12-Keys (relativ zur MOA-ID Konfigurationsdatei)
- angegeben. Diesem Keystore wird der private Schl&uuml;ssel f&uuml;r
- die TLS-Client-Authentisierung entnommen. Das Passwort zum Lesen
- des privaten Schl&uuml;ssels wird im Attribut <tt>ClientKeyStore/@password</tt> konfiguriert.<br />
- Aufgrund der Tatsache, dass starke Verschl&uuml;sselung eine Voraussetzung
- f&uuml;r MOA-ID darstellt, werden clientseitig nur die folgenden
- Cipher Suites unterst&uuml;tzt:
-<ul>
- <li><tt>SSL_RSA_WITH_RC4_128_SHA</tt></li>
- <li><tt>SSL_RSA_WITH_RC4_128_MD5</tt></li>
- <li><tt>SSL_RSA_WITH_3DES_EDE_CBC_SHA</tt></li>
-</ul>
-<p>Im Kind-Element <tt>AcceptedServerCertificates</tt> kann ein Verzeichnisname
- (relativ zur MOA-ID Konfigurationsdatei) angegeben werden, in dem
- die akzeptierten Zertifikate der TLS-Verbindung hinterlegt sind. In
- diesem Verzeichnis werden nur Serverzertifikate abgelegt. Fehlt dieser
- Parameter wird lediglich &uuml;berpr&uuml;ft ob ein Zertifikatspfad
- zu den im Element <tt>&lt;TrustedCACertificates&gt;</tt> angegebenen
- Zertifikaten erstellt werden kann. Falls dies nicht m&ouml;glich ist,
- kommt es zu einem Fehlerfall.
-</p>
-<p id="AuthComponent"> <b>AuthComponent</b> <br />
- <tt>AuthComponent</tt> enth&auml;lt Parameter, die nur die MOA-ID
- Authentisierungskomponente betreffen. Das Element ist optional
- und muss nicht verwendet werden, wenn auf dem Server keine MOA-ID
- Authentisierungskomponente installiert wird. Das Element <tt>AuthComponent</tt> hat sechs Kind-Elemente:
- <ul>
- <li><tt>BKUSelection</tt> (optional)</li>
- <li><tt>Templates</tt> (optional)</li>
- <li><tt>SecurityLayer</tt></li>
- <li><tt>MOA-SP</tt></li>
- <li><tt>IdentityLinkSigners</tt></li>
- <li><tt>VerifyInfoboxes</tt> (optional ab Version 1.4)</li>
- <li><tt>ForeignIdentities</tt></li>
- <li><tt>OnlineMandates</tt></li>
- </ul>
-<p id="BKUSelection"> <b>AuthComponent/BKUSelection</b> <br />
- Das optionale Element <tt>BKUSelection</tt> enth&auml;lt Parameter
- zur Nutzung eines Auswahldienstes f&uuml;r eine B&uuml;rgerkartenumgebung
- (BKU). Wird das Element nicht angegeben, dann wird die lokale
- B&uuml;rgerkartenumgebung auf <tt>http://localhost:3495/http-security-layer-request</tt> verwendet. </p>
-<p>Das Attribut <tt>BKUSelectionAlternative</tt> gibt an welche
- Alternative zur BKU-Auswahl verwendet werden soll. MOA-ID unterst&uuml;tzt
- die Werte <tt>HTMLComplete</tt> (vollst&auml;ndige HTML-Auswahl)
- und <tt>HTMLSelect</tt> (HTML-Code f&uuml;r Auswahl) [<a href="../bku-auswahl.20030408.pdf">"Auswahl
- von B&uuml;rgerkartenumgebungen"</a>, Arno Hollosi]. </p>
-<p>Das Kind-Element <tt>ConnectionParameter</tt> spezifiziert die
- Verbindung zum Auswahldienst (siehe <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a>),
- jedoch kann das Kind-Element <tt>ClientKeyStore</tt> nicht angegeben
- werden. </p>
-<p id="AuthTemplates"> <b>AuthComponent/Templates</b> <br />
- Das optionale Element <tt>Templates</tt> kann genau einmal vorkommen, um
- das Aussehen der Seiten &quot;Auswahl der B&uuml;rgerkartenumgebung&quot; sowie
- &quot;Anmeldung mit B&uuml;rgerkarte&quot; anzupassen. Des Weiteren k&ouml;nnen die Templates zur Anmeldung mit Online-Vollmachten angepasst werden. Die hier
- spezifizierten (globalen) Templates haben Priorit&auml;t gegen&uuml;ber Templates,
- die in der aufrufenden URL (vgl. <a href="id-anwendung_1.htm" target="_new">Aufruf von MOA-ID-AUTH</a>)
- &uuml;bergeben werden, haben jedoch Nachrang gegen&uuml;ber in
- der Konfigurationsdatei f&uuml;r eine Online-Applikation individuell definierte (lokale)
- Templates (siehe <a href="#OnlineApplication/AuthComponent/Templates" target="_new"> OnlineApplication/AuthComponent/Templates</a>).
- Das hei&szlig;t, sind in der Konfigurationsddatei f&uuml;r eine Online-Applikation lokale
- Templates definiert (Element <tt>OnlineApplication/AuthComponent/Templates</tt>), so werden
- die als global spezifizierten Templates (<tt>AuthComponent/Templates</tt>) f&uuml;r diese
- OnlineApplikation ignoriert, jedoch f&uuml;r alle anderen Online-Applikationen
- verwendet. Templates in der aufrufenden URL werden demnach nur mehr dann
- herangezogen, wenn in der Konfigurationsdatei weder globale (f&uuml;r alle
- Online-Applikationen g&uuml;ltig) noch lokale (Templates je Online-Applikation)
- spezifiziert sind. Hinweis: Die Template zur Anmeldung mit Online-Vollmachten k&ouml;nnen nicht &uuml;ber die URL angegeben werden.</p>
-<p>Das <tt>Templates</tt>-Element hat die zwei Kindelemente <tt>BKUSelectionTemplate</tt>und <tt>Template. </tt>Jedes dieser
- zwei Elemente kann genau einmal vorkommen oder fehlen.
- Das Kindelement <tt>BKUSelectionTemplate</tt> spezifiziert ein Template
- zur Gestaltung der Seite &quot;Auswahl der B&uuml;rgerkartenumgebung&quot;,
- w&auml;hrend das Kindelement <tt>Template</tt> die Seite
- &quot;Anmeldung mit B&uuml;rgerkarte&quot; referenziert. Dies beiden Elemente haben genau ein Attribut namens <tt>URL</tt>,
- das die Lage des Templates im Form einer URL beschreibt.
- Relative Pfadangaben werden dabei relativ zum Verzeichnis, in dem sich die
- MOA-ID Konfigurationsdatei befindet, interpretiert. Bei Templates die &uuml;ber das Protokoll https referenziert werden, muss vor dem Start des Tomcat ein Truststore angegeben werden, das die notwendigen vertrauensw&uuml;rdigen Zertifikate enth&auml;lt. Siehe dazu die Parameter in den vorbereiteten Startdateien <tt>startTomcat.bat</tt> und <tt>tomcat-start.sh</tt>. </p>
-<p>Richtlinien zur Struktur der Templates k&ouml;nnen der
- MOA-ID-Spezifikation bzw. dem Abschnitt <a href="id-anwendung_1.htm" target="_new">Aufruf von MOA-ID-AUTH</a> dieses Handbuches entnommen werden. </p>
-<p id="SecurityLayer"> <b>AuthComponent/SecurityLayer</b> <br />
- Das Element <tt>SecurityLayer</tt> enth&auml;lt Parameter
- zur Nutzung des Security-Layers. </p>
-<p>Das Kind-Element <tt>TransformsInfo</tt> spezifiziert eine
- Transformation, die f&uuml;r die Erstellung der Signatur des
- AUTH-Blocks als Parameter in den <tt>CreateXMLSignatureRequest</tt> des Security-Layers integriert werden muss. Mehrere unterschiedliche
- Implementierungen des Security-Layer k&ouml;nnen durch die
- Angabe mehrerer <tt>TransformsInfo</tt>-Elemente unterst&uuml;tzt
- werden. </p>
-<p>Das Attribut <tt>TransformsInfo/@filename</tt> verweist auf
- eine Datei, die das globale Element <tt>TransformsInfo</tt> vom Typ <tt>TransformsInfo</tt> enth&auml;lt. Die Angabe erfolgt
- relativ zur MOA-ID Konfigurationsdatei. Das Encoding dieser
- Datei muss UTF-8 sein. </p>
-<p><a href="examples/TransformsInfoAuthBlockTable_DE.xml">Beispiel f&uuml;r
- eine TransformsInfo-Datei</a></p>
-<p id="MOA-SP"> <b>AuthComponent/MOA-SP</b> <br />
- Das Element <tt>MOA-SP</tt> enth&auml;lt Parameter zur Nutzung
- von MOA-SP. MOA-SP wird f&uuml;r die &uuml;berpr&uuml;fung
- der Signatur der Personenbindung und des AUTH-Blocks verwendet. <br />
- Wird das Kind-Element <tt>ConnectionParameter</tt> angegeben,
- dann wird MOA-SP &uuml;ber das Webservice angesprochen.</p>
-<p> Wird das Kind-Element <tt>ConnectionParameter</tt> nicht angegeben so wird eine MOA-ID beiligende Version von
- MOA-SP direkt &uuml;ber das Java-API angesprochen. In diesem
- Fall muss das System-Property auf die verwendete Konfigurationsdatei
- von MOA-SP gesetzt werden. Eine beispielhafte MOA-SP Konfigurationsdatei
- ist in <tt>$MOA_ID_INST_AUTH/conf/moa-spss/SampleMOASPSSConfiguration.xml</tt> enthalten. </p>
-
- <p><b><i>Hinweis:</i></b><i> MOA-SP muss entsprechend konfiguriert
- werden - siehe hierzu Abschnitt <a href="#sp-config">Konfiguration
- von MOA-SP</a>. Alle Details zur Konfiguration von MOA-SP
- finden sie in der Distribution von MOA-SP/SS beiligenden
- Dokumentation im Abschnitt 'Konfiguration'.<br>
-</i></p>
- <p>Das Kind-Element <tt>VerifyIdentityLink/TrustProfileID</tt> spezifiziert eine TrustProfileID, die f&uuml;r den <tt>VerifyXMLSignatureRequest</tt> zur &Uuml;berpr&uuml;fung der Signatur der Personenbindung
- verwendet werden muss. Diese TrustProfileID muss beim
-verwendeten MOA-SP Modul konfiguriert sein.</p>
-<p>Die Kind-Elemente <tt>VerifyAuthBlock/TrustProfileID</tt> und <tt>VerifyAuthBlock/VerifyTransformsInfoProfileID</tt> spezifizieren eine TrustProfileID und eine ID f&uuml;r
- ein Transformationsprofil, die f&uuml;r den <tt>VerifyXMLSignatureRequest</tt> zur &uuml;berpr&uuml;fung der Signatur des Auth-Blocks
- verwendet werden m&uuml;ssen. Diese TrustProfileID muss
-beim verwendeten MOA-SP Modul konfiguriert sein.</p>
-
-<p id="IdentityLinkSigners"> <b>AuthComponent/IdentityLinkSigners</b> <br />
- Dieses Element gibt an von welchen Signatoren die Signatur
- des IdentityLink erstellt werden musste damit der IdentityLink
- akzeptiert wird. F&uuml;r jeden Signator muss der <tt>X509SubjectName</tt> nach RFC 2253 spezifiziert werden. </p>
-<p><a href="examples/IdentityLinkSigners.txt">Beispiel</a><br />
- <br />
- <b>Anmerkung:</b> Ab Version 1.4 ist dieses Element nicht mehr verpflichtend notwendig, da die
- Berechtigung von Zertifikaten zum Signieren von Personenbindungen ab Februar
- 2007 &uuml;ber die Zertifikatseigenschaft "Eigenschaft zur Ausstellung von Personenbindungen"
- (OID: 1.2.40.0.10.1.7.1) gepr&uuml;ft wird.
- Der Namens-Check des alten Zertifikats wird fix in MOA-ID integriert, sodass das <tt>IdentityLinkSigners</tt>-Element in der Konfiguration &uuml;berfl&uuml;ssig wird. </p>
-
-<p id="VerifyInfoboxesAuth"> <b>AuthComponent/VerifyInfoboxes</b> <br />
- Ab Version 1.4 bietet MOA-ID die M&ouml;glichkeit einer erweiterten Infobox-Validierung,
- das hei&szlig;t, es k&ouml;nnen neben der Personenbindung auch weitere ausgelesene Infoboxen
- validiert werden. Die f&uuml;r die Validierung der Infoboxen notwendigen Parameter
- k&ouml;nnen &uuml;ber die Konfigurationsdatei durch das <tt>VerifyInfoboxes</tt> Element sowohl <a href="#VerifyInfoboxesAuth">global</a> als auch <a href="#OnlineApplication/AuthComponent/VerifyInfoboxes">lokal</a> je Online-Applikation gesetzt werden. MOA-ID &uuml;bergibt diese Parameter der
- Applikation, die f&uuml;r die Verifikation des Inhaltes der jeweilgen von der BKU
- &uuml;bermittelten Infobox verantwortlich ist. Im Folgenden wird eine derartige
- Applikation als <tt>Pr&uuml;fapplikation</tt> bezeichnet.
-<p>Das <tt>Verifyinfoboxes</tt> Element ist optional und kann fehlen,
- wenn keine Infoboxen au&szlig;er der der Personenbindung validiert werden m&uuml;ssen.
- Das <tt>VerifyInfoboxes</tt>-Element hat folgende Kind-Elemente:
-<ul>
- <li id="DefaultTrustProfileVI"><tt>DefaultTrustProfile</tt>: Dieses optionale
- Element kann nur einmal vorkommen und spezifiziert ein Trust-Profil, das
- von einer <tt>Pr&uuml;fapplikation</tt> zur Validierung einer Infobox
- herangezogen werden kann, wenn f&uuml;r diese Infobox kein eigenes <a href="#TrustProfileVI">Trust-Profil</a> gesetzt wurde. Es hat genau ein
- Kindelement namens <tt>TrustProfileID</tt>, das die ID eines in MOA-SP
- konfigurierten Trust-Profiles enth&auml;lt. <br />
- <b>Anmerkung:</b> Das Trust-Profil f&uuml;r die <a href="#trustProfile">Personenbindung</a> darf <b>nicht</b> zur Validierung anderer Infoboxen verwendet werden. Das Trust-Profil f&uuml;r
- die <a href="#trustProfile">B&uuml;rgerkarte</a> <b>soll</b> nur dann zur Validierung
- anderer Infoboxen verwendet werden, wenn die zur Verifikation der Zertifikate ben&ouml;tigten
- Wurzelzertifikate bereits im entsprechenden Trust-Store enthalten sind. (vgl.
- MOA-ID Spezifikation, Abschnitt 4.6). </li>
- <li id="InfoboxVI"><tt>Infobox</tt>: Dieses Element kann beliebig oft vorkommen
- und kapselt die Parameter, die f&uuml;r die Validierung einer Infobox an die
- jeweilige Pr&uuml;fapplikation &uuml;bergeben werden. <br />
- Das <tt>Infobox</tt>-Element hat folgende Attribute:
- <ul>
- <li id="IdentifierVI"><tt>Identifier:</tt> Dieses Attribut muss vorhanden sein und gibt
- den <tt>Namen</tt> der Infobox an. Er muss dabei exakt dem <tt>Bezeichner</tt> der jeweiligen zu validierenden Infobox aus der BKU entsprechen, also
- zum Beispiel<tt> EHSPToken</tt> f&uuml;r die <tt>GDAToken</tt>-Infobox. <br />
- </li>
- <li id="requiredVI"><tt>required:</tt> Dieses Attribut vom Typ <tt>boolean</tt> bestimmt, ob MOA-ID den Inhalt der entsprechenden Infobox
- f&uuml;r die Anmeldung zwingend ben&ouml;tigt. Ist es auf <tt>true</tt> gesetzt, und wird der entsprechende Infobox-Inhalt nicht von der BKU
- &uuml;bermittelt, so bricht MOA-ID den Anmeldevorgang mit einer Fehlermeldung
- ab. <br />
- Fehlt dieses Attribut, so wird als Defaultwert <tt>false</tt> gesetzt. <br />
- </li>
- <li id="provideStammzahlVI"><tt>provideStammzahl:</tt> Dieses Attribut vom Typ <tt>boolean</tt> bestimmt, ob die Pr&uuml;fapplikation die Stammzahl aus der
- Personenbindung erhalten darf. Fehlt dieses Attribut, so wird als Defaultwert <tt>false</tt> gesetzt. <br />
- <b>Anmerkung</b>: Das Attribut steht in keinem Zusammenhang zum gleichnamigen
- Attribut <a href="#provideStammzahlOA">OnlineApplication/AuthComponent/@provideStammzahl</a>,
- das angibt ob die Stammzahl an die <i>Online-Applikation</i> weitergegeben werden darf. </li>
- <li id="provideIdentityLinkVI"><tt>provideIdentityLink:</tt> Dieses Attribut vom Typ <tt>boolean</tt> bestimmt, ob die Pr&uuml;fapplikation die Personenbindung erhalten
- soll. Hat es den Wert <tt>true</tt>, so wird ein Klone des Wurzel-Elements der Personenbindung
- an die Pr&uuml;fapplikation &uuml;bergeben, wobei zu beachten ist, dass die
- darin enthaltene Stammzahl auf einen leeren String gesetzt wird, falls das
- Attribut <a href="#provideStammzahlVI">provideStammzahl</a> auf <tt>false</tt> gesetzt ist.
- Fehlt das <tt>provideIdentityLink</tt>-Attribut, so wird als Defaultwert <tt>false</tt> gesetzt. <br />
- <b>Anmerkung 1</b>: Das Attribut steht in keinem Zusammenhang zum gleichnamigen
- Attribut <a href="#provideIdentityLinkOA">OnlineApplication/AuthComponent/@provideIdentityLink</a>,
- das angibt ob die <i>Online-Applikation</i> die Personenbindung erhalten
- soll. <br />
- <b>Anmerkung 2</b>: Der Pr&uuml;fapplikation werden defaultm&auml;&szlig;ig der Vorname,
- der Familienname, das Geburtsdatum, der Typ der Stammzahl, die Stammzahl
- (konfigurierbar) und die &ouml;ffentlichen Schl&uuml;ssel aus der Personenbindung
- &uuml;bergeben. Das Attribut <tt>provideIdentityLink</tt> sollte deshalb
- wirklich nur dann auf <tt>true</tt> gesetzt werden, wenn von der
- Pr&uuml;fapplikation noch andere Daten aus der Personenbindung ben&ouml;tigt
- werden. </li>
- </ul>
- Das <tt>Infobox</tt>-Element hat folgende Kind-Elemente:
- <ul>
- <li id="FriendlyNameVI"><tt>FriendlyName</tt>: Das Element ist optional und
- enth&auml;lt einen Namen, der von MOA-ID zur Anzeige von, die jeweilige Infobox
- betreffende, Fehlermeldungen im Browser verwendet wird. Im Regelfall wird man
- hier den deutschen Namen der Infobox setzen, also z.B.<tt> GDAToken</tt> f&uuml;r die <tt>EHSPToken</tt>-Infobox. <br />
- Fehlt dieses Element, so wird f&uuml;r Fehlermeldungen der Wert des <a href="#IdentifierVI">Identifier</a>-Attributes verwendet. </li>
- <li id="TrustProfileVI"><tt>TrustProfileID</tt>: Das Element ist optional und
- bezeichnet ein in MOA-SP konfiguriertes Trust-Profil, das von MOA-ID
- f&uuml;r die Validierung der Infobox verwendet wird.
- Dabei ist wieder zu beachten, dass das Trust-Profil f&uuml;r die <a href="#trustProfile">Personenbindung</a> <b>nicht</b> zur Validierung anderer Infoboxen verwendet werden darf, und das Trust-Profil f&uuml;r
- die <a href="#trustProfile">B&uuml;rgerkarte</a> nur dann zur Validierung
- anderer Infoboxen verwendet werden <b>soll</b>, wenn die zur Verifikation der
- Zertifikate ben&ouml;tigten Wurzelzertifikate bereits im entsprechenden
- Trust-Store enthalten sind. (vgl. MOA-ID Spezifikation, Abschnitt 4.6). <br />
- Fehlt dieses Element, so wird das <a href="#DefaultTrustProfileVI">Default-Trust-Profil</a> verwendet. Ist dieses auch nicht konfiguriert, so wird f&uuml;r die
- Validierung der entsprechenden Infobox keine Zertifikatspr&uuml;fung
- notwendig sein. </li>
- <li id="ValidatorClassVI"><tt>ValidatorClass</tt>: Das Element ist optional
- und bezeichnet den Namen der Klasse (voller Package-Name), die von MOA-ID
- zur Validierung der Infobox geladen werden soll. Fehlt dieses Element,
- so wird MOA-ID versuchen, eine Default-Klasse zu laden, deren Namen aus
- dem <a href="#IdentifierVI">Identifier</a>-Attribut der Infobox abgeleitet
- wird (vgl. MOA-ID-Spezifikation, Abschnitt 4.7.2.3, <tt>Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse</tt>). <br />
- <b>Anmerkung</b>: Im Regelfall wird dieses Element fehlen, da bei der
- Entwicklung einer Infobox-Pr&uuml;fapplikation der Default-Klassennamen
- verwendet werden sollte. Nur wenn es verschiedene Pr&uuml;fapplikationen
- f&uuml;r eine Infobox gibt, wird man das <tt>ValidatorClass</tt> verwenden, um eine andere als die Default-Applikation zu laden. </li>
- <li id="SchemaLocationsVI"><tt>SchemaLocations</tt>: Das Element ist optional
- und referenziert XML-Schemas, die von der Pr&uuml;fapplikation zum
- validierenden Parsen von Infoboxen verwendet werden k&ouml;nnen. Das
- Element hat beliebig viele <tt>Schema</tt>-Kindelemente, dessen Attribute <tt>namespace</tt> und <tt>schemaLocation</tt> jeweils die Namespace-URI
- und den Ort (URI) des entsprechenden Schemas bezeichnen. Relative URIs im <tt>schemaLocation</tt>-Attribut sind dabei relativ zum Verzeichnis der
- MOA-ID-Konfigurationsdatei zu interpretieren. <br />
- Beispiel: <br />
- <pre>
- &lt;SchemaLocations&gt;
- &lt;Schema namespace="http://ns1.ns1" schemaLocation="schemas/ns1.xsd"/&gt;
- &lt;Schema namespace="http://ns2.ns2" schemaLocation="schemas/ns2.xsd"/&gt;
- &lt;/SchemaLocations>
- </pre>
- Weitere M&ouml;glichkeiten zur &Uuml;bergabe von XML-Schemas an die
- Pr&uuml;fapplikation k&ouml;nnen in der MOA-ID-Spezifikation im
- Abschnitt 4.7.2, <tt>Erweiterte Infobox&uuml;berpr&uuml;fung</tt>, nachgelesen werden. </li>
- <li id="ApplicationSpecificParametersVI"><tt>ApplicationSpecificParameters</tt>:
- Das Element ist optional und nimmt Infobox-kontext-spezifische Parameter
- auf. <br />
- Da MOA-ID die zus&auml;tzlichen zur Personenbindung abgefragten Infoboxen
- (bzw. deren Inhalte) nicht a priori kennt, ist es unm&ouml;glich vorherzusehen,
- welche Parameter eine Pr&uuml;fapplikation zum Validieren einer Infobox
- ben&ouml;tigt. Die Konfiguration sieht daher das Element <tt>ApplicationSpecificParameters</tt> vor, um einer bestimmten
- Pr&uuml;fapplikation kontext spezifische Parameter zu &uuml;bermitteln.
- Dieses Element wird vollst&auml;ndig an die Pr&uuml;fapplikation
- weitergegeben, und es obliegt der Pr&uuml;fapplikation die Kindelemente
- des <tt>ApplicationSpecificParameters</tt>-Element zu extrahieren und zu
- interpretieren. <br />
- Beispiel: <br />
- <pre>
- &lt;ApplicationSpecificParameters&gt;
- &lt;Parameter1&gt;content1&lt;/Parameter1&gt;
- &lt;Parameter2&gt;content2&lt;/Parameter2&gt;
- &lt;Parameter3&gt;
- &lt;Parameter3a&gt;content3a&lt;/Parameter3a&gt;
- &lt;Parameter3b&gt;content3b&lt;/Parameter3b&gt;
- &lt;/Parameter3&gt;
- &lt;/ApplicationSpecificParameters&gt;
- </pre>
- </li>
- </ul>
- </li>
-</ul>
- <p><br />
- Eine Beispielkonfiguration finden sie am Ende das Abschnitts <a href="#VerifyInfoboxesOA">OnlineApplication/AuthComponent/VerifyInfoboxes</a>. <br />
- </p>
-<p id="ForeignIdentitiesAuth"><b>AuthComponent/ForeignIdentities</b> <br />
- Ab Version 1.4.7 bietet MOA-ID die M&ouml;glichkeit der Nutzung von ausl&auml;ndischen Karten. Hierf&uuml;r ist ein Stammzahlenregister-Gateway n&ouml;tig, das einen entsprechenden Zugang zum Stammzahlenregister bereitstellt. Es ist hierzu ein entsprechender <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a> zu definieren, der die Zugangsdaten zum Gateway bereith&auml;lt (siehe <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a>). In der Default-Konfiguration ist der Zugang zum Stammzahlenregister-Gateway bereits aktiviert. Es muss nur noch das Client-Zertifikat f&uuml;r die SSL-Verbinung zum Gateway angegeben werden. Voraussetzung daf&uuml;r ist ein Zertifikat von A-Trust bzw. A-CERT mit Verwaltungseigenschaft oder Dienstleistereigenschaft. Wenn ihr MOA-ID Zertifikat diese Voraussetzung erf&uuml;llt, k&ouml;nnen Sie dieses hier angeben.</p>
- <p><b>AuthComponent/ForeignIdentities/STORK</b> <br />
- Ab MOA Release 1.5.2 ist es auch m&ouml;glich, ausl&auml;ndische B&uuml;rger &uuml;ber <a href="http://eid-stork.eu/" target="_new">STORK</a> zu authentifizieren. Da auch f&uuml;r diese Art der Authentifizierung eine Kommunikation mit dem Stammzahlenregister-Gateway notwendig ist, gelten die zuvor angef&uuml;hrten Ausf&uuml;hrungen hinsichtlich <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a> auch f&uuml;r STORK. F&uuml;r eine STORK Authentifizierung sind jedoch noch weitere Konfigurationen notwendig. Folgende Eintr&auml;ge m&uuml;ssen f&uuml;r eine STORK Authentifizierung hier noch konfiguriert werden:
- <ul>
- <li>C-PEPS Informationen <br />
- </li>
- <li>KeyStore zum SAML Signatur-Zertifikat <br />
- </li>
- <li>MOA-SP TrustProfil zur SAML Signatur-Validierung <br />
- </li>
-</ul>
- <p><b>AuthComponent/ForeignIdentities/STORK/C-PEPS</b> <br />
- Unter diesem Konfigurationselement k&ouml;nnen die Verbindungsparameter zu den jeweiligen C-PEPS (Citizen Country - PEPS) der europ&auml;ischen L&auml;nder, die auch STORK unterst&uuml;tzen, angegeben werden. F&uuml;r eine erfolgreiche C-PEPS Konfiguration muss der ISO-Country Code des jeweiligen Landes und die dazugeh&ouml;rige C-PEPS URL angegeben werden. In Ausnahmenf&auml;llen m&uuml;ssen bei einzelnen C-PEPS l&auml;nderspezifische Attribute abgefragt werden, dies funktioniert durch zus&auml;tzliche Angabe eines <tt>&lt;stork:RequestedAttribute&gt;</tt> Elements. Die C-PEPS Konfigurationen sind in den der MOA-Release beliegenden Beispielkonfigurationen bereits vorkonfiguriert. Sollte sich an diesen Konfigurationen etwas &auml;ndern, werden diese via JoinUp (<a href="https://joinup.ec.europa.eu/software/moa-idspss/home" target="_new">MOA@JoinUp</a>) bzw. MOA-Mailingliste ver&ouml;ffentlicht. Im Folgenden wird eine Beispielkonfiguration kurz veranschaulicht.
- <pre>
-&lt;C-PEPS countryCode="PT" URL="https://eu-id.cartaodecidadao.gov.pt/PEPS/ColleagueRequest"/&gt;
-&lt;C-PEPS countryCode="SI" URL="https://peps.mju.gov.si/PEPS/ColleagueRequest"&gt;
- &lt;stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/fiscalNumber" <br> isRequired="true" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"/&gt;
-&lt;/C-PEPS&gt; </pre>
-<p>Details zur Angabe von <tt>&lt;stork:RequestedAttribute&gt;</tt> bzw. welche Attribute von STORK &uuml;berhaupt unterst&uuml;tzt werden, wird in der Konfiguration zur Online Application angegeben (<a href="#OnlineApplication/AuthComponent/STORK">hier</a>).</p>
-<p><b>AuthComponent/ForeignIdentities/STORK/SAMLSigningParameter</b> <br />
- Dieser Konfigurationseintrag enth&auml;lt Informationen dazu, mit welchem Zertifikat ausgehende STORK SAML Nachichten signiert werden und welches MOA-SP TrustProfil zur Signatur&uuml;berpr&uuml;fung von empfangenen STORK SAML Nachrichten herangezogen werden soll.
- In der Konfiguration wird eine Unterscheidung zwischen Signaturerstellungs- und Signaturverifizierungsparameter getroffen:
-<ul>
- <li><tt>&lt;SignatureCreationParameter&gt;</tt> <br />
- </li>
- <li><tt>&lt;SignatureVerificationParameter&gt;</tt> <br />
- </li>
-</ul>
-<p>Der <tt>&lt;SignatureCreationParameter&gt;</tt> kapselt dabei Informationen, welche zum Signieren von ausgehenden STORK SAML Nachrichten ben&ouml;tigt werden. Im Wesentlichen sind das Informationen zu dem KeyStore, welcher das Schl&uuml;sselpaar zum Signieren ausgehender STORK SAML Nachrichten beinhaltet. Der entsprechende Konfigurationseintrag sieht wie folgt aus:</p>
-<pre>
-&lt;SignatureCreationParameter&gt;
- &lt;KeyStore password="Keystore Pass"&gt;file_to_keystore&lt;/KeyStore&gt;
- &lt;KeyName password="Keystore Name"&gt;signing_key_name&lt;/KeyName&gt;
-&lt;/SignatureCreationParameter&gt;
-</pre>
-Die folgenden Werte sind dabei anzugeben bzw. durch echte Werte auszutauschen:
-<ul>
- <li><tt>file_to_keystore</tt>: Relativer Pfad zum KeyStore (Java oder PKCS#12), welcher das Schl&uuml;sselpaar zum Signieren ausgehender STORK SAML Nachrichten speichert <br />
- </li>
- <li><tt>Keystore Pass</tt>: Passwort zum angegebenen KeyStore <br />
- </li>
- <li><tt>signing_key_name</tt>: Alias Name des Schl&uuml;ssels, welcher zum Signieren verwendet werden soll <br />
- </li>
- <li><tt>Key Pass</tt>: Passwort zum angegebenen Schl&uuml;ssel <br />
- </li>
-</ul>
-<p>Der <tt>&lt;SignatureCreationParameter&gt;</tt> kapselt dabei Informationen, die f&uuml;r eine Signaturpr&uuml;fung von eingehenden STORK SAML Nachrichten ben&ouml;tigt werden. Im Wesentlich ist das die Angabe des MOA-SP TrustProfils, welches die vertrauensw&uuml;rdigen Zertifikate der europ&auml;ischen C-PEPS enth&auml;lt. Der entsprechende Konfigurationseintrag sieht daher wie folgt aus:</p>
-<pre>
-&lt;SignatureVerificationParameter&gt;
- &lt;TrustProfileID&gt;C-PEPS&lt;/TrustProfileID&gt;
-&lt;/SignatureVerificationParameter&gt;
-</pre>
-Die folgenden Werte sind dabei anzugeben:
-<ul>
- <li><tt>TrustProfile</tt>: Dieser Eintrag gibt jenes TrustProfil von MOA-SP an, welches zur Signaturpr&uuml;fung von eingehenden STORK SAML Nachrichten herangezogen werden soll. Vorkonfiguriert sind die beiden TrustProfiles <tt>C-PEPS</tt> (Produktive C-PEPS Zertifikate) und <tt>C-PEPS-Test</tt> (Test C-PEPS Zertifikate). Sollte es auch hier zu &Auml;nderungen kommen, werden diese auch via JoinUp (<a href="https://joinup.ec.europa.eu/software/moa-idspss/home" target="_new">TODO MOA@JoinUp</a>) bzw. MOA-Mailingliste ver&ouml;ffentlicht. <br />
- </li>
-</ul>
-<p id="AuthComponent_OnlineMandates">
-<b>AuthComponent/OnlineMandates</b>
-<br />
-Ab Version 1.5.0 bietet MOA-ID die M&ouml;glichkeit der Nutzung von Online-Vollmachten f&uuml;r Anwendungen aus dem &ouml;ffentlichen Bereich. Hierf&uuml;r ist ein Online-Vollmachten-Service n&ouml;tig. Es ist hierzu ein ensprechender <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a> zu definieren, der die Zugangsdaten zum Online-Vollmachten-Service bereith&auml;lt (siehe <a href="#ConnectionParameter"><tt>ConnectionParameter</tt></a>). In der Default-Konfiguration ist der Zugang zum Online-Vollmachten-Service bereits aktiviert. Es muss nur noch das Client-Zertifikat f&uuml;r die SSL-Verbinung zum Service angegeben werden. Voraussetzung daf&uuml;r ist ein Zertifikat von A-Trust bzw. A-CERT mit Verwaltungseigenschaft oder Dienstleistereigenschaft. Wenn ihr MOA-ID Zertifikat diese Voraussetzung erf&uuml;llt, k&ouml;nnen Sie dieses hier angeben.<br />
-Hinweis: Um den Online-Vollmachten Modus f&uuml;r eine Online Applikation zu aktivieren, m&uuml;ssen Sie das Vollmachten Profil angeben - siehe <a href="#OnlineApplication/AuthComponent/Mandates">hier</a>.
-</p>
-<p> <b>ProxyComponent</b> <br />
- <tt>ProxyComponent</tt> enth&auml;lt Parameter, die
- nur die MOA-ID Proxykomponente betreffen. Das Element
- ist optional und muss nicht verwendet werden, wenn auf
- dem Server keine MOA-ID Proxykomponente installiert
- wird. </p>
-<p> Das Element <tt>ProxyComponent</tt> hat nur das Kind-Element <tt>AuthComponent</tt>, das die Verbindung zur Authentisierungs-komponente
- beschreibt. </p>
-<p>Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente
- &uuml;ber ein Webservice auf, dann muss das Element <tt>ConnectionParameter</tt> spezifiziert werden. </p>
-<p> Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente
- &uuml;ber das API auf, dann wird das Element <tt>ConnectionParameter</tt> nicht spezifiziert. </p>
-<p id="OnlineApplication"> <b>OnlineApplication</b> <br />
- F&uuml;r jede Online-Applikation, die &uuml;ber MOA-ID
- authentisiert wird, gibt es ein Element <tt>OnlineApplication</tt>.
- Die Parameter betreffen teils die MOA-ID Authentisierungskomponente,
- teils die MOA-ID Proxykomponente, teils beide. </p>
-<p>Das ab Version 1.3 optionale Attribut <tt>OnlineApplication/@type</tt> spezifiziert den Typ der OnlineApplikation und kann
- die Werte <tt>publicService</tt> f&uuml;r eine Applikation
- aus dem &ouml;ffentlichen Bereich und <tt>businessService</tt> f&uuml;r eine Anwendung aus dem privatwirtschaftlichen Bereich annehmen.
- Ab Version 1.4 kann im Modus <tt>businessService</tt> ein zus&auml;tzliches
- logisches Attribut <tt>OnlineApplication/@calculateHPI</tt> angegeben werden.
- Dadurch wird im Falle von <tt>calculateHPI="true"</tt> im privatwirtschaftlichen
- Bereich zur Identifikation der Health Professional Identifier HPI anstatt des wbPKs (siehe <a href="#OnlineApplication/AuthComponent/IdentificationNumber"> OnlineApplication/AuthComponent/IdentificationNumber</a>) berechnet
- und zur Anmeldung weiterverwendet.
- Ist dieses Attribut nicht gesetzt, so wird der Typ <tt>publicService</tt> vorausgesetzt. </p>
-<p>Das Attribut <tt>OnlineApplication/@publicURLPrefix</tt> entspricht dem URL-Pr&auml;fix der nach au&szlig;en
- sichtbaren Dom&auml;ne der Online-Applikation, welcher
- von der MOA-ID Proxykomponente durch den URL-Pr&auml;fix
- der wirklichen Dom&auml;ne (Attribut <tt>OnlineApplication/ProxyComponent/ConnectionParameter/@URL</tt>)
- ersetzt wird. Es dient als Schl&uuml;ssel zum Auffinden
- der Konfigurationsparameter zur Online-Applikation. </p>
-<p>Mit dem Attribut <tt>OnlineApplication/@friendlyName</tt> kann eine benutzerfreundlicher Name f&uuml;r die Online-Applikation angegeben werden. Dieser Name scheint beim Login des Benutzer auf.</p>
-<p>Das Attribut <tt>OnlineApplication/@keyBoxIdentifier</tt> gibt das Schl&uuml;sselpaar an, welches von der B&uuml;rgerkartenumgebung
- zum Signieren des Auth Blocks verwendet wird. M&ouml;gliche
- Werte: <tt>CertifiedKeypair </tt>sowie<tt> SecureSignatureKeypair.</tt></p>
-<p>Das Attribut <tt>OnlineApplication/@target</tt> gibt einen konkreten Gesch&auml;ftsbereich f&uuml;r eine Online-Applikation vor. D.h. es wird der Target-Parameter aus dem Request mit diesem Wert &uuml;berschrieben. Zus&auml;tzlich kann noch ein benutzerfreundlicher Name mittels des Attributs <tt>OnlineApplication/@targetFriendlyName</tt> f&uuml;r den Gesch&auml;ftsbereich angegeben werden. Beide Attribute k&ouml;nnen nur bei einer Online-Applikation f&uuml;r den &ouml;ffentlichen Bereich angegeben werden.</p>
-<p>Das Element <tt>OnlineApplication</tt> hat optional
- zwei Kind-Elemente: <tt>AuthComponent</tt> und <tt>ProxyComponent</tt>. </p>
-<p id="OnlineApplication/AuthComponent"> <b>OnlineApplication/AuthComponent</b> <br />
- Das Element <tt>OnlineApplication/AuthComponent</tt> muss verwendet werden wenn auf dem Server die Authentisierungskomponente
- installiert wird. Es enth&auml;lt Parameter, die
- das Verhalten der Authentisierungskomponente bez&uuml;glich
- der Online-Applikation konfiguriert. </p>
-<p>Das optionale Attribut <tt>slVersion</tt> definiert die Version des
- verwendeten SecurityLayer und damit den Namespace aller
- Requests, die von MOA-ID an die B&uuml;rgerkartenumgebung
- geschickt werden. Dieses Attribut kann entweder den Wert <tt>1.1</tt> oder <tt>1.2</tt> annehmen. Fehlt das Attribut, so wird als
- Defaultwert <tt>1.1</tt> gesetzt. <br />
- Wurde als Typ der Online-Applikation
- der Wert <tt>businessService</tt> (vgl. Attribut <tt>OnlineApplication/@type</tt>)
- spezifiziert, so wird das Attribut <tt>slVersion</tt> ignoriert
- und immer der Wert <tt>1.2</tt> verwendet, da die f&uuml;r
- Applikationen aus dem privatwirtschaftlichen Bereich notwendige
- Berechnung des <tt>wirtschaftsbereichsspezifischen Personenkennzeichens</tt> (<tt>wbPK</tt>) erst ab SecurityLayer Version <tt>1.2</tt> m&ouml;glich ist. </p>
-<p>Das Attribut <tt id="provideStammzahlOA">provideStammzahl</tt> bestimmt,
- ob die Stammzahl in den Anmeldedaten aufscheint
- oder ob der Wert ausgeblendet (d.h. auf den Leerstring gesetzt)
- wird. Die Attribute <tt>provideAUTHBlock</tt> und <tt id="provideIdentityLinkOA">provideIdentityLink</tt> steuern, ob die
- Anmeldedaten den Auth-Block bzw. die Personenbindung enthalten.
- Ab Version 1.3 kann das Attribut <tt>provideCertificate</tt> verwendet werden, um das Signatorzertifikat in die
- Anmeldedaten aufzunehmen.
- Alle Attribute sind optional und haben den Default-Wert <tt>false</tt>. <br>
- Das Attribut <tt id="provideStammzahlOA2">provideFullMandatorData</tt> bestimmt ob bei einer Vollmachten-Anmeldung die vollst&auml;ndigen Vollmacht in der SAML Assertion mitgegeben wird oder nur die Basisdaten wie Name, Geburtsdatum und bPK des Vertreters (bzw. Organwalter/PV) sowie Name, Geburtsdatum und bPK (bzw. Name und Stammzahl bei juristischen Personen) des Vertretenen in der Assertion &uuml;bermittelt. Bei <tt id="provideStammzahlOA3">provideFullMandatorData=false</tt> werden nur die Basisdaten &uuml;bermittelt (Defaulteinstellung). Bei <tt id="provideStammzahlOA4">provideFullMandatorData=true</tt> wird zus&auml;tzlich die gesamte Vollmacht &uuml;bergeben.<br>
- Das Attribut <tt id="provideStammzahlOA5">useUTC</tt> bestimmt ob IssueInstant in der SAML Assertion als UTC (2012-01-26T18:38:35Z, <tt id="provideStammzahlOA8">useUTC=true</tt>) oder dem Default-Format (z.B.: 2012-01-26T19:38:35+01:00, <tt id="provideStammzahlOA9">useUTC=false</tt>) angegeben wird. </p>
-<p><b>Anmerkung</b>: Das Attribut <tt>provideStammzahl</tt> steht in keinem
- Zusammenhang zum gleichnamigen Attribut <a href="#provideStammzahlVI">VerifyInfoboxes/@provideStammzahl</a>,
- das angibt ob die Stammzahl an eine <i>Pr&uuml;fapplikation</i> weitergegeben
- werden darf. <b>Anmerkung</b>: Das Attribut <tt>provideIdentityLink</tt> steht in keinem
- Zusammenhang zum gleichnamigen Attribut <a href="#provideIdentityLinkVI">VerifyInfoboxes/@provideIdentityLink</a>,
- das angibt ob die Personenbindung an eine <i>Pr&uuml;fapplikation</i> weitergegeben werden soll. </p>
-<p id="OnlineApplication/AuthComponent/IdentificationNumber"> <b>OnlineApplication/AuthComponent/IdentificationNumber</b> <br />
- Das <tt>wirtschaftsbereichsspezifische Personenkennzeichen</tt> (<tt>wbPK</tt>)
- wird aus der auf der B&uuml;rgerkarte gespeicherten Stammzahl des B&uuml;rgers
- und der Stammzahl des Wirtschaftsunternehmens berechnet.
- Laut <a href="http://reference.e-government.gv.at/E-Government-Gesetz.394.0.html" target="_new">E-Governmentgesetz</a> darf die <i>Errechnung eines wbPK aus der Stammzahl nicht beim Auftraggeber eines
- privaten Bereichs durchgef&uuml;hrt werden</i> (vgl. E-GovGesetz &sect;12(1).4), und muss deshalb
- an die B&uuml;rgerkartenumgebung ausgelagert werden.
- Das <tt>OnlineApplication/AuthComponent/IdentificationNumber</tt> Element
- wird nun verwendet, um die Stammzahl des Wirtschaftsunternehmens zu spezifizieren,
- welche in weiterer Folge von MOA-ID an die B&uuml;rgerkartenumgebung &uuml;bergeben
-wird.
-<p>Dieses Element muss bei privatwirtschaftlichen Applikationen
- vorhanden sein und wird ignoriert, falls es im Kontext von Anwendungen aus
-dem &ouml;ffentlichen Bereich verwendet wird.
-<p>Das Element hat genau eines der folgenden m&ouml;glichen Kindelemente
- aus dem <a href="http://www.buergerkarte.at/konzept/personenbindung/spezifikation/20050214/" target="_new">PersonData</a> Namespace, die als einzigen Inhalt die jeweilige Stammzahl des Unternehmens enthalten:
-<ul>
- <li> Das Element <tt>pr:Firmenbuchnummer</tt> enth&auml;lt als einzigen Inhalt
- die Firmenbuchnummer des Unternehmens. </li>
- <li> Das Element <tt>pr:Vereinsnummer</tt> enth&auml;lt als einzigen Inhalt
- die Vereinsregisternummer des Unternehmens. </li>
- <li> Das Element <tt>pr:ERJPZahl</tt> enth&auml;lt als einzigen Inhalt eine
- Zahl aus dem Erg&auml;nzungsregister f&uuml;r nicht-nat&uuml;rliche Personen (CorporateBody). </li>
- <li> Das Element <tt>pr:ZMRzahl</tt> enth&auml;lt als einzigen Inhalt eine
- Stammzahl einer nat&uuml;rlichen in &Ouml;sterreich meldepflichtigen Person. </li>
-</ul>
-<p>Die Stammzahl ist jeweils ohne Pr&auml;fix anzugeben, also wird zum Beispiel
- die Firmenbuchnummer <tt>FN468924i</tt> folgenderma&szlig;en definiert: <br />
- <br />
-<tt>&lt;pr:Firmenbuchnummer&gt;468924i&lt;/pr:Firmenbuchnummer&gt;</tt> </p>
-<p> Leerzeichen werden ignoriert und im Falle einer Firmenbuchnummer werden
- f&uuml;hrende Nullen gel&ouml;scht und Bindestriche aus der Nummer entfernt. </p>
-<p> Beispiele:</p>
-<blockquote> <tt>468924 i</tt> wird zu <tt>468924i</tt><br />
- <tt>00468924</tt> wird zu <tt>468924i</tt><br />
-<tt>468924-i</tt> wird zu <tt>468924i</tt></blockquote>
-<p>Alternativ zu den oben angef&uuml;hrten Elementen aus dem <a href="http://www.buergerkarte.at/konzept/personenbindung/spezifikation/20050214/" target="_new">PersonData</a> Namespace kann auch das Element <tt>AnyNumber</tt> verwendet werden, um
- Stammzahlen zu spezifizieren, die nicht einer der vier oben aufgelisteten
-Kategorien zugeordnet werden k&ouml;nnen. </p>
-<p>Das Element <tt>AnyNumber</tt> hat genau ein Attribut namens <tt>Identifier</tt>,
- das das Pr&auml;fix der jeweiligen Stammzahl ent&auml;lt. Der Inhalt des
- Elements <tt>AnyNumber</tt> ist die Stammzahl selbst, wobei die selben Regeln
-wie oben gelten.</p>
-<p>Die Firmenbuchnummer aus obigem Beispiel k&ouml;nnte man nun beispielsweise mit Hilfe das Elements <tt>AnyNumber</tt> auch folgenderma&szlig;en definieren: <br>
- </br>
-<tt>&lt;AnyNumber Identifier="FN"&gt;468924i&lt;/AnyNumber&gt;</tt> </p>
-<p>Es sei aber nochmals daraufhingewiesen, dass f&uuml;r Stammzahlen der
- Kategorien <tt>Firmenbuchnummer</tt>, <tt>Vereinsnummer</tt>, <tt>ERJPZahl</tt> und <tt>ZMRzahl</tt> die vordefinierten Elemente aus
- dem <a href="http://www.buergerkarte.at/konzept/personenbindung/spezifikation/20050214/" target="_new">PersonData</a> Namespace verwendet werden sollen. Das Element <tt>AnyNumber</tt> wurde haupts&auml;chlich in
- das Schema aufgenommen, um offen f&uuml;r m&ouml;gliche Erweiterungen zu sein.
- </p>
-</p>
-<p id="OnlineApplication/AuthComponent/Templates"> <b>OnlineApplication/AuthComponent/Templates</b> <br />
- Dieses Kindelement kann genau einmal vorkommen und entspricht in seiner Struktur dem
- Element <a href="#AuthTemplates" target="_new">AuthComponent/Templates</a>.
- Es kann verwendet werden, um Templates zur Gestaltung der Seiten
- &quot;Auswahl der B&uuml;rgerkartenumgebung&quot; und &quot;Anmeldung mit B&uuml;rgerkarte&quot; individuell f&uuml;r
- eine Online-Applikation zu definieren. Die hier definierten Templates haben
- Priorit&auml;t gegen&uuml;ber globalen Templates und Templates, die
-in der aufrufenden URL &uuml;bergeben werden. </p>
-
- <p id="OnlineApplication/AuthComponent/TransformsInfo"> <b>OnlineApplication/AuthComponent/TransformsInfo</b>
- <br />
- Dieses Kindelement kann mehrfach vorkommen und entspricht in seiner Struktur
- dem Element <tt>AuthComponent/SecurityLayer/TransformsInfo</tt>.
- Das Element kann verwendet werden, um f&uuml;r unterschiedliche
- Online-Applikationen unterschiedliche Transformationen zu spezifizieren.
- Alle &uuml;ber dieses Element definierten Transformationen haben
- Vorrang gegen&uuml;ber die durch <tt>AuthComponent/SecurityLayer/TransformsInfo</tt>
- angegebenen Transformationen. Das hei&szlig;t, ist f&uuml;r eine
- Online-Applikation das Kindelement <tt>AuthComponent/TransformsInfo</tt>
- vorhanden, so wird f&uuml;r diese Applikation die durch dieses Element
- spezifizierte Transformation verwendet (das Element kann nat&uuml;rlich
- mehrfach vorkommen, wodurch mehrere Transformationen bezeichnet werden).
- F&uuml;r alle Applkikationen, die kein Kindelement vom Typ
- <tt>AuthComponent/TransformsInfo</tt> enthalten, werden die unter
- <tt>AuthComponent/SecurityLayer/TransformsInfo</tt> spezifizierten
- &quot;Default-Transformationen&quot; verwendet. </p>
-<p>Dabei ist zu beachten, dass f&uuml;r jede definierte Transformation
- ein entsprechendes <tt>MOA-SP/VerifyAuthBlock/VerifyTransformsInfoProfileID</tt>
- Element vorhanden sein muss.</p>
- </p>
-
- <p id="VerifyInfoboxesOA"> <b>OnlineApplication/AuthComponent/VerifyInfoboxes</b>
- <br />
- Dieses optionale Element entspricht dem <a href="#VerifyInfoboxesAuth">VerifyInfoboxes</a>-Element
- aus der globalen AUTH-Komponente und &uuml;berschreibt teilweise die
- dort gesetzten Werte f&uuml;r die jeweilige Infobox pro Online-Applikation.
- Dabei gelten die folgenden Regeln:
-<p>Ist nur das globale <a href="#VerifyInfoboxesAuth">VerifyInfoboxes</a>-Element
- vorhanden, so gelten die dort definierten Parameter f&uuml;r <b>alle</b>
- Online-Applikationen. Ist kein globales Element vorhanden, so kann
- MOA-ID f&uuml;r alle Online-Applikation, in deren AUTH-Komponente
- ein <tt>VerifyInfoboxes</tt>-Element enthalten ist, die darin
- definierten Infoboxen &uuml;berpr&uuml;fen. F&uuml;r
- Online-Applikationen, in deren AUTH-Komponente kein
- <tt>VerifyInfoboxes</tt>-Element gesetzt ist, kann demnach keine
- andere Infobox als die der Personenbindung validiert werden.
- <br />
- Sind sowohl global (<tt>MOA-IDConfiguration/AuthComponent/VerifyInfoboxes</tt>)
- als auch lokal (<tt>OnlineApplication/AuthComponent/VerifyInfoboxes</tt>)
- in den Online-Applikationen Infobox-Validatoren konfiguriert, so verarbeitet
- MOA-ID die darin enthaltenen Parameter wie folgt:
-<ul>
- <li id="DefaultTrustProfileOA"><tt>DefaultTrustProfile</tt>: Ein lokal
- definiertes Default-Trust-Profil hat sowohl Vorrang gegen&uuml;ber einem
- global gesetzten <a href="#DefaultTrustProfileVI">Default-Trust-Profil</a>
- als auch gegen&uuml;ber einem global gesetzen
- <a href="#TrustProfileVI">infobox-spezifischen</a> Trustprofil. Ist
- beispielsweise im globalen <tt>VerifyInfoboxes</tt>-Element zwar kein
- Default-Trust-Profil, aber f&uuml;r die Infobox A ein eigenes Trust-Profil
- definiert, so wird ein lokal definiertes Default-Trust-Profil dem global
- f&uuml;r die Infobox A gesetzten Trust-Profil vorgezogen.
- </li>
- <li id="InfoboxOA"><tt>Infobox</tt>: MOA-ID kann die Vereinigung aus den
- global und lokal konfigurierten Infoboxen f&uuml;r eine Online-Applikation
- validieren. Sind beispielsweise global Pr&uuml;fapplikationen
- f&uuml;r die Infoboxen mit den Bezeichnern
- (<a href="#IdentifierVI">Infobox/@Identifier</a>-Attribut) <tt>A</tt>
- und <tt>B</tt> konfiguriert, und lokal f&uuml;r die Online-Applikation
- <tt>OA1</tt> die Infoboxen <tt>B</tt>, <tt>C</tt> und <tt>D</tt>, so
- kann MOA-ID f&uuml;r die Online-Applikation <tt>OA1</tt> die
- Infoboxen <tt>A</tt>, <tt>B</tt>, <tt>C</tt> und <tt>D</tt> validieren.
- F&uuml;r die Infobox <tt>A</tt> werden dabei die Parameter aus der
- globalen Konfiguration verwendet und f&uuml;r die Infoboxen
- <tt>C</tt> und <tt>D</tt> die lokalen Parameter. F&uuml;r die Infobox
- <tt>B</tt> sind sowohl globale als auch lokale Parameter vorhanden,
- die von MOA-ID wie folgt interpretiert werden:
- <ul>
- <li>Attribute:
- Die Attribute <a href="#requiredVI">required</a>,
- <a href="#provideStammzahlVI">provideStammzahl</a> und
- <a href="#provideIdentityLinkVI">provideIdentityLink</a> <b><i>&uuml;berschreiben</i></b>
- die global gesetzten Werte. Dabei ist zu beachten, das ein Fehlen dieser
- Attribute bedeutet, dass ihnen &uuml;ber das Schema der Defaultwert
- <tt>false</tt> zugewiesen wird. Ist also beispielsweise f&uuml;r die
- Infobox mit dem Bezeichner <tt>B</tt> das <tt>required</tt>-Attribut
- global auf <tt>true</tt> gesetzt (&lt;Infobox Identifier="B" required="true"&gt;)
- und fehlt dieses Attribut lokal in der Online-Applikation <tt>OA1</tt>
- (&lt;Infobox Identifier="B"&gt;), so hat das <tt>required</tt>-Attribut
- f&uuml;r die Infobox <tt>B</tt> den Wert <tt>false</tt>.
- <br />
- Die Attribute <a href="#requiredVI">required</a>,
- <a href="#provideStammzahlVI">provideStammzahl</a> und
- <a href="#provideIdentityLinkVI">provideIdentityLink</a> m&uuml;ssen also
- f&uuml;r Infoboxen, die sowohl global als auch lokal konfiguriert sind,
- in jeder lokalen Konfiguration neu gesetzt werden, wenn ihnen der Wert
- <tt>true</tt> zugwiesen werden sollen.
- </li>
- <li>Kind-Elemente:
- <ul>
- <li id="FriendlyNameOA"><a href="#FriendlyNameVI">FriendlyName</a>:
- Ein lokal gesetzter <tt>FriendlyName</tt> wird einem global
- gesetzten vorgezogen. Ist sowohl lokal als auch global kein
- <tt>FriendlyName</tt> definiert, so wird das
- <a href="#IdentifierVI">Identifier</a>-Attribut als <tt>FriendlyName</tt>
- verwendet.
- <br />
- </li>
- <li id="TrustProfileOA"><a href="#TrustProfileVI">TrustProfileID</a>:
- Ein lokal definiertes Trust-Profil wird einem lokal definierten
- Default-Trust-Profil vorgezogen. Sind lokal sowohl kein
- Default-Trust-Profil als auch kein infobox-spezifisches Trust-Profil
- definiert, so wird das global gesetzte infobox-spezifisches Trust-Profil
- verwendet. Fehlt auch dieses, so wird das globale Default-Trust-Profil
- selektiert. Ist weder lokal als auch lokal ein Trust-Profil
- definiert, so wird f&uuml;r f&uuml;r die Validierung dieser
- Infobox kein Trust-Profil ben&ouml;tigt.
- </li>
- <li id="ValidatorClassOA"><a href="#ValidatorClassVI">ValidatorClass</a>:
- Eine lokal gesetzte Validator-Klasse wird einer global gesetzten
- vorgezogen. Ist sowohl lokal als auch global f&uuml;r eine Infobox
- keine Validator-Klasse konfiguriert, so wird die Default-Klasse
- geladen (siehe <a href="#ValidatorClassVI">ValidatorClass</a>).
- </li>
- <li id="SchemaLocationsOA"><a href=#SchemaLocations">SchemaLocations</a>:
- Lokal definierte Schemas werden global definierten vorgezogen.
- Sind lokal keine Schemas konfiguriert, so werden die globalen verwendet,
- so sie vorhanden sind.
- </li>
- <li id="ApplicationSpecificParametersOA">
- <a href="#ApplicationSpecificParameters">ApplicationSpecificParameters</a>:
- Lokal definierte applikationsspezifische Parameter werden global
- definierten vorgezogen. Sind lokal keine derartigen Parameter
- konfiguriert, so werden die globalen verwendet, so sie vorhanden
- sind.
- </li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-<p><b id="VerifyInfoboxesSample">Beispiel</b>: In der Konfigurationsdatei
- <a href="examples/SampleMOAIDVerifyInfoboxesConfiguration.xml" target="_new">
- SampleMOAIDVerifyInfoboxesConfiguration.xml</a> sind global
- (<tt>MOA-IDConfiguration/AuthComponent/VerifyInfoboxes</tt>)
- Pr&uuml;fapplikationen f&uuml;r die beiden Infoboxen mit den Bezeichnern
- <tt>InfoboxA</tt> und <tt>InfoboxB</tt> konfiguriert.
- <tt>InfoboxA</tt> demonstriert in diesem Beispiel die minimale Konfiguration
- einer Pr&uuml;fapplikation - es ist nur der Identifier angegeben. MOA-ID
- wird in diesem Fall versuchen, die Default-Validatorklasse
- <tt>at.gv.egovernment.moa.id.auth.validator.infoboxa.InfoboxAValidator</tt>
- zu laden (siehe dazu auch MOA-ID-Spezifikation, Abschnitt 4.7.2.3,
- <tt>Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse</tt>).
- Da ein Default-Trust-Profil (<tt>GlobalVIDefaultTrust</tt>) konfiguriert ist,
- wird MOA-ID dieses Profil zur Verifikation von Zertifikaten heranziehen.
- Da kein <tt>FriendlyName</tt> gesetzt ist, wird das <tt>Identifier</tt> Attibut
- (<tt>InfoboxA</tt>) als <tt>FriendlyName</tt> verwendet. Weitere Parameter
- sind f&uuml;r die Verifikation dieser Infobox nicht erforderlich.
- <br>
-Die Pr&uuml;fapplikation f&uuml;r die <tt>InfoboxB</tt> setzt nahezu alle
- m&ouml;glichen Parameter mit Ausnahme der Validator-Klasse. MOA-ID wird
- zur Verifikation dieser Infobox also auch die daf&uuml;r zust&auml;dige Default-Klasse
- (<tt>at.gv.egovernment.moa.id.auth.validator.infoboxb.InfoboxBValidator</tt>)
- laden, und alle konfigurierten Parameter an diese Klasse &uuml;bergeben.
- In die Konfigurationsdatei sind drei Online-Applikationen mit den
-public URL-Prefixen <tt>https://OA1/</tt>, <tt>https://OA2/</tt> und
- <tt>https://OA3/</tt> eingetragen.
- Online-Applikation <tt>OA1</tt> konfiguriert Pr&uuml;fapplikationen f&uuml;r
- die drei Infoboxen <tt>InfoboxB</tt>, <tt>InfoboxC</tt> und
- <tt>InfoboxD</tt>. Das hei&szlig;t, MOA-ID kann f&uuml;r die Online-Applikation
- <tt>OA1</tt> insgesamt vier Infoboxen &uuml;berpr&uuml;fen: die
- Parameter f&uuml;r die Infobox <tt>InfoboxA</tt> werden
- von der entsprechenden global konfigurierten Pr&uuml;applikation
- &uuml;bernommen. Die Infoboxen <tt>InfoboxC</tt> und
- <tt>InfoboxD</tt> sind nur lokal gesetzt. F&uuml;r <tt>InfoboxB</tt>
- &uuml;bernimmt MOA-ID die applikationsspezifischen Parameter aus der
- entsprechenden global konfigurierten Infobox und &uuml;berschreibt
- alle weiteren Parameter mit den lokalen Werten. Als Trust-Profil wird
- das lokale Deafult-Trust-Profil (<tt>LocalOA1DefaultTrust</tt>) genommen -
- dieses hat Vorrang gegen&uuml;ber den global gesetzten Profilen. Weiters
- ist zu beachten, dass die Attribute <tt>provideStammzahl</tt> und
- <tt>provideIdentityLink</tt> lokal nicht gesetzt sind, und daher den
- Deafult-Wert <tt>false</tt> einnehmen.
- <br />
- Das <tt>VerifyInfoboxes</tt>-Element in der AUTH-Komponente der zweiten
- Online-Applikation (<tt>OA2</tt>) spezifiziert keine anderen Pr&uuml;fapplikationen
- als die global definierten, &uuml;berschreibt aber f&uuml;r beide Infoboxen
- teilweise die global gesetzten Parameter. <tt>InfoboxA</tt> verwendet
- ein lokal definiertes Trust-Profil (<tt>LocalInfoboxOA2ATrust</tt>),
- <tt>InfoboxB</tt> &uuml;bernimmt
- alle globalen Parameter, setzt aber f&uuml;r die Attribute <tt>required</tt>,
- <tt>provideStammzahl</tt> und <tt>provideIdentityLink</tt> jeweils den
- Defaultwert <tt>false</tt>.
- <br />
- Die dritte Online-Applikation <tt>OA3</tt> enth&auml;lt in Ihrer AUTH-Komponente
- kein <tt>VerifyInfoboxes</tt>-Element. MOA-ID &uuml;bernimmt daher f&uuml;r
- diese Online-Applikation die global konfigurierten Infobox-Pr&uuml;applikationen
- (<tt>InfoboxA</tt> und <tt>InfoboxB</tt>) mit allen Paramertern genauso wie
- sie dort gesetzt sind. Zu beachten ist hier, dass das in der AUTH-Komponente
- auf <tt>true</tt> gesetzte Attribut <tt>proviedStammzahl</tt> die
- Online-Applikation und <b><i>nicht</i></b> die Pr&uuml;applikation
- betrifft.
- <br />
- </p>
- <p id="OnlineApplication/AuthComponent/Mandates"> <b>OnlineApplication/AuthComponent/Mandates</b>
- <br />
- Mit Hilfe dieses Elements werden die Online-Vollmachten f&uuml;r die Online-Applikation aktiviert.
- Als Kindelement muss <tt>Profiles</tt> angegeben werden. Dieses Element beinhaltet eine (Komma-separierte)
- Liste von Vollmachten-Profilen, die festlegen mit welchen Vollmachtstypen man sich bei der Online-Applikation anmelden kann.
-Unter <a href="https://vollmachten.stammzahlenregister.gv.at/mis/" target="_blank">https://vollmachten.stammzahlenregister.gv.at/mis/</a> finden Sie eine Liste der unterst&uuml;tzen Vollmachten-Profile.</p>
- <p><em>Hinweis:</em> Hierzu muss auch die Verbindung zum Online-Vollmachten Service konfiguriert werden - siehe <a href="#AuthComponent_OnlineMandates">hier</a>
- </p>
-
- <p id="OnlineApplication/AuthComponent/STORK"> <b>OnlineApplication/AuthComponent/STORK</b>
- <br />
- Innerhalb dieses Konfigurationsblocks kann angegeben werden, welche zus&auml;tzlichen Attribute (neben eIdentifier, givenName, surname und dateOfBirth, welche defaultm&auml;&szligig requested werden) im Rahmen einer STORK Anmeldung f&uuml;r diese Applikation vom B&uuml;rger abgefragt werden sollen. Au&szligerdem kann zu Testzwecken das ben&ouml;tigte Authentifzierungslevel (STORK QAALevel) vom defaultm&auml;&szligig h&ouml;chstem Level von 4 f&uuml;r diese Applikation verringert werden.
- F&uuml;r ein anderes STORK QAALevel muss folgendes XML Element mit einem Wert zwischen 1 und 4 angegeben werden: <tt>&lt;stork:QualityAuthenticationAssuranceLevel&gt;</tt>.
-<p>Die zus&auml;tzlichen Attribute werden im Element <tt>&lt;storkp:RequestedAttributes&gt;</tt> gekapselt. Ein entsprechener Konfigurationseintrag k&ouml;nnte folgenderma&szligen aussehen:
-<pre>
-&lt;storkp:RequestedAttributes&gt;
- &lt;stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/age" isRequired="false" <br> NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"/&gt;
- &lt;stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eMail" isRequired="false" <br> NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"/&gt;
- &lt;stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" isRequired="false" <br> NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"&gt;
- &lt;stork:AttributeValue&gt;1&lt;/stork:AttributeValue&gt;
- &lt;/stork:RequestedAttribute&gt;<br>&lt;/storkp:RequestedAttributes&gt;</pre>
- Bei der Inkludierung von <tt>&lt;stork:RequestedAttribute&gt;</tt> Elementen sind folgende XML Attribute anzugeben:
-<ul>
- <li><tt>Name</tt>: Der Name des entsprechenden STORK Attributes.
- <br />
- </li>
- <li><tt>isRequired</tt>: Gibt durch <tt>true</tt> oder <tt>false</tt> an, ob das angefragte Attribut f&uuml;r die Applikation verpflichtend oder nur optional ben&ouml;tigt wird.
- <br />
- </li>
- <li><tt>NameFormat</tt>: Gibt das Format des Attributes an und MUSS den Wert <tt>urn:oasis:names:tc:SAML:2.0:attrname-format:uri</tt> beinhalten.
- <br />
- </li>
- <li>Element <tt>&lt;stork:AttributeValue&gt;</tt>: Dieses Element ist optional und gibt einen Vergleichswert f&uuml;r ein abzufragendes Attribut an. Im Beispiel von <tt>isAgeOver</tt> wird in der Antwort retourniert, ob die authentifizierte Person &auml;lter als das geforderte angegebene Alter ist.
- <br />
- </li>
- </ul>
- <p>Details zu den STORK Attributen k&ouml;nnen im <a href="../MOA_ID_1.5.2_Anhang.pdf" target="_new">Anhang zur MOA-ID Spezifikation</a> bzw. in der <a href="https://www.eid-stork.eu/index.php?option=com_processes&Itemid=&act=streamDocument&did=1880" target="_blank">STORK Spezifikation</a> gefunden werden.</p>
- Im Wesentlichen kann die folgende Menge an Attributen bzw. Teile daraus f&uuml;r eine Online Applikation angefragt werden:
- <ul>
- <li><tt>http://www.stork.gov.eu/1.0/inheritedFamilyName</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/adoptedFamilyName</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/gender</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/countryCodeOfBirth</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/nationalityCode</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/maritalStatus</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/textResidenceAddress</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/canonicalResidenceAddress</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/eMail</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/title</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/residencePermit</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/pseudonym</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/age</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/citizenQAALevel</tt>
- <br />
- </li>
- <li><tt>http://www.stork.gov.eu/1.0/isAgeOver</tt>
- </p>
- </li>
- </ul>
- <p id="OnlineApplication/ProxyComponent"> <b>OnlineApplication/ProxyComponent</b>
- <br />
- Das Element <tt>OnlineApplication/ProxyComponent</tt>
- muss verwendet werden wenn auf dem Server die
- Proxykomponente installiert wird. <br />
- <br />
- Das optionale Attribut <tt>configFileURL</tt>
- verweist auf eine Konfigurationsdatei die dem Schema
- <a href="../MOA-ID-Configuration-1.5.1.xsd" target="_new">MOA-ID-Configuration-1.5.1.xsd</a>
- entspricht mit Dokument-Element <tt>Configuration</tt>.
- Die Angabe erfolgt relativ zur verwendeten MOA-ID
- Konfigurationsdatei. Beispiel f&uuml;r das Element
- <tt>configFileURL</tt>: &quot;oa/SampleOAConfiguration.xml&quot;.<br />
- Defaultm&auml;&szlig;ig wird versucht die Datei
- von der betreffenden OnlineApplikation unter dem
- Wert: <tt>http://&lt;realURLPrefix&gt;/MOAConfig.xml</tt>
- zu laden.<br/>
- (<tt>&lt;realURLPrefix&gt;</tt> entspricht dem
- Wert von <tt>OnlineApplication/ProxyComponent/ConnectionParameter/@URL</tt>)
- <br />
- <br />
- Das optionale Attribut <tt>sessionTimeOut</tt>
- legt das Timeout einer Benutzersession in der
- Proxykomponente in Sekunden fest.<br />
-Default-Wert: 3600 </p>
-<p>Im optionalen Attribut <tt>loginParameterResolverImpl</tt>
- kann der Klassenname eines zu verwendenden <tt>LoginParameterResolver</tt>
- angegeben werden, welcher die Defaultimplementierung
- ersetzt. </p>
- <p>Im optionalen Attribut <tt>loginParameterResolverConfiguration
- </tt>kann ein Configurationsstring f&uuml;r die
- Initialisierung der betreffenden <tt>loginParameterResolverImpl</tt>
-angegeben werden.</p>
- <p>Im optionalen Attribut <tt>connectionBuilderImpl</tt>
- kann der Klassenname eines zu verwendenden ConnectionBuilder
- angegeben werden, welcher die Defaultimplementierung
- ersetzt. </p>
-<p>Im Kind-Element <tt>ConnectionParameter</tt> ist
- konfiguriert, wie MOA-ID-PROXY zur Online-Applikation
- verbindet. </p>
- <p id="ChainingModes"> <b>ChainingModes</b><br />
- Das Element <tt>ChainingModes</tt> definiert,
- ob bei der Zertifikatspfad-&uuml;berpr&uuml;fung
- das Kettenmodell (<tt>"chaining"</tt>) oder
- das Modell nach PKIX RFC 3280 (<tt>"pkix"</tt>)
-verwendet werden soll. </p>
- <p>Das Attribut <tt>systemDefaultMode</tt> spezifiziert
- das Modell, das im Standardfall verwendet werden
- soll. </p>
- <p>Mit dem Kind-Element <tt>TrustAnchor</tt> kann
- f&uuml;r jeden Trust Anchor ein abweichendes
- Modell spezifiziert werden. Ein Trust Anchor
- ist ein Zertifikat, das in <tt>TrustedCACertificates</tt>
- spezifiziert ist. Ein Trust Anchor wird durch
- den Typ <tt>&lt;dsig:X509IssuerSerialType&gt;</tt>
- spezifiziert. Das f&uuml;r diesen Trust Anchor
- g&uuml;ltige Modell wird durch das Attribut
- <tt>mode</tt> spezifiziert. </p>
- <p>G&uuml;ltige Werte f&uuml;r die Attribute <tt>systemDefaultMode</tt>
- und <tt>mode</tt> sind <tt>"chaining"</tt> und
- <tt>"pkix"</tt>. <br/>
- <br/>
- <a href="examples/ChainingModes.txt">Beispiel</a>
- </p>
- <p id="TrustedCACertificates"> <b>TrustedCACertificates</b><br />
- Das Element <tt>TrustedCACertificates</tt>
- enth&auml;lt das Verzeichnis (relativ zur
- MOA-ID Konfigurationsdatei), das jene Zertifikate
- enth&auml;lt, die als vertrauensw&uuml;rdig
- betrachtet werden. Im Zuge der &Uuml;berpr&uuml;fung
- der TLS-Serverzertifikate wird die Zertifikatspfaderstellung
-an einem dieser Zertifikate beendet. </p>
- <p id="GenericConfiguration"> <b>GenericConfiguration</b><br />
- Das Element <tt>GenericConfiguration</tt>
- erm&ouml;glicht das Setzen von Namen-Werte
- Paaren mittels der Attribute <tt>name</tt>
- und <tt>value</tt>. Die folgende Liste spezifiziert
- <ul>
- <li>g&uuml;ltige Werte f&uuml;r das name-Attribut,
- </li>
- <li>eine Beschreibung </li>
- <li>g&uuml;ltige Werte f&uuml;r das value-Attribut
- und (falls vorhanden)</li>
- <li>den Default-Wert f&uuml;r das value-Attribut.
- </li>
- </ul>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="DirectoryCertStoreParameters.RootDir">
- <th align="left">name: DirectoryCertStoreParameters.RootDir</th>
- </tr>
- <tr>
- <td id="info"> Gibt den Pfadnamen zu einem
- Verzeichnis an, das als Zertifikatsspeicher
- im Zuge der TLS-Server-Zertifikats&uuml;berpr&uuml;fung
- verwendet wird.<br />
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: Name eines g&uuml;ltigen
- Verzeichnisses (relativ zur MOA-ID Konfigurationsdatei)<br />
- <b>Dieser Parameter muss angegeben werden.</b>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="AuthenticationSession.TimeOut">
- <th align="left">name: AuthenticationSession.TimeOut</th>
- </tr>
- <tr>
- <td id="info"> Gibt die Zeitspanne in
- Sekunden vom Beginn der Authentisierung
- bis zum Anlegen der Anmeldedaten an.
- Wird die Angegebene Zeitspanne &uuml;berschritten
- wird der Anmeldevorgang abgebrochen.
- <br />
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: positive Ganzzahlen
- <br />
- Default-Wert: 120 </td>
- </tr>
- </table>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="AuthenticationData.TimeOut">
- <th align="left">name: AuthenticationData.TimeOut</th>
- </tr>
- <tr>
- <td id="info"> Gibt die Zeitspanne in
- Sekunden an, f&uuml;r die die Anmeldedaten
- in der Authentisierungskomponente zum
- Abholen durch die Proxykomponente oder
- eine nachfolgende Applikation bereitstehen.
- Nach Ablauf dieser Zeitspanne werden
- die Anmeldedaten gel&ouml;scht.<br />
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: positive Ganzzahlen<br />
- Default-Wert: 600 </td>
- </tr>
- </table>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="TrustManager.RevocationChecking">
- <th align="left">name: TrustManager.RevocationChecking</th>
- </tr>
- <tr>
- <td id="info"> F&uuml;r die TLS-Server-Authentisierung
- d&uuml;rfen nur Server-Zertifikate verwendet
- werden, die eine CRLDP-Extension enthalten
- (andernfalls kann von MOA-ID keine CRL-&uuml;berpr&uuml;fung
- durchgef&uuml;hrt werden). <br />
- Soll das RevocationChecking generell
- ausgeschaltet werden, ist dieses Attribut
- anzugeben und auf "false" zu setzen.
- <br />
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: true, false<br />
- Default-Wert: true </td>
- </tr>
- </table>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="TrustManager.RevocationChecking">
- <th align="left">name: FrontendServlets.EnableHTTPConnection</th>
- </tr>
- <tr>
- <td id="info">
- <p>Standardm&auml;&szlig;ig k&ouml;nnen
- die beiden Servlets &quot;StartAuthentication&quot;
- und &quot;SelectBKU&quot; welche das
- User-Frontend darstellen, aus Sicherheitsgr&uuml;nden,
- nur &uuml;ber das Schema HTTPS aufgerufen
- werden. </p>
- <p>Wenn die beiden Servlets jedoch auch
- Verbindungen nach dem Schema HTTP
- entgegennehmen sollen, so kann mittels
- dem Attribut &quot;EnableHTTPServletConnection&quot;
- erlaubt werden.</p>
- <p>Hinweis: Sicher und sinnvoll ist
- das Erlauben der HTTP Verbindung nur
- dann, wenn ein Vorgeschalteter Webserver
- das HTTPS handling &uuml;bernimmt,
- und eine Verbindung zu den Servlets
- nur &uuml;ber diesen Webserver m&ouml;glich
- ist.</p>
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: true, false<br />
- Default-Wert: false</td>
- </tr>
- </table>
- <table border="0" cellspacing="3" cellpadding="2">
- <tr id="TrustManager.RevocationChecking">
- <th align="left"><a name="DataURLPrefix"></a>name:
- FrontendServlets.DataURLPrefix</th>
- </tr>
- <tr>
- <td id="info">
- <p>Standardm&auml;&szlig;ig wird als
- DataURL Prefix das URL Pr&auml;fix
- unter dem die MOA-ID Servlets erreichbar
- sind verwendet. Im Falle das sich
- der MOA-ID Server hinter einer Firewall
- befindet und die Requests von einem
- vorgelagertem Webserver weitergereicht
- werden, kann mit FrontendServlets.DataURLPrefix
- ein alternatives URL Pr&auml;fix angegeben
- werden. In diesem Fall muss der Webserver
- so konfiguriert sein, dass er Request
- auf diese URLs an den MOA-ID Server
- weiterleitet.</p>
- <hr />
- <b>value: </b><br />
- G&uuml;ltige Werte: URLs nach dem Schema
- 'http://' und 'https://'<br />
- Default-Wert: kein Default-Wert<br>
- Beispiel: &lt;GenericConfiguration name=&quot;FrontendServlets.DataURLPrefix&quot;
- value=&quot;https://&lt;your_webserver&gt;/moa-id-auth/&quot;/&gt;</td>
- </tr>
- </table>
- <p id="TrustedBKUs"> <b>TrustedBKUs</b><br />
- Das Element <tt>TrustedBKUs</tt>
- erm&ouml;glicht das Setzen von vertrauensw&uuml;rdigen B&uuml;rgerkartenumgebungen.
- In <tt>BKUURL</tt> Unterelementen werden die vertrauensw&uuml;rdigen URLs eingetragen. Diese Liste von URLs wird mit dem Aufruf-Parameter bkuURI abgeglichen. Lokale B&uuml;rgerkartenumgebungen m&uuml;ssen nicht eingetragen werden - diesen wird automatisch vertraut.
- </p>
-<p id="TrustedTemplateURLs"> <b>TrustedTemplateURLs</b><br />
- Das Element <tt>TrustedTemplateURLs</tt>
- erm&ouml;glicht das Setzen von vertrauensw&uuml;rdigen Templates, die sich auf externen Servern befinden.
- In <tt>TemplateURL</tt> Unterelementen werden die vertrauensw&uuml;rdigen URLs eingetragen. Diese Liste von URLs wird mit dem Aufruf-Parameter Template abgeglichen.
- </p>
-
-<h1><a name="oa-config" id="oa-config">2 Konfiguration der Online-Applikation</a></h1>
-<p>Die Konfiguration der OA beschreibt die Art und Weise, wie die Proxykomponente die Anmeldung an der Online-Applikation
-durchf&uuml;hrt. </p>
-<p>Der Name der Konfigurationsdatei wird in der Konfiguration von MOA-ID als Wert des Attributs <tt>configFileURL</tt> des Elements <tt>MOA-IDConfiguration/OnlineApplication/ProxyComponent</tt> hinterlegt. <br/>
- Ist dieses Attribut nicht gesetzt, dann wird die Datei von <tt>http://&lt;realURLPrefix&gt;/MOAConfig.xml</tt> geladen,
-wobei <tt>&lt;realURLPrefix&gt;</tt> dem Konfigurationswert <tt>OnlineApplication/ProxyComponent/ConnectionParameter/@URL</tt> entspricht. </p>
-<p>Die Konfigurationsdatei ist eine XML-Datei, die dem Schema <a href="../MOA-ID-Configuration-1.5.1.xsd" target="_new">MOA-ID-Configuration-1.5.1.xsd</a> mit dem Wurzelelement <tt>Configuration</tt> entspricht.
-</p>
-<p id="LoginType"> <b>LoginType</b><br />
- Das Element <tt>LoginType</tt> gibt an, ob die Online-Applikation ein einmaliges Login erwartet (<tt>stateful</tt>),
- oder ob die Login-Parameter bei jedem Request mitgegeben werden m&uuml;ssen (<tt>stateless</tt>). Im Fall einer stateful
- Online-Applikation werden die in der HTTP-Session der Proxykomponente gespeicherten Anmeldedaten nur f&uuml;r den Aufruf
- des Login-Scripts verwendet. Unmittelbar nach dem Aufruf werden sie gel&ouml;scht. <br />
- Default-Wert: <tt>stateful</tt> </p>
-<p id="ParamAuth"> <b>ParamAuth</b><br />
- Konfiguriert die &uuml;bergabe der Authentisierungs-Parameter an die Online-Applikation mittels URL-Parametern. Das Element
- kann ein oder mehrere Kind-Elemente <tt>&lt;Parameter&gt;</tt> beinhalten. </p>
-<p id="Parameter"> <b>ParamAuth/Parameter</b><br />
-Das Element <tt>&lt;Parameter&gt;</tt> enth&auml;lt die Attribute <tt>Name</tt> und <tt>Value</tt>.
-<p>Das Attribut <tt>Name</tt> beschreibt den Namen des Parameters und ist ein frei zu w&auml;hlender String.
-<p>Das Attribut <tt>Value</tt> beschreibt den Inhalt des Parameters und kann einen der durch <tt>MOAAuthDataType</tt> beschriebenen
- Werte annehmen. G&uuml;ltige Werte von <tt>MOAAuthDataType</tt> sind:
-<ul>
- <li><tt>MOAGivenName</tt> - der Vorname des Benutzers, wie in der Personenbindung enthalten
- <li><tt>MOAFamilyName</tt> - der Nachname des Benutzers, wie in der Personenbindung enthalten
- <li><tt>MOADateOfBirth</tt> - das Geburtsdatum des Benutzers, wie in der Personenbindung enthalten
- <li><tt>MOABPK</tt> - die bereichsspezifische Personenkennzeichnung des Benutzers, wie von der
- Authentisierungskomponente berechnet
- <li><tt>MOAWBPK</tt> - das wirtschaftsbereichsspezifische Personenkennzeichen des Benutzers, wie von der
- B&uuml;gerkartenumgebung berechnet
- <li><tt>MOAPublicAuthority</tt> - wird durch <tt>true</tt> ersetzt, falls der Benutzer mit einem Zertifikat signierte,
- welches eine <a href="../OID-1-0-3.pdf">Beh&ouml;rdenerweiterung</a> beinhaltet. Andernfalls wird <tt>false</tt> gesetzt
- <li><tt>MOABKZ</tt> - das Beh&ouml;rdenkennzeichen (nur sinnvoll, wenn <tt>MOAPublicAuthority</tt> den Wert <tt>true</tt> ergibt)
- <li><tt>MOAQualifiedCertificate</tt> - wird durch <tt>true</tt> ersetzt, falls das Zertifikat des Benutzers
- qualifiziert ist, andernfalls wird <tt>false</tt> gesetzt
- <li><tt>MOAStammzahl</tt> - die Stammzahl des Benutzers; diese ist nur dann verf&uuml;gbar, wenn die Online-Applikation
- die Stammzahl bekommen darf (und daher in der Personenbindung enthalten ist)
- <li><tt>MOAIPAddress</tt> - IP-Adresse des Client des Benutzers.
-</ul>
-Anhand der <tt>&lt;Parameter&gt;</tt>-Elemente wird der Request f&uuml;r den Login-Vorgang (f&uuml;r stateful Online-Applikationen)
-folgenderma&szlig;en zusammenge-stellt:<br />
-<blockquote> <code>GET https://&lt;login-url&gt;?<br />
- &nbsp;&nbsp;&lt;p1.name=p1.resolvedValue&gt;&<br />
- &nbsp;&nbsp;&lt;p2.name=p2.resolvedValue&gt;...</code> </blockquote>
-<p> Die <tt>&lt;login-url&gt;</tt> ergibt sich aus dem Parameter OA des <a href="id-anwendung_1.htm">Aufrufs von MOA-ID-AUTH</a>,
- zusammen mit der Konfiguration von <tt>OnlineApplication/@publicURLPrefix</tt> und von <tt>OnlineApplication/ProxyComponent/ConnectionParameter/@URL</tt>. <br/>
- Der Wert <tt>resolvedValue</tt> wird in MOA-ID-PROXY je nach Wert des Platzhalters eingesetzt.</p>
-<p id="BasicAuth"> <b>BasicAuth</b><br />
- Das Element <tt>BasicAuth</tt> konfiguriert die &uuml;bergabe der Authentisierungs-Parameter an die Online-Appliktion
- mittels HTTP Basic Authentication. Es enth&auml;lt zwei Kind-Elemente. </p>
-<p> Das Element <tt>UserID</tt> gibt die UserId des zu authentisierenden Benutzers an und kann einen der durch <tt>MOAAuthDataType</tt> beschriebenen Werte annehmen. </p>
-<p>Das Element <tt>Password</tt> gibt das Passwort des zu authentisierenden Benutzers an und kann einen der durch <tt>MOAAuthDataType</tt> beschriebenen Werte annehmen. </p>
-<p id="HeaderAuth"> <b>HeaderAuth</b><br />
- Das Element <tt>HeaderAuth</tt> konfiguriert die &uuml;bergabe der Authentisierungs-Parameter an die Online-Applikation
-in HTTP Request Headern. Das Element kann ein oder mehrere Kind-Elemente <tt>&lt;Header&gt;</tt> beinhalten. </p>
-<p id="Header"> <b>HeaderAuth/Header</b><br />
-Das Element <tt>&lt;Header&gt;</tt> enth&auml;lt die Attribute Name und Value.
-<p>Das Attribut <tt>Name</tt> beschreibt den Namen des Header und ist ein frei zu w&auml;hlender String.
-<p>Das Attribut <tt>Value</tt> beschreibt den Inhalt des Header und kann einen der durch <tt>MOAAuthDataType</tt> beschriebenen Werte annehmen.
-<p>Die Header werden folgenderma&szlig;en in den Request an die Online-Applikation eingef&uuml;gt:
-<blockquote>
- <pre>
-&lt;h1.name&gt;:&lt;h1.resolvedValue&gt;
-&lt;h2.name&gt;:&lt;h2.resolvedValue&gt;
-...
-</pre>
-</blockquote>
-<p>Der Wert <tt>resolvedValue</tt> wird in der Proxykomponente je nach Wert des Platzhalters eingesetzt.
-Etwaige Header aus dem urspr&uuml;nglichen Request an die Proxykomponente, die denselben Namen haben, m&uuml;ssen
-&uuml;berschrieben werden.
-</p>
-
-<h1><a name="sp-config" id="sp-config">3 Konfiguration von MOA-SP</a></h1>
- <p>MOA-ID &uuml;berpr&uuml;ft die Signaturen der Personenbindung und
- des AUTH-Blocks mit dem <tt>VerifyXMLSignatureRequest</tt> von
- MOA-SP. Dazu muss MOA-SP wie unten beschreiben konfiguriert werden. <br />
- <br />
- <b id"verifytransformsInfoProfile">VerifyTransformsInfoProfile</b><br />
- Der Request zum &uuml;berpr&uuml;fen der Signatur des AUTH-Blocks
- verwendet ein vordefiniertes VerifyTransformsInfoProfile. Die
- im Request verwendete Profil-ID wird in der MOA-ID Konfigurationsdatei
- im Element <tt>/MOA-IDConfiguration/ AuthComponent/MOA-SP/VerifyAuthBlock/
- VerifyTransformsInfoProfileID</tt> definiert. Entsprechend muss
- am MOA-SP Server ein VerifyTransformsInfoProfile mit gleichlautender
- ID definiert werden. Die Profiledefinition selbst ist in der Auslieferung
- von MOA-ID in <tt>$MOA_ID_INST_AUTH/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml</tt> enthalten. Diese Profildefinition muss unver&auml;ndert &uuml;bernommen
- werden. </p>
-<p id="trustProfile"> <b>TrustProfile</b><br />
- Die Requests zur &uuml;berpr&uuml;fung der Signatur verwenden vordefinierte TrustProfile.
- Die im Request verwendete Profil-IDs werden in der MOA-ID Konfigurationsdatei
- in den Elementen <tt>/MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyIdentityLink/ TrustProfileID</tt> und <tt>/MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyAuthBlock/TrustProfileID</tt> definiert. Diese beiden Elemente
- k&ouml;nnen unterschiedliche oder identische TrustProfileIDs enthalten.
- Am MOA-SP Server m&uuml;ssen TrustProfile mit gleichlautender ID definiert werden.
- Die Auslieferung von MOA-ID enth&auml;lt das Verzeichnis <tt>$MOA_ID_INST_AUTH/conf/moa-spss/trustprofiles/MOAIDBuergerkarteRoot</tt>,
- das als TrustProfile verwendet werden kann. Weitere Zertifikate k&ouml;nnen als vertrauensw&uuml;rdig hinzugef&uuml;gt werden. </p>
-<p id="certstore"> <b>Certstore</b><br />
- Zum Aufbau eines Zertifikatspfades k&ouml;nnen ben&ouml;tigte Zertifikate aus einem Zertifikatsspeicher verwendet werden.
- Die Auslieferung von MOA-ID enth&auml;lt das Verzeichnis <tt>$MOA_ID_INST_AUTH/conf/moa-spss/certstore</tt>, das als initialer
- Zertifikatsspeicher verwendet werden kann. </p>
-<p>Hinweis: Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues Format f&uuml;r die XML-Konfigurationsdatei.
- F&uuml;r die Konvertierung einer &auml;lteren Konfigurationsdatei auf das neue Format steht Ihnen ein Tool
- zur Verf&uuml;gung. Details dazu finden sie in der der Distribution von MOA-SP/SS beiligenden
- Dokumentation im Kapitel 'Konfiguration', Abschnitt 1.2.1.</p>
-
-<h1><a name="online-config" id="online-config">4 &Auml;nderung der Konfiguration w&auml;hrend des Betriebs</a></h1>
-<p>Der Inhalt dieser Konfiguration, bzw. jene Teile, auf die indirekt verwiesen wird, k&ouml;nnen w&auml;hrend des laufenden
-Betriebes des MOA-Servers ge&auml;ndert werden. Der Server selbst wird durch den Aufruf einer <a href="id-admin_1.htm#ConfigUpdate">URL</a> (im Applikationskontext von MOA ID) dazu veranlasst, die ge&auml;nderte Konfiguration neu einzulesen.
-Im Falle einer fehlerhaften neuen Konfiguration wird die urspr&uuml;ngliche Konfiguration beibehalten.</p>
-
-<h1><a name="errorpages" id="errorpages">5 &Auml;ndern der Default Errorpages</a></h1>
-<p>Die Default-Errorpages geben bei MOA-ID-AUTH und MOA-ID-PROXY immer die entsprechende Fehlermeldung aus, so eine vorhanden ist. M&ouml;chte man dies verhindern bzw. abh&auml;ngig vom eingestellten Log-Level machen so k&ouml;nnen diese Errorpages ersetzt werden. Entsprechende Errorpages sind unter $MOA_ID_INST_AUTH/errorpages bzw. $MOA_ID_INST_PROXY/errorpages zu finden. Diese k&ouml;nnen die Default-Errorpages unter dem jeweiligen webapps-Kontext von MOA-ID-AUTH (errorpage-auth.jsp) bzw. MOA-ID-PROXY (errorpage-proxy.jsp )ersetzen. </p>
-<p>Die in $MOA_ID_INST_AUTH/errorpages bzw. $MOA_ID_INST_PROXY/errorpages enthaltenen Errorpages bedeuten dabei folgendes:</p>
-<ul>
- <li>errorpage-auth_debug.jsp und errorpage-proxy_debug.jsp:<br>
- Geben erweiterte Meldungen wie (ErrorMessage, ExceptionThrown) aus, wenn der Log-Level f&uuml;r
- moa.id.auth bzw. moa.id.proxy auf debug gesetzt sind. Ansonsten erfolgt nur eine allgemeine Ausgabe, dass ein
- Fehler aufgetreten ist.</li>
- <li>errorpage-auth_empty.jsp und errorpage-proxy_empty.jsp:<br>
- Unabh&auml;ngig vom Log-Level erfolgt nur einen allgemeine Ausgabe, dass ein Fehler aufgetreten ist.</li>
-</ul>
-<h1><a name="security" id="security">6 Tomcat Security Manager</a></h1>
-<p>Apache Tomcat bietet die M&ouml;glichkeit den Server unter einem Security Manager zu betreiben. Damit ist es m&ouml;glich den lokalen Dateizugriff zu beschr&auml;nken. Mit Hilfe der Datei &quot;catalina.policy&quot; k&ouml;nnen so Zugriffe auf lokale Dateien und Verzeichnisse festgelegt werden. Eine beispielhafte catalina.policy Datei finden Sie im Verzeichnis $MOA_ID_INST_AUTH/tomcat bzw. $MOA_ID_INST_PROXY/tomcat. Diese Datei wurde unter Apache Tomcat 4.1.31, 5.0.28 und 5.5.27 getestet. </p>
-<p>Mehr Informationen zum Security Manager entnehmen Sie bitte der entsprechenden Apache Tomcat Dokumentation. </p>
-
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-admin_3.htm b/id/server/doc/moa_id/id-admin_3.htm
deleted file mode 100644
index 85764a3a0..000000000
--- a/id/server/doc/moa_id/id-admin_3.htm
+++ /dev/null
@@ -1,108 +0,0 @@
-<html>
-<head>
- <title>MOA ID-Administration</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
-<p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Optionale Komponenten</p>
- <hr/>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#IIS">Konfiguration des Microsoft Internet Information Server</a></p>
- </li>
- <li>
- <p><a href="#Apache">Konfiguration des Apache Webservers</a></p>
- </li>
- <li>
- <p><a href="#SQL">Konfiguration von PostgreSQL</a></p>
- </li>
-</ol>
- <hr/>
-<h1><a name="IIS" id="IIS">1 Konfiguration des Microsoft Internet Information Server</a></h1>
-Vor MOA-ID-AUTH oder MOA-ID-PROXY kann optional ein MS IIS vorgeschaltet sein. In diesem Fall &uuml;bernimmt der MS IIS die HTTP bzw. HTTPS-Kommunikation mit dem Aufrufer des Webservices. Die Kommunikation zwischen MS IIS und dem in Tomcat deployten Webservice wird durch Jakarta mod_jk durchgef&uuml;hrt.<br />
- <br />
- <b>Konfiguration von Jakarta mod_jk im MS IIS</b><br />
- F&uuml;r die Kommunikation des MS IIS mit dem im Tomcat deployten Webservice wird das ISAPI-Modul von Jakarta mod_jk im MS IIS installiert und konfiguriert. Eine detaillierte Installations- und Konfigurationsanleitung gibt das <a href="http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/iishowto.html" target="_new">mod_jk IIS HowTo</a>. Beispiele f&uuml;r <tt>workers.properties</tt> und <tt>uriworkermap.properties</tt> Dateien liegen im ausgelieferten moa-id-auth-x.y.zip bzw. moa-id-proxy-x.y.zip, Verzeichnis tomcat bei. <br />
- <br />
- <b>Konfiguration von Tomcat</b><br />
- Damit Tomcat die Aufrufe, die von MS IIS mittels Jakarta mod_jk weiterleitet, entgegennehmen kann, muss in $CATALINA_HOME/conf/server.xml der AJP 1.3 Connector aktiviert werden. Im Gegenzug k&ouml;nnen die Connectoren f&uuml;r HTTP und HTTPS deaktiviert werden. Das geschieht am einfachsten durch ein- bzw. auskommentieren der entsprechenden <tt>Connector</tt> Konfigurations-Elemente in dieser Datei. <br />
- <br />
- <p><b>Konfiguration von SSL</b><br />
- Die Dokumentation zum Einrichten von SSL auf dem MS IIS steht nach
- Installation des IIS unter http://localhost/iisHelp/ bzw. <a href="http://www.microsoft.com/windows2000/en/server/iis/default.asp" target="_new">online</a> zur Verf&uuml;gung. </p>
-<p><b><a name="Prefix"></a>Konfiguration des zu verwendenden DATA-URL
- Pr&auml;fix</b><br>
- Befindet sich der Rechner auf dem MOA-ID installiert wird hinter
- einer Firewall welche zwar Zugriffe vom vorgelagerten Webserver
- zul&auml;sst, nicht jedoch direkte Zugriffe (von den Rechnern von
- MOA-ID Benutzern), so muss manuell in der Konfigurationsdatei von
- MOA-ID ein s.g. DATA-URL Pr&auml;fix vergeben werden. An dieses
- URL-Pr&auml;fix werden Daten von der verwendeten B&uuml;rgerkartenumgebung
- gesendet. Details finden sie im Abschnitt <a href="./id-admin_2.htm#DataURLPrefix">Konfiguration</a>.
- Requests an das DataURL-Pr&auml;fix&gt; m&uuml;ssen durch den Webserver
- an https://&lt;moa-id-rechnername&gt;/moa-id-auth/ bzw. an http://&lt;moa-id-rechnername&gt;/moa-id-auth/
- weitergeleitet werden.</p>
-
-<h1><a name="Apache" id="Apache">2 Konfiguration des Apache Webservers</a></h1>
-<p>Vor MOA-ID-AUTH oder MOA-ID-PROXY kann ein Apache Webserver vorgeschaltet sein. Das Prinzip funktioniert wie bei MS IIS, auch hier wird Jakarta mod_jk f&uuml;r die Kommunikation zwischen Webserver und Tomcat eingesetzt. <br />
- <br />
- <b>Konfiguration von Jakarta mod_jk im Apache Webserver</b><br />
-Um MOA-ID-AUTH oder MOA-ID-PROXY hinter einem Apache Webserver zu betreiben, ist die Konfiguration des Apache-Moduls mod_jk erforderlich. Eine detaillierte Installations- und Konfigurationsanleitung gibt das <a href="http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/aphowto.html" target="_new">mod_jk Apache HowTo</a>. Ein Beispiel f&uuml;r eine <tt>workers.properties</tt> Datei liegt im Verzeichnis $MOA_SPSS_INST/conf/moa bei.<br />
-Um MOA-ID-AUTH oder MOA-ID-PROXY dem Apache Webserver bekannt zu machen, muss folgender Eintrag in die Apache Konfigurationsdatei gemacht werden: </p>
-<pre>
- JkMount /moa-id-auth/* moaworker
-</pre>
-oder f&uuml;r die Proxy-Komponente
-<pre>
- JkMount /* moaworker
-</pre>
-<br />
-<b>Konfiguration von Tomcat</b><br />
-Die Konfiguration von Tomcat ist analog wie im Abschnitt &uuml;ber den MS IIS durchzuf&uuml;hren. <br />
-<br />
-<b>Konfiguration von SSL mit mod_SSL </b><br />
-Apache kann in Verbindung mit mod_SSL als SSL-Endpunkt f&uuml;r das MOA-ID-AUTH Webservice fungieren. In diesem Fall entf&auml;llt die SSL-Konfiguration in Tomcat, da Apache und Tomcat auch im Fall von SSL Daten via mod_jk austauschen. Eine detaillierte Installations- und Konfigurationsanleitung von mod_SSL gibt die <a href="http://www.modssl.org/docs/" target="_new">Online-Dokumentation</a>. <br />
-<br />
-Bei der Verwendung von Client-Authentisierung muss darauf geachtet werden, dass mod_ssl die HTTP-Header mit den Informationen &uuml;ber das Client-Zertifikat exportiert. Dies wird durch Angabe der Option<br />
-<pre>
- SSLOptions +ExportCertData +StdEnvVars
-</pre>
-in der Apache-Konfiguration erreicht.<br />
-Weiters muss Jakarta mod_jk angewiesen werden, die SSL Schl&uuml;ssell&auml;nge zu exportieren. Dies geschieht mit der Direktive:
-<pre>
- JkOptions +ForwardKeySize
- +ForwardURICompat
- -ForwardDirectories
-</pre>
-<p><b>Konfiguration des zu verwendenden DATA-URL Pr&auml;fix</b></p>
-<p>siehe gleichnamige <a href="id-admin_3.htm#Prefix">&Uuml;berschrift </a>in Abschnitt &quot;Konfiguration des Microsoft Internet Information
- Server (optional)&quot;</p>
-<h1><a name="SQL" id="">3 Konfiguration von PostgreSQL</a></h1>
-<p>MOA-ID-AUTH bzw. MOA-ID-PROXY kann PostgreSQL zum Abspeichern von Log-Meldungen verwenden. Hierf&uuml;r wird eine installierte und konfigurierte Datenbank vorausgesetzt. Eine detaillierte &Uuml;bersicht &uuml;ber die Installation und Konfiguration von PostgreSQL gibt die <a href="http://techdocs.postgresql.org/">Online-Dokumentation</a>.<br />
- <br />
- <b>Logging</b><br />
-F&uuml;r das Logging in eine PostgreSQL Datenbank mittels Jakarta Log4j muss zun&auml;chst eine Tabelle f&uuml;r die Log-Meldungen angelegt werden. Dies kann mit folgendem SQL-Statement erreicht werden: </p>
-<pre>
- create table spss_log
- (log_time timestamp,
- log_level varchar(5),
- log_msg varchar(256));
-</pre>
-<p>Um das Logging in die Datenbank Log4j bekannt zu machen, muss die Log4j-Konfiguration adaptiert werden. Die Datei $MOA_SPSS_INST/conf/moa/log4.properties enth&auml;lt bereits eine beispielhafte Jakarta Log4j-Konfiguration f&uuml;r das Logging in eine PostgreSQL Datenbank, die standardm&auml;&szlig;ig ausgeschaltet ist. Hinweis: Bei Tests hat sich das Logging in eine Datenbank mit Jakarta Log4j als Performance-Engpa&szlig; herausgestellt. Es wird deshalb empfohlen, auf dieses Feature zu verzichten.</p>
-<br />
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-anwendung.htm b/id/server/doc/moa_id/id-anwendung.htm
deleted file mode 100644
index 657e836a8..000000000
--- a/id/server/doc/moa_id/id-anwendung.htm
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Anwendung</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Anwendung </p>
- <hr/>
-
-
- <dl>
- <dt><a href="id-anwendung_0.htm">&Uuml;berblick</a></dt>
- <dd>&Uuml;berblick &uuml;ber die Anwendung von MOA-ID.</dd>
- <dt><a href="id-anwendung_1.htm">Aufruf MOA-ID-AUTH</a></dt>
- <dd>Detaillierte Beschreibung &uuml;ber den Aufruf von MOA-ID AUTH.</dd>
- <dt><a href="id-anwendung_2.htm">Abfrage MOA-ID-AUTH </a></dt>
- <dd>Detaillierte Beschreibung &uuml;ber die Abfrage von MOA-ID AUTH.</dd>
- </dl>
-
- <hr/>
-
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-anwendung_0.htm b/id/server/doc/moa_id/id-anwendung_0.htm
deleted file mode 100644
index c98203e9a..000000000
--- a/id/server/doc/moa_id/id-anwendung_0.htm
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Anwendung</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Anwendung-&Uuml;berblick </p>
- <hr/>
-
-
- <p>MOA-ID f&uuml;hrt f&uuml;r eine Online-Applikation (OA) die Benutzeridentifizierung und -authentisierung mit Hilfe der B&uuml;rgerkarte durch. </p>
-Um diese Funktionalit&auml;t verf&uuml;gbar zu machen, ist folgenderma&szlig;en vorzugehen:
-</p>
-<ul>
- <li>Die OA muss als Webapplikation installiert werden.</li>
- <li>MOA-ID-AUTH muss als Webapplikation <a href="id-admin_1.htm">installiert</a> und f&uuml;r die OA <a href="id-admin_2.htm">konfiguriert</a> werden.</li>
- <li>MOA-ID-AUTH wird durch einen Verweis von einer Webseite aufgerufen.
- Diese Webseite kann z.B. Teil eines Portals sein.</li>
- <li>Nach erfolgter Authentisierung holt die OA die bereitgestellten Anmeldedaten zum B&uuml;rger von MOA-ID-AUTH ab.
- Dies kann unter Mithilfe der Webapplikation MOA-ID-PROXY geschehen, die f&uuml;r diesen Zweck <a href="id-admin_1.htm">installiert</a> und f&uuml;r die OA <a href="id-admin_2.htm">konfiguriert</a> werden muss.</li>
-</ul>
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-anwendung_1.htm b/id/server/doc/moa_id/id-anwendung_1.htm
deleted file mode 100644
index 43117f81d..000000000
--- a/id/server/doc/moa_id/id-anwendung_1.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Anwendung</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Aufruf von MOA-ID AUTH</p>
- <hr/>
-MOA-ID-AUTH wird immer durch eine andere (verweisende) Webseite aufgerufen. Diese Webseite kann z.B. Teil eines Portals sein.
- Der Aufruf erfolgt durch einen Verweis der Form:
- <pre>&lt;a href=&quot;https://&lt;moa-id-server-und-pfad&gt;/
-StartAuthentication?Target=&lt;gesch&auml;ftsbereich&gt;
-&OA=&lt;oa-url&gt;&Template=&lt;template-url&gt;&amp;useMandate=false&amp;sourceID=&lt;sourceID&gt;&quot;&gt;</pre>
-<table border="1">
- <tbody valign="baseline">
- <tr>
- <td id="klein2">&lt;moa-id-server-und-pfad&gt;</td>
- <td id="klein2">Server und Pfad, wo MOA-ID-AUTH installiert ist</td>
- </tr>
- <tr>
- <td id="klein2">Target=&lt;gesch&auml;ftsbereich&gt;</td>
- <td id="klein2">Angabe, f&uuml;r welches Verfahren der Benutzer authentisiert werden soll</td>
- </tr>
- <tr>
- <td id="klein2">OA=&lt;oa-url&gt;</td>
- <td id="klein2">Webseite, auf die der Browser nach erfolgter Authentisierung weitergeleitet werden soll</td>
- </tr>
- <tr>
- <td id="klein2">Template=&lt;template-url&gt;</td>
- <td id="klein2">optional; HTML-Vorlage f&uuml;r der Anmeldeseite von MOA-ID-AUTH, &uuml;ber die der B&uuml;rger den Authentisierungsvorgang startet. &Uuml;ber diesen Parameter kann das Aussehen der Anmeldeseite an das Aussehen der Online-Applikation angepasst werden.</td>
- </tr>
- <tr>
- <td id="klein2">useMandate=&lt;true/false&gt;</td>
- <td id="klein2">optional; Gibt an ob eine Anmeldung im Online-Vollmachten-Modus durchgef&uuml;hrt werden soll (=true) oder nicht (=false);</td>
- </tr>
- <tr>
- <td id="klein3">sourceID=&lt;sourceID&gt;</td>
- <td id="klein3">optional; Gibt eine sourceID an, die (wenn sie gesetzt ist) zur Berechnung des SAML-Artifacts herangezogen wird.</td>
- </tr>
- </tbody>
- </table>
- <p><br/>
- <b>Template</b></p>
-<p> Ein <a href="examples/Template.html">Template</a> f&uuml;r die Anmeldeseite von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
- </p>
- <pre>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;MOA ID - Identifizierter Zugang mit B&amp;uuml;rgerkarte&lt;/title&gt;
- &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br>&lt;/head&gt;
-
-&lt;body&gt; <p>&lt;form name=&quot;CustomizedForm&quot; action=&quot;&lt;BKU&gt;&quot; method=&quot;post&quot;&gt;
- &lt;div align=&quot;center&quot;&gt;
- &lt;input type=&quot;hidden&quot;
- name=&quot;XMLRequest&quot;
- value=&quot;&lt;XMLRequest&gt;&quot;/&gt;<br>
- &lt;input type=&quot;hidden&quot;
- name=&quot;DataURL&quot;
- value=&quot;&lt;DataURL&gt;&quot;/&gt;<br>
- &lt;input type=&quot;hidden&quot;
- name=&quot;PushInfobox&quot
- value=&quot;&lt;PushInfobox&gt;&quot;/&gt;<br>
- &lt;input type=&quot;submit&quot; value=&quot;Anmeldung mit B&amp;uuml;rgerkarte&quot; name=&quot;submit&quot;/&gt;<br>
- &lt;/div&gt;
- &lt;/form&gt;<br>
- &lt;form name=&quot;CustomizedInfoForm&quot;
- action=&quot;&lt;BKU&gt;&quot;
- method=&quot;post&quot;&gt;<br>
- &lt;input type=&quot;hidden&quot;
- name=&quot;XMLRequest&quot;
- value=&quot;&lt;CertInfoXMLRequest&gt;&quot;/&gt;<br>
- &lt;input type=&quot;hidden&quot;<br> name=&quot;DataURL&quot;
- value=&quot;&lt;CertInfoDataURL&gt;&quot;/&gt;<br> </p><p> &lt;input type=&quot;hidden&quot; value=&quot;Weitere Info&quot;/&gt;<br>
- &lt;/form&gt;</p>&lt;/body&gt;<br>&lt;/html&gt;<br>
- </pre>
- Innerhalb dieser <tt>&lt;form&gt;</tt>-Elemente k&ouml;nnen Texte, Beschriftungen und Styles modifiziert werden,
-und es k&ouml;nnen zus&auml;tzliche Elemente darin aufgenommen werden. <br />
-<br />
-Die vorgegebene Grundstruktur ist aber in jedem Fall einzuhalten, und es m&uuml;ssen die speziellen
-Tags <tt>&lt;BKU&gt;</tt> (kommt 2x vor), <tt>&lt;XMLRequest&gt;</tt>, <tt>&lt;DataURL&gt;</tt>, <tt>&lt;CertInfoXMLRequest&gt;</tt> und <tt>&lt;CertInfoDataURL&gt;</tt> darin enthalten sein. Das Tag &lt;PushInfobox&gt; muss ab Version 1.4 vorhanden sein, wenn MOA-ID auch andere Infoboxen als die Personenbindung bearbeiten kann. <br />
-<br />
-<b>BKU-Auswahl</b><br />
- <br />
- MOA-ID-AUTH bietet die M&ouml;glichkeit, die B&uuml;rgerkartenumgebung (BKU) auszuw&auml;hlen, &uuml;ber die in weiterer Folge die B&uuml;rgerkarte ausgelesen wird. Der Aufruf erfolgt dann durch einen Verweis der Form:
-<pre>&lt;a href=&quot;https://&lt;moa-id-server-und-pfad&gt;/
-SelectBKU?Target=&lt;gesch&auml;ftsbereich&gt;
-&OA=&lt;oa-url&gt;&Template=&lt;template-url&gt;
-&BKUSelectionTemplate=&lt;bku-template-url&gt;&quot;&gt;</pre>
-<table border="1">
- <tbody valign="baseline">
- <tr>
- <td id="klein2">BKUSelectionTemplate= &lt;bku-template-url&gt;</td>
- <td id="klein2">optional; HTML-Vorlage f&uuml;r der BKU-Auswahlseite von MOA-ID-AUTH.
- &Uuml;ber diesen Parameter kann das Aussehen der BKU-Auswahlseite an das Aussehen der Online-Applikation angepasst werden.</td>
- </tr>
- </tbody>
-</table>
-<br/>
-<b>BKUSelectionTemplate</b><br />
- <br />
- Ein <a href="examples/BKUSelectionTemplate.html">Template f&uuml;r die BKU-Auswahl</a> von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
-<pre>
-&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;MOA ID - Auswahl der B&amp;uuuml;rgerkartenumgebung&lt;/title&gt;
- &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br>&lt;/head&gt;
-&lt;body&gt;
-<p>&lt;form name=&quot;CustomizedForm&quot; method=&quot;post&quot; action=&quot;&lt;StartAuth&gt;&quot;&gt;<br> &lt;BKUSelect&gt; <br> &lt;input type=&quot;submit&quot; value=&quot;Ausw&amp;auml;hlen&quot;/&gt;<br>&lt;/form&gt;<br>&lt;br/&gt;<br>
- &lt;input type=&quot;hidden&quot; value=&quot;Weitere Info&quot;/&gt;<br>&lt;/form&gt;</p>
-<p>&lt;/body&gt;<br>&lt;/html&gt;</pre>
-</p>
-<p> Innerhalb dieser <tt>&lt;form&gt;</tt>-Elemente k&ouml;nnen Texte, Beschriftungen und Styles modifiziert werden,
- und es k&ouml;nnen zus&auml;tzliche Elemente darin aufgenommen werden. <br />
- <br />
-Auch dabei ist die vorgegebene Grundstruktur einzuhalten, die speziellen Tags <tt>&lt;StartAuth&gt;</tt> und <tt>&lt;BKUSelect&gt;</tt> sind verpflichtend.</p>
- <p><strong>Wichtiger Hinweis:</strong> wenn die Templates &uuml;ber HTTPS geladen werden sollten, so muss das SSL/TLS Zertifikat des Servers in einem Java Truststore gespeichert werden und dieser beim Start von Tomcat angegeben werden. </p>
-<strong>Vorgeschlagene Vorgehensweise:<br>
-</strong>
-<ol>
-<li>Webserver SSL/TLS Zertifikat speichern im .cer Format speichern (z.B. mittels Internet Explorer).</li>
-<li>Mittels Java Keytool das Zertifikat in einen Java Truststore importieren.
-Im folgenden Beispiel wird in den Java Truststore &quot;truststore.jks&quot; mit dem Passwort &quot;changeit&quot; importiert.<br>
-<pre>keytool -import -trustcacerts -alias mytomcat -file tomcat_localhost.cer -keystore truststore.jks</pre>
-</li>
-<li>Truststore beim Starten von Tomcat angeben (&uuml;ber das Hinzuf&uuml;gen folgender Parameter in
- die Variable CATALINA_OPTS im Tomcat Startskript).</p>
-<pre>
- -Djavax.net.ssl.trustStore=&lt;PFAD&gt;\truststore.jks<br>
- -Djavax.net.ssl.trustStorePassword=changeit<br>
- -Djavax.net.ssl.trustStoreType=jks </pre>
-</li>
-</ol>
-</body>
-</html>
diff --git a/id/server/doc/moa_id/id-anwendung_2.htm b/id/server/doc/moa_id/id-anwendung_2.htm
deleted file mode 100644
index 68c055059..000000000
--- a/id/server/doc/moa_id/id-anwendung_2.htm
+++ /dev/null
@@ -1,176 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Anwendung</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Basis-Installation</p>
- <hr/>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#uebersicht">&Uuml;bersicht</a></p>
- </li>
- <li>
- <p><a href="#webservice">Aufruf des MOA-ID-AUTH Web Service</a></p>
- </li>
- <li>
- <p><a href="#proxy">Einsatz von MOA-ID-PROXY zum Abfragen der Anmeldedaten von MOA-ID-AUTH</a></p>
- </li>
-</ol>
- <hr/>
-
-<h1><a name="uebersicht" id="uebersicht">1 &Uuml;bersicht</a></h1>
-Nach erfolgter Authentisierung stehen in MOA-ID-AUTH Anmeldedaten zum Abholen bereit,
- und MOA-ID-AUTH veranlasst einen Redirect zur Online-Applikation (OA). <br />
- <br />
- In diesem Redirect werden der Gesch&auml;ftsbereich und ein SAML-Artifact als Parameter &uuml;bergeben.
-<pre>&lt;a href=&quot;https://&lt;oa-url&gt;
-?Target=&lt;gesch&auml;ftsbereich&gt;
-&SAMLArtifact=&lt;saml-artifact&gt;&quot;&gt;</pre>
-<table border="1">
- <tbody valign="baseline">
- <tr>
- <td>&lt;oa-url&gt;</td>
- <td>URL, der beim Aufruf von MOA-ID-AUTH als Parameter &quot;OA&quot; &uuml;bergeben wurde</td>
- </tr>
- <tr>
- <td>Target=&lt;gesch&auml;ftsbereich&gt;</td>
- <td>Parameter, der beim Aufruf von MOA-ID-AUTH &uuml;bergeben wurde</td>
- </tr>
- <tr>
- <td>SAMLArtifact=&lt;saml-artifact&gt;</td>
- <td>SAML-Artifact, das von MOA-ID-AUTH zu den Anmeldedaten erstellt wurde.
- Mithilfe dieses SAML-Artifacts kann die OA die Anmeldedaten von MOA-ID-AUTH abholen.</td>
- </tr>
- </tbody>
-</table>
-<br/>
- Grunds&auml;tzlich stehen einer OA mehrere Arten zum Abholen der Anmeldedaten von MOA-ID-AUTH zur Verf&uuml;gung:
-<ol>
- <li>Die Applikation ruft selbst das MOA-ID-AUTH Web Service auf. <br/>
- Die Implementierung dieser Variante wird empfohlen, insbesondere f&uuml;r Online-Applikationen, die neu erstellt werden. </li>
- <li>Es wird die MOA-ID-PROXY Webapplikation eingesetzt, um die Anmeldedaten abzuholen und an die OA zu &uuml;bergeben. <br/>
- Aus Sicht von MOA-ID-PROXY ist bedeutsam, ob die OA die Anmeldedaten nach Abarbeitung des HTTP-Requests beh&auml;lt.
- <ul>
- <li>Stateful OA: MOA-ID-PROXY &uuml;bergibt einmalig die Anmeldedaten an die OA, und die OA speichert die Anmeldedaten, typischerweise unter Einsatz von Cookies.</li>
- <li>Stateless OA: MOA-ID-PROXY &uuml;bergibt die Anmeldedaten bei jedem HTTP-Request vom Browser des B&uuml;rgers an die OA.</li>
- </ul>
- Diese Variante ist vorzuziehen, wenn
- <ul>
- <li>f&uuml;r die Plattform, auf der die OA aufbaut, Web Service-Schnittstellen nicht verf&uuml;gbar sind</li>
- <li>das n&ouml;tige Web Service-Know How nicht zur Verf&uuml;gung steht</li>
- <li>die Implementierung von Variante 1 zu aufw&auml;ndig w&auml;re</li>
- <li>eine Anpassung der OA aus bestimmten Gr&uuml;nden nicht m&ouml;glich ist</li>
- </ul>
- </li>
-</ol>
-
-<h1><a name="webservice" id="webservice">2 Aufruf des MOA-ID-AUTH Web Service</a></h1>
-<p>Das MOA-ID-AUTH Web Service wird &uuml;ber einen &lt;samlp:Request&gt; aufgerufen.
- Der &lt;samlp:Request&gt; enth&auml;lt in einem &lt;samlp:AssertionArtifact&gt; das von MOA-ID-AUTH &uuml;bergebene SAML-Artifact. <br/>
- <br/>
- MOA-ID-AUTH liefert als Antwort einen &lt;samlp:Response&gt;. Die Anmeldedaten sind im &lt;samlp:Response&gt; in Form einer &lt;saml:Assertion&gt; enthalten.
-<ul>
- <li>
- <a href="../cs-sstc-schema-protocol-01.xsd">SAML 1.0 Protocol Schema</a> <br/>
- </li>
- <li>
-<a href="../cs-sstc-schema-assertion-01.xsd">SAML 1.0 Assertion Schema</a> </p>
-</li>
-</ul>
-<p>Der detaillierte Aufbau der &lt;saml:Assertion&gt; zu den Anmeldedaten ist in der <a href="../MOA_ID_1.4_20070306.pdf">Spezifikation MOA-ID 1.4</a> beschrieben. <br/>
- <br/>
- <b>Beispiel LoginServletExample</b>
- Das Abholen der Anmeldedaten durch Aufruf des Web Service von MOA-ID-AUTH wird anhand eines beispielhaften Java Servlet gezeigt.
- Das LoginServletExample wird in einer Stateful OA von MOA-ID-AUTH nach erfolgter Authentisierung &uuml;ber Redirect aufgerufen. <br/>
- <br/>
- Das Beispiel demonstriert insgesamt die Integration von MOA-ID-AUTH in die OA:
-</p>
-<ul>
- <li>Parameter&uuml;bergabe von MOA-ID-AUTH an die OA</li>
- <li>Aufruf des MOA-ID-AUTH Web Service mittels des SOAP Frameworks "Apache AXIS"</li>
- <li>Parsen der Anmeldedaten mittels der XPath Engine "Jaxen"</li>
- <li>Speichern der Anmeldedaten in der HTTPSession</li>
- <li>Redirect auf die eigentliche Startseite der OA</li>
-</ul>
-<p><b>Voraussetzungen</b><br >
- Die folgende Liste enth&auml;lt die f&uuml;r das Beispiel erforderlichen Java-Bibliotheken. Die angef&uuml;hrten Versionsnummern bezeichnen jene Versionen dieser Java-Bibliotheken, mit denen das Beispiel getestet wurde.</p>
-<table border="1" width="100%" cellpadding="2" cellspacing="0">
- <tr>
- <th>Java-Bibliothek</th>
- <th>Version</th>
- <th>Bemerkung</th>
- </tr>
- <tr>
- <tr valign="top">
- <td>JDK</td>
- <td>1.4.0+, 1.5.0</td>
- <td>Java Development Kit</td>
- </tr>
- <tr valign="top">
- <td>Xerces <br />
- XML Parser</td>
- <td>2.0.2+</td>
- <td id="klein2">Download: <a href="http://xml.apache.org/xerces2-j/">xml.apache.org/xerces2-j</a></td>
- </tr>
- <tr valign="top">
- <td>AXIS <br />
- SOAP Framework</td>
- <td>1.0+</td>
- <td id="klein2">Download: <a href="http://xml.apache.org/axis/">xml.apache.org/axis</a></td>
- </tr>
- <tr valign="top">
- <td>Jaxen XPath Engine</td>
- <td>1.0+</td>
- <td id="klein2">Download: <a href="http://jaxen.sourceforge.net/">http://jaxen.sourceforge.net</a></td>
- </tr>
- <tr valign="top">
- <td>Servlet API</td>
- <td>2.3+</td>
- <td id="klein2">Download: <a href="http://java.sun.com/products/servlet/">java.sun.com/products/servlet</a></td>
- </tr>
-</table>
-<br/>
-<b>Code</b><br />
-<a href="examples/LoginServletExample.txt">LoginServletExample</a>
-
-<h1><a name="proxy" id="proxy">3 Einsatz von MOA-ID-PROXY zum Abfragen der Anmeldedaten von MOA-ID-AUTH</a></h1>
-Anstatt den Aufruf des MOA-ID-AUTH Web Service in der OA zu implementieren, kann die MOA-ID-PROXY Webapplikation eingesetzt werden, um dies f&uuml;r die OA zu erledigen. MOA-ID-PROXY muss f&uuml;r die OA konfiguriert werden, so wie in <a href="id-admin_2.htm#OnlineApplication/ProxyComponent">MOA-ID-Administration</a> beschrieben. <br/>
- <br/>
- Bei der Konfiguration ist speziell zu beachten: <br/>
- <br/>
- <b>Konfigurationsdatei zur OA</b><br />
- Der <a href="id-admin_2.htm#oa-config">LoginType</a> (stateful oder stateless) ist gem&auml;&szlig; dem Applikationstyp zu setzen. <br/>
- <br/>
- Die <a href="id-admin_2.htm#oa-config">&Uuml;bergabe der Anmeldedaten</a> ist in Form und Inhalt zu konfigurieren.
-<ul>
- <li>BasicAuth: HTTP Basic Authentication (<a href="examples/conf/OAConfBasicAuth.xml">Beispiel</a>)</li>
- <li>ParamAuth: &Uuml;bergabe &uuml;ber Requestparameter (<a href="examples/conf/OAConfParamAuth.xml">Beispiel</a>)</li>
- <li>HeaderAuth: &Uuml;bergabe &uuml;ber Requestheader (<a href="examples/conf/OAConfHeaderAuth.xml">Beispiel</a>)</li>
-</ul>
-<b>LoginParameterResolver</b><br />
- Das &Uuml;bergabe der Anmeldedaten an die OA &uuml;ber Request Parameter oder Header geschieht in einer Standardimplementierung des Interface
- <pre>at.gv.egovernment.moa.proxy.LoginParameterResolver</pre>
- Falls die Erfordernisse der OA mittels <a href="id-admin_2.htm#oa-config">Konfiguration</a> nicht abgedeckt werden k&ouml;nnen,
- so kann eine ma&szlig;geschneiderte Implementierung von <tt>LoginParameterResolver</tt> erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden
- (siehe <a href="../api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html">API</a>). <br/>
- <br/>
- <b>ConnectionBuilder</b> Das Herstellen einer URL-Verbindung von MOA-ID-PROXY zur OA geschieht einer Standardimplementierung des Interface
-<pre>at.gv.egovernment.moa.proxy.ConnectionBuilder </pre>
- Falls n&ouml;tig, kann eine ma&szlig;geschneiderte Implementierung von <tt>ConnectionBuilder</tt> erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden
- (siehe <a href="../api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html">API</a>).
-</body>
-</html>
diff --git a/id/server/doc/moa_id/intro.htm b/id/server/doc/moa_id/intro.htm
deleted file mode 100644
index 0c6dff359..000000000
--- a/id/server/doc/moa_id/intro.htm
+++ /dev/null
@@ -1,182 +0,0 @@
-<html>
-<head>
- <title>MOA Module fuer Online Applikationen - Identifikation</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Allgemeine Informationen </p>
- <hr/>
-<h1>Inhalt</h1>
- <ol>
- <li>
- <p><a href="#uebersicht">&Uuml;bersicht</a></p>
- </li>
- <li>
- <p><a href="#anmeldung">Ablauf einer Anmeldung</a></p>
- </li>
- <li>
- <p><a href="#foreign">Erg&auml;nzung f&uuml;r ausl&auml;ndische B&uuml;rger</a></p>
- </li>
- <li>
- <p><a href="#mandate">Online-Vollmachten</a></p>
- </li>
- </ol>
- <hr/>
-
- <h1><a name="uebersicht" id="uebersicht"></a>1 &Uuml;bersicht</h1>
-
-Das Modul Identifikation stellt Online-Applikationen Funktionalit&auml;t zur Verf&uuml;gung zu stellen, damit diese
-eine Benutzer-Identifikation und -Authentisierung mit Hilfe der B&uuml;rgerkarte und deren Signaturfunktion
-realisieren k&ouml;nnen.
-<br /><br />
-Das Modul besteht aus zwei Komponenten:
-<ul>
-<li>Die Authentisierungskomponente (MOA-ID-AUTH) f&uuml;hrt die eigentliche Authentisierung des Benutzers durch und &uuml;bergibt der
-Proxykomponente die Anmeldedaten.</li>
-<li>Die Proxykomponente (MOA-ID-PROXY) &uuml;bernimmt die Anmeldedaten von der Authentisierungskomponente,
-f&uuml;hrt die Anmeldung an der Online Applikation durch und schleust in der Folge Daten an die Online-Applikation
-und Daten an den Benutzer durch.</li>
-</ul>
-Diese beiden Komponenten k&ouml;nnen auf unterschiedlichen Rechnern
-oder auf dem gleichen Rechner eingesetzt werden.
-<br /><br />
-Die Funktionalit&auml;t und der Aufbau der Schnittstelle zu MOA-ID ist in der
-<a href="../MOA_ID_1.4_20070802.pdf" target="_new">Spezifikation</a> bzw. im <a href="../MOA_ID_1.5_Anhang.pdf" target="_new">Anhang zur Spezifikation</a> detailliert beschrieben.
-<br />
-<br />
-F&uuml;r den Betrieb von MOA-ID ist der Einsatz von MOA-Signaturpr&uuml;fung (MOA-SP) erforderlich.
-</div>
-
-<br /><br />
-<h1><a name="anmeldung" id="anmeldung"></a>2 Ablauf einer Anmeldung</h1>
-
-<img src="moa-id-ablauf.jpg"/>
-
-<table width="550" border="0" cellspacing="3" cellpadding="2">
-
-<tr>
-<td valign="top" width="30">1</td>
-<td id="block">Der Benutzer verbindet sich zu einem Web-Portal, &uuml;ber das die verf&uuml;gbaren Online-Applikationen (OA) erreichbar sind. Jeder Link zu einer OA verweist auf die Authentisierungs-komponente.
-</td>
-</tr>
-
-<tr>
-<td valign="top">2</td>
-<td id="block">Der Benutzer verbindet sich mit MOA-ID-AUTH, die die Authentisierung des
-Benutzers durchf&uuml;hrt:</td>
-</tr>
-
-<tr>
-<td valign="top">2.1</td>
-<td id="block">MOA-ID-AUTH bietet dem Benutzer optional eine Auswahl von verf&uuml;gbaren B&uuml;rgerkartenumgebungen (engl. Bezeichnung: Security-Layer) an.</td>
-</tr>
-
-<tr>
-<td valign="top">2.2</td>
-<td id="block">MOA-ID-AUTH erzeugt eine HTML-Seite mit einem <tt>&lt;InfoboxReadRequest&gt;</tt>
- zum Auslesen der Personenbindung. Diese HTML-Seite wird an den Browser geschickt.</td>
-</tr>
-
-<tr>
-<td valign="top">2.3</td>
-<td id="block">Der Browser schickt den <tt>&lt;InfoboxReadRequest&gt;</tt> an den ausgew&auml;hlten Security-Layer. Der Security-Layer liest die
-Personenbindung von der B&uuml;rgerkarte und sendet diese an MOA-ID-AUTH, die die Signatur der Personenbindung durch
-einen Aufruf von MOA-SP &uuml;berpr&uuml;ft.
-</td>
-</tr>
-
-<tr>
-<td valign="top">2.4</td>
-<td id="block">MOA-ID-AUTH erstellt den AUTH-Block. Der AUTH-Block enth&auml;lt
-<ul>
-<li>Vor- und Nachname aus der Personenbindung,</li>
-<li>URL von MOA-ID-AUTH,</li>
-<li>URL und Gesch&auml;ftsbereich der Online-Applikation,</li>
-<li>die aktuelle Zeit.</li>
-</ul>
-Anschlie&szlig;end wird
-eine XML Antwortseite, die das Kommando zum Signieren (<tt>&lt;CreateXMLSignatureRequest&gt;</tt>) des generierten
-AUTH-Blocks enth&auml;lt, an den ausgew&auml;hlten Security-Layer gesendet.</td>
-</tr>
-
-<tr>
-<td valign="top">2.5</td>
-<td id="block">Der Request wird vom Security-Layer verarbeitet. Die signierten Daten werden an
-MOA-ID-AUTH zur&uuml;ckgesendet.</td>
-</tr>
-
-<tr>
-<td valign="top">2.6</td>
-<td id="block">MOA-ID-AUTH &uuml;berpr&uuml;ft den signierten AUTH-Block und legt f&uuml;r den Benutzer die Anmeldedaten
-an. Die Anmeldedaten enthalten
-<ul>
-<li>die bereichsspezifische Personenkennzeichen (bPK),</li>
-<li>den signierten AUTH-Block (optional),</li>
-<li>die Personenbindung (optional),</li>
-<li>die <tt>PersonData</tt>-Struktur aus der Personenbindung (optional),</li>
-<li>die Information, ob die Signatur des AUTH-Blocks mit einem qualifiziertem Zertifikat erfolgte,</li>
-<li>Informationen zur Beh&ouml;rde, falls die Signatur mit einem Beh&ouml;rdenzertifikat erzeugt wurde.</li>
-</ul>
-</td>
-</tr>
-
-<tr>
-<td valign="top">2.7</td>
-<td id="block">Ist der obige Authentisierungsvorgang erfolgreich, dann wird eine Redirect-Seite
-zum Browser gesendet.</td>
-</tr>
-
-<tr>
-<td valign="top">3</td>
-<td id="block">Der Browser f&uuml;hrt das Redirect zur Proxykomponente durch. Als Parameter wird das von MOA-ID-AUTH
-erzeugte SAML-Artifact &uuml;bergeben.</td>
-</tr>
-
-<tr>
-<td valign="top">4</td>
-<td id="block">Die Proxykomponente verwendet dieses eindeutige SAML-Artifact, um die Anmeldedaten
-von MOA-ID-AUTH zu erhal-ten. Danach werden die Anmeldedaten in MOA-ID-AUTH gel&ouml;scht.</td>
-</tr>
-
-<tr>
-<td valign="top">5</td>
-<td id="block">MOA-ID-PROXY liest die Konfigurationsdatei der zugeh&ouml;rigen Online-Applikation, die beschreibt, wie die Anmeldedaten
-an die nachfolgende Applikation &uuml;bergeben werden m&uuml;ssen, und meldet den Benutzer bei der Applikation an.</td>
-</tr>
-
-<tr>
-<td valign="top">6</td>
-<td id="block">Ist die betreffende OA als stateless konfiguriert, so werden in weiterer Folge die Antworten der OA
-an den Benutzer weitergeleitet und die Anfragen des Benutzers an die OA weitergeleitet.</td>
-</tr>
-
-
-</table>
-
-
-<h1><a name="foreign" id="foreign"></a>3 Erg&auml;nzung f&uuml;r ausl&auml;ndische B&uuml;rger</h1>
-
- <p>Ab der MOA Release 1.4.7 ist es m&ouml;glich, dass sich auch ausl&auml;ndische B&uuml;rger mittels MOA-ID einloggen k&ouml;nnen. Hierzu wird eine Verbindung zu einem sogenannten Stammzahlenregister-Gateway aufgebaut, dass basierend auf den Zertifikatsdaten des ausl&auml;ndischen B&uuml;rgers eine Eintragung im Erg&auml;nzungsregister f&uuml;r nat&uuml;rliche Personen gem&auml;&szlig; E-Government Gesetz &sect;6(5) vornimmt. Somit ist es m&ouml;glich, dass eine Personenbindung ausgestellt werden kann, die in weitere Folge an MOA-ID weitergeleitet wird. </p>
- <p>Der Zugang zu diesem Stammzahlenregister-Gateway ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
- <p>Ab MOA Release 1.5.2 ist es auch m&ouml;glich, ausl&auml;ndische B&uuml;rger &uuml;ber <a href="http://eid-stork.eu/" target="_new">STORK</a> zu authentifizieren. Da auch f&uuml;r diese Art der Authentifizierung eine Kommunikation mit dem Stammzahlenregister-Gateway notwendig ist, gelten die zuvor angef&uuml;hrten Ausf&uuml;hrungen auch f&uuml;r STORK.</p>
-
-
- <h1><a name="mandate" id="mandate"></a>4 Online-Vollmachten</h1>
-
- <p>Ab der MOA Release 1.5.0 werden Online-Vollmachten (f&uuml;r Anwendungen aus dem &ouml;ffentlichen Bereich) unterst&uuml;tzt. Hierzu werden diese Vollmachten &uuml;ber eine Online-Vollmachten-Service ausgew&auml;hlt. Der Zugang zu diesem Online-Vollmachten Service ist &uuml;ber eine Client-Server Authentifizierung abgesichert. Als Client-Zertifikate werden Zertifikate der Firmen A-Trust bzw. A-CERT, die mit der Verwaltungs- oder Dienstleistereigenschaft versehen sind, akzeptiert. </p>
-</div>
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/links.htm b/id/server/doc/moa_id/links.htm
deleted file mode 100644
index c7feefea4..000000000
--- a/id/server/doc/moa_id/links.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<html>
-<head>
- <title>MOA-ID Links</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
-<link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title"><a href="./moa.htm">MOA: Identifikation (ID)</a></p>
- <p class="subtitle">Links </p>
- <hr/>
-
-
-
-<p><b>Externe Komponenten</b></p>
- <p>Apache <br />
- <a href="http://httpd.apache.org/">http://httpd.apache.org/</a>
-</p>
- <p>Internet Information Server <br>
- <a href="http://www.iis.net/">http://www.iis.net/</a>
- </p>
- <p>Tomcat <br />
- <a href="http://tomcat.apache.org/">http://tomcat.apache.org/</a>
- </p>
- <p>Tomcat mod_SSL <br />
- <a href="http://httpd.apache.org/docs/2.2/ssl/">http://httpd.apache.org/docs/2.2/ssl/</a>
-</p>
- <p>Tomcat mod_jk <br />
- <a href="http://tomcat.apache.org/connectors-doc/">http://tomcat.apache.org/connectors-doc/</a>
-</p>
- <p>Logging Toolkit <br />
- <a href="http://jakarta.apache.org/log4j/">http://jakarta.apache.org/log4j/</a>
-</p>
- <p>IAIK JCE <br />
- <a href="http://jce.iaik.tugraz.at/products/index.php">http://jce.iaik.tugraz.at/products/index.php </a>
-</p>
- <p>PostgreSQL <br />
- <a href="http://www.postgresql.org/">http://www.postgresql.org/</a>
- </p>
- <p><b>Spezifikationen</b></p>
- <p>
-DOM <br />
- <a href="http://www.w3c.org/DOM/">http://www.w3c.org/DOM</a>
-<p>E-Government <br />
- <a href="http://reference.e-government.gv.at/">http://reference.e-government.gv.at</a>
-<p>B&uuml;rgerkarte<br />
- <a href="http://www.buergerkarte.at">http://www.buergerkarte.at</a>
-<p>Security Layer Version 1.2<br />
- <a href="http://www.buergerkarte.at/konzept/securitylayer/spezifikation/aktuell/">http://www.buergerkarte.at/konzept/securitylayer/spezifikation/aktuell/</a>
-<p>Personenbindung Version 1.2.2<br />
- <a href="http://www.buergerkarte.at/konzept/personenbindung/spezifikation/aktuell/">http://www.buergerkarte.at/konzept/personenbindung/spezifikation/aktuell/</a>
-<p>Security Assertion Markup Language <br />
- <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=security">http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=security</a>
-
-</body>
-</html>
diff --git a/id/server/doc/moa_id/moa-id-ablauf.jpg b/id/server/doc/moa_id/moa-id-ablauf.jpg
deleted file mode 100644
index 0585664f4..000000000
--- a/id/server/doc/moa_id/moa-id-ablauf.jpg
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_id/moa.htm b/id/server/doc/moa_id/moa.htm
deleted file mode 100644
index 62f6115ea..000000000
--- a/id/server/doc/moa_id/moa.htm
+++ /dev/null
@@ -1,34 +0,0 @@
-<html>
-<head>
- <title>MOA Module fuer Online Applikationen</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
- <link rel="stylesheet" href="./common/MOA.css" type="text/css">
-</head>
-
-<body link="#990000">
-
-<table class="logoTable" width="100%" border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td align="center" class="logoTitle" width="267"><img src="common/LogoBKA.png" alt="Logo BKA" width="267" height="37" align="left"></td>
- <td align="center" class="logoTitle">Dokumentation</td>
- <td align="center" class="logoTitle" width="123"><img src="common/LogoEGIZ.png" alt="Logo EGIZ" width="230" height="81" align="right"></td>
- </tr>
-</table>
- <hr/>
- <p class="title">MOA: Identifikation (ID) </p>
- <p class="subtitle">&Uuml;bersicht zur Dokumentation der Version 2.0 </p>
- <hr/>
- <dl>
- <dt><a href="./intro.htm">Allgemein</a></dt>
- <dd>Allgemeine Informationen zu MOA-ID.</dd>
- <dt><a href="./id-admin.htm">Administration</a></dt>
- <dd>Detaillierte Anleitung f&uuml;r die Installation und Konfiguration.</dd>
- <dt><a href="./id-anwendung.htm">Anwendung</a></dt>
- <dd>Erl&auml;uterung der Anwendung von MOA-ID.</dd>
- <dt><a href="./faqs.htm">FAQ</a></dt>
- <dd>H&auml;ufig gestellte Fragen zu Installation, Konfiguration und Anwendung. </dd>
- <dt><a href="./links.htm">Links</a></dt>
- <dd>H&auml;ufig gestellte Fragen zu Installation, Konfiguration und Anwendung. </dd>
- </dl>
- </body>
-</html>
diff --git a/id/server/doc/moa_images/east.gif b/id/server/doc/moa_images/east.gif
deleted file mode 100644
index e76117cb0..000000000
--- a/id/server/doc/moa_images/east.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/idle.gif b/id/server/doc/moa_images/idle.gif
deleted file mode 100644
index 28b8148e5..000000000
--- a/id/server/doc/moa_images/idle.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/moa_diagramm1.jpg b/id/server/doc/moa_images/moa_diagramm1.jpg
deleted file mode 100644
index 776331fb8..000000000
--- a/id/server/doc/moa_images/moa_diagramm1.jpg
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/moa_thema.gif b/id/server/doc/moa_images/moa_thema.gif
deleted file mode 100644
index f59075528..000000000
--- a/id/server/doc/moa_images/moa_thema.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/north.gif b/id/server/doc/moa_images/north.gif
deleted file mode 100644
index b4316b5d7..000000000
--- a/id/server/doc/moa_images/north.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/pfeil.gif b/id/server/doc/moa_images/pfeil.gif
deleted file mode 100644
index e4eeb1740..000000000
--- a/id/server/doc/moa_images/pfeil.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/print.gif b/id/server/doc/moa_images/print.gif
deleted file mode 100644
index b8e59144e..000000000
--- a/id/server/doc/moa_images/print.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/select.gif b/id/server/doc/moa_images/select.gif
deleted file mode 100644
index 59a1694c5..000000000
--- a/id/server/doc/moa_images/select.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/south.gif b/id/server/doc/moa_images/south.gif
deleted file mode 100644
index c70ab3e97..000000000
--- a/id/server/doc/moa_images/south.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/transdot.gif b/id/server/doc/moa_images/transdot.gif
deleted file mode 100644
index e31aba280..000000000
--- a/id/server/doc/moa_images/transdot.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/moa_images/west.gif b/id/server/doc/moa_images/west.gif
deleted file mode 100644
index 135698ee7..000000000
--- a/id/server/doc/moa_images/west.gif
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/Architektur ID.vsd b/id/server/doc/old/Architektur ID.vsd
deleted file mode 100644
index d4678007a..000000000
--- a/id/server/doc/old/Architektur ID.vsd
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/MOA-ID Feinspezifikation.doc b/id/server/doc/old/MOA-ID Feinspezifikation.doc
deleted file mode 100644
index e71ffa8e6..000000000
--- a/id/server/doc/old/MOA-ID Feinspezifikation.doc
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/MOA-Testzertifikate.pdf b/id/server/doc/old/MOA-Testzertifikate.pdf
deleted file mode 100644
index a2c44f2a2..000000000
--- a/id/server/doc/old/MOA-Testzertifikate.pdf
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/MOA-Testzertifikate.vsd b/id/server/doc/old/MOA-Testzertifikate.vsd
deleted file mode 100644
index c36051c04..000000000
--- a/id/server/doc/old/MOA-Testzertifikate.vsd
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/bku-auswahl.20030408.pdf b/id/server/doc/old/bku-auswahl.20030408.pdf
deleted file mode 100644
index 39efe315f..000000000
--- a/id/server/doc/old/bku-auswahl.20030408.pdf
+++ /dev/null
Binary files differ
diff --git a/id/server/doc/old/moa-id.htm b/id/server/doc/old/moa-id.htm
deleted file mode 100644
index 82e5adc19..000000000
--- a/id/server/doc/old/moa-id.htm
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0; URL=moa_id/moa.htm"/>
-
-</head>
-<body></body>
-</html> \ No newline at end of file
diff --git a/id/server/idserverlib/moa-id-lib.iml b/id/server/idserverlib/moa-id-lib.iml
new file mode 100644
index 000000000..893a98579
--- /dev/null
+++ b/id/server/idserverlib/moa-id-lib.iml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: eu.stork.mw.core:stork-saml-engine:2.0" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.6" level="project" />
+ <orderEntry type="library" name="Maven: eu.stork:oasis-dss-api:1.0.0-RELEASE" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="module" module-name="moa-id-commons" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-c3p0:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:maven-hyperjaxb3-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.annox:annox:0.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-tools:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-testing:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: xmlunit:xmlunit:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-persistence:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-customizations:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring:2.0.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.org.apache.xml.internal:resolver:20050927" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-project:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-model:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:1.5.15" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.11" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
+ <orderEntry type="library" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-profile:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact-manager:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6" level="project" />
+ <orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-registry:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jfrog.maven.annomojo:maven-plugin-anno:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-xjc:2.2.4-1" level="project" />
+ <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
+ <orderEntry type="module" module-name="Commons" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.6.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.4.0" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.5.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xml-apis:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xercesImpl:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:serializer:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
+ <orderEntry type="module" module-name="SamlEngine" />
+ <orderEntry type="module" module-name="moa-common" scope="TEST" production-on-test="" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: axis:axis:1.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-tools:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-rt:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3" level="project" />
+ <orderEntry type="library" name="Maven: dav4j:dav4j:0.1" level="project" />
+ <orderEntry type="library" name="Maven: httpsclient:httpsclient:JSSE-1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_X509TrustManager:0.3" level="project" />
+ <orderEntry type="library" name="Maven: regexp:regexp:1.3" level="project" />
+ <orderEntry type="library" name="Maven: com.googlecode.jsontoken:jsontoken:1.0" level="project" />
+ <orderEntry type="library" name="Maven: com.google.code.gson:gson:1.4" level="project" />
+ <orderEntry type="library" name="Maven: com.google.collections:google-collections:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.http-client:google-http-client-jackson2:1.17.0-rc" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.http-client:google-http-client:1.17.0-rc" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.apache.httpcomponents:httpclient:4.0.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.fasterxml.jackson.core:jackson-core:2.1.3" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.oauth-client:google-oauth-client-jetty:1.17.0-rc" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.oauth-client:google-oauth-client-java6:1.17.0-rc" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.google.oauth-client:google-oauth-client:1.17.0-rc" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.mortbay.jetty:jetty:6.1.26" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.mortbay.jetty:jetty-util:6.1.26" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.mortbay.jetty:servlet-api:2.5-20081211" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.testng:testng:6.1.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.beanshell:bsh:2.0b4" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.12" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.6" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml
index f120caee8..85fce678c 100644
--- a/id/server/idserverlib/pom.xml
+++ b/id/server/idserverlib/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -23,17 +23,12 @@
<url>https://build.shibboleth.net/nexus/content/groups/public/</url>
</repository>
</repositories>
-
+
<dependencies>
- <dependency>
- <groupId>eu.stork</groupId>
- <artifactId>SamlEngine</artifactId>
- <version>1.1.0</version>
- </dependency>
<dependency>
<groupId>eu.stork</groupId>
<artifactId>oasis-dss-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-RELEASE</version>
</dependency>
<dependency>
@@ -41,6 +36,34 @@
<artifactId>moa-id-commons</artifactId>
<version>${pom.version}</version>
</dependency>
+ <!--
+ <dependency>
+ <groupId>MOA.id</groupId>
+ <artifactId>stork-saml-engine</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>MOA.id</groupId>
+ <artifactId>mw-messages-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>eu.stork</groupId>
+ <artifactId>Commons</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.stork</groupId>
+ <artifactId>SamlEngine</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>MOA.id.server</groupId>
+ <artifactId>moa-id-commons</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
<dependency>
<groupId>MOA</groupId>
<artifactId>moa-common</artifactId>
@@ -60,16 +83,20 @@
<groupId>axis</groupId>
<artifactId>axis</artifactId>
</dependency>
-
-<!-- <dependency>
+
+ <dependency>
<groupId>com.sun</groupId>
<artifactId>webservices-tools</artifactId>
<version>2.0.1</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>com.sun</groupId>
<artifactId>webservices-rt</artifactId>
<version>2.0.1</version>
+ </dependency>
+<!--<dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
</dependency> -->
<dependency>
@@ -118,7 +145,33 @@
<!-- should be in the ext directory of the jre -->
<scope>provided</scope>
</dependency>
-
+
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
@@ -136,7 +189,7 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
@@ -188,7 +241,10 @@
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
</dependency>
-
+ <!-- <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId>
+ </dependency> -->
+ <!-- <dependency> <groupId>at.gv.egovernment.moa.id</groupId> <artifactId>mandate-validate</artifactId>
+ <version>1.1</version> </dependency> -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
@@ -239,15 +295,16 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.5</source>
+ <target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
- <skipTests>true</skipTests>
+ <skip>true</skip>
+ <skipTests>true</skipTests>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
@@ -263,7 +320,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.5</version>
+ <version>2.9.1</version>
<configuration>
<charset>UTF-8</charset>
<docencoding>UTF-8</docencoding>
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 9ac9986c8..a8c4daad7 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
@@ -75,7 +75,6 @@ import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser;
import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser;
import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser;
import at.gv.egovernment.moa.id.auth.servlet.PEPSConnectorServlet;
-import at.gv.egovernment.moa.id.auth.stork.VelocityProvider;
import at.gv.egovernment.moa.id.auth.validator.CreateXMLSignatureResponseValidator;
import at.gv.egovernment.moa.id.auth.validator.IdentityLinkValidator;
import at.gv.egovernment.moa.id.auth.validator.InfoboxValidator;
@@ -87,7 +86,6 @@ import at.gv.egovernment.moa.id.auth.validator.parep.ParepUtils;
import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWConstants;
import at.gv.egovernment.moa.id.client.SZRGWClient;
import at.gv.egovernment.moa.id.client.SZRGWClientException;
-import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute;
import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute;
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
@@ -105,6 +103,7 @@ 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.VelocityProvider;
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;
@@ -125,7 +124,7 @@ 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.exceptions.ApiUtilsException;
import eu.stork.oasisdss.api.Profiles;
import eu.stork.oasisdss.api.QualityLevels;
import eu.stork.oasisdss.api.SignatureTypes;
@@ -139,6 +138,11 @@ import eu.stork.peps.auth.commons.STORKAuthnRequest;
import eu.stork.peps.auth.engine.STORKSAMLEngine;
import eu.stork.peps.exceptions.STORKSAMLEngineException;
+//import java.security.cert.CertificateFactory;
+//import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse;
+//import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWClient;
+//import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWClientException;
+
/**
* API for MOA ID Authentication Service.<br> {@link AuthenticationSession} is
* stored in a session store and retrieved by giving the session ID.
@@ -149,148 +153,147 @@ import eu.stork.peps.exceptions.STORKSAMLEngineException;
*/
public class AuthenticationServer implements MOAIDAuthConstants {
- /** single instance */
- private static AuthenticationServer instance;
-
- /**
- * time out in milliseconds used by {@link cleanup} for session store
- */
- private long sessionTimeOutCreated = 15 * 60 * 1000; // default 10 minutes
- private long sessionTimeOutUpdated = 10 * 60 * 1000; // default 10 minutes
- /**
- * time out in milliseconds used by {@link cleanup} for authentication data
- * store
- */
- private long authDataTimeOut = 2 * 60 * 1000; // default 2 minutes
-
- /**
- * Returns the single instance of <code>AuthenticationServer</code>.
- *
- * @return the single instance of <code>AuthenticationServer</code>
- */
- public static AuthenticationServer getInstance() {
- if (instance == null)
- instance = new AuthenticationServer();
- return instance;
- }
-
- /**
- * Constructor for AuthenticationServer.
- */
- public AuthenticationServer() {
- super();
- }
-
-
- /**
- * Processes the beginning of an authentication session.
- * <ul>
- * <li>Starts an authentication session</li>
- * <li>Creates an <code>&lt;InfoboxReadRequest&gt;</code></li>
- * <li>Creates an HTML form for querying the identity link from the security
- * layer implementation. <br>
- * Form parameters include
- * <ul>
- * <li>the <code>&lt;InfoboxReadRequest&gt;</code></li>
- * <li>the data URL where the security layer implementation sends it
- * response to</li>
- * </ul>
- * </ul>
- *
- * @param authURL
- * URL of the servlet to be used as data URL
- * @param target
- * "Gesch&auml;ftsbereich" of the online application requested
- * @param targetFriendlyName
- * Friendly name of the target if the target is configured via
- * configuration
- * @param oaURL
- * online application URL requested
- * @param bkuURL
- * URL of the "B&uuml;rgerkartenumgebung" to be used; may be
- * <code>null</code>; in this case, the default location will be
- * used
- * @param useMandate
- * Indicates if mandate is used or not
- * @param templateURL
- * URL providing an HTML template for the HTML form generated
- * @param templateMandteURL
- * URL providing an HTML template for the HTML form generated
- * (for signing in mandates mode)
- * @param req
- * determines the protocol used
- * @param sourceID
- * @return HTML form
- * @throws AuthenticationException
- * @see GetIdentityLinkFormBuilder
- * @see InfoboxReadRequestBuilder
- */
- public String startAuthentication(AuthenticationSession session, HttpServletRequest req) throws WrongParametersException,
- AuthenticationException, ConfigurationException, BuildException {
-
- if (session == null) {
- throw new AuthenticationException("auth.18", new Object[] { });
- }
-
- //load OnlineApplication configuration
- OAAuthParameter oaParam =
- AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix());
- if (oaParam == null)
- throw new AuthenticationException("auth.00", new Object[] { session.getPublicOAURLPrefix() });
-
- //load Template
- String template = null;
- if (session.getTemplateURL() != null) {
- try {
-
- template = new String(FileUtils.readURL(session.getTemplateURL()));
- } catch (IOException ex) {
- throw new AuthenticationException("auth.03", new Object[] {
- session.getTemplateURL(), ex.toString() }, ex);
- }
- }
-
- String infoboxReadRequest = "";
-
- String domainIdentifier = AuthConfigurationProvider.getInstance().getSSOTagetIdentifier().trim();
- if (MiscUtil.isEmpty(domainIdentifier) && session.isSsoRequested()) {
- //do not use SSO if no Target is set
- Log.warn("NO SSO-Target found in configuration. Single Sign-On is deaktivated!");
- session.setSsoRequested(false);
-
- }
-
- if (session.isSsoRequested()) {
- //load identityLink with SSO Target
- boolean isbuisness = false;
-
- if (domainIdentifier.startsWith(PREFIX_WPBK)) {
-
- isbuisness = true;
-
- } else {
- isbuisness = false;
-
- }
-
- //build ReadInfobox request
- infoboxReadRequest = new InfoboxReadRequestBuilder().build(
- isbuisness, domainIdentifier);
-
- } else {
- //build ReadInfobox request
- infoboxReadRequest = new InfoboxReadRequestBuilder().build(
- oaParam.getBusinessService(), oaParam
- .getIdentityLinkDomainIdentifier());
- }
-
-
- String dataURL = new DataURLBuilder().buildDataURL(
- session.getAuthURL(), REQ_VERIFY_IDENTITY_LINK, session
- .getSessionID());
-
- //removed in MOAID 2.0
- String pushInfobox = "";
+ /**
+ * single instance
+ */
+ private static AuthenticationServer instance;
+
+ /**
+ * time out in milliseconds used by {@link cleanup} for session store
+ */
+ private long sessionTimeOutCreated = 15 * 60 * 1000; // default 10 minutes
+ private long sessionTimeOutUpdated = 10 * 60 * 1000; // default 10 minutes
+ /**
+ * time out in milliseconds used by {@link cleanup} for authentication data
+ * store
+ */
+ private long authDataTimeOut = 2 * 60 * 1000; // default 2 minutes
+
+ /**
+ * Returns the single instance of <code>AuthenticationServer</code>.
+ *
+ * @return the single instance of <code>AuthenticationServer</code>
+ */
+ public static AuthenticationServer getInstance() {
+ if (instance == null)
+ instance = new AuthenticationServer();
+ return instance;
+ }
+
+ /**
+ * Constructor for AuthenticationServer.
+ */
+ public AuthenticationServer() {
+ super();
+ }
+
+
+ /**
+ * Processes the beginning of an authentication session.
+ * <ul>
+ * <li>Starts an authentication session</li>
+ * <li>Creates an <code>&lt;InfoboxReadRequest&gt;</code></li>
+ * <li>Creates an HTML form for querying the identity link from the security
+ * layer implementation. <br>
+ * Form parameters include
+ * <ul>
+ * <li>the <code>&lt;InfoboxReadRequest&gt;</code></li>
+ * <li>the data URL where the security layer implementation sends it
+ * response to</li>
+ * </ul>
+ * </ul>
+ *
+ * @param authURL URL of the servlet to be used as data URL
+ * @param target "Gesch&auml;ftsbereich" of the online application requested
+ * @param targetFriendlyName Friendly name of the target if the target is configured via
+ * configuration
+ * @param oaURL online application URL requested
+ * @param bkuURL URL of the "B&uuml;rgerkartenumgebung" to be used; may be
+ * <code>null</code>; in this case, the default location will be
+ * used
+ * @param useMandate Indicates if mandate is used or not
+ * @param templateURL URL providing an HTML template for the HTML form generated
+ * @param templateMandteURL URL providing an HTML template for the HTML form generated
+ * (for signing in mandates mode)
+ * @param req determines the protocol used
+ * @param sourceID
+ * @return HTML form
+ * @throws AuthenticationException
+ * @see GetIdentityLinkFormBuilder
+ * @see InfoboxReadRequestBuilder
+ */
+ public String startAuthentication(AuthenticationSession session, HttpServletRequest req) throws WrongParametersException,
+ AuthenticationException, ConfigurationException, BuildException {
+
+ if (session == null) {
+ throw new AuthenticationException("auth.18", new Object[]{});
+ }
+
+ //load OnlineApplication configuration
+ OAAuthParameter oaParam =
+ AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix());
+ if (oaParam == null)
+ throw new AuthenticationException("auth.00", new Object[]{session.getPublicOAURLPrefix()});
+
+ //load Template
+ String template = null;
+ if (session.getTemplateURL() != null) {
+ try {
+
+ template = new String(FileUtils.readURL(session.getTemplateURL()));
+ } catch (IOException ex) {
+ throw new AuthenticationException("auth.03", new Object[]{
+ session.getTemplateURL(), ex.toString()}, ex);
+ }
+ }
+
+ String infoboxReadRequest = "";
+
+ String domainIdentifier = AuthConfigurationProvider.getInstance().getSSOTagetIdentifier().trim();
+ if (MiscUtil.isEmpty(domainIdentifier) && session.isSsoRequested()) {
+ //do not use SSO if no Target is set
+ Log.warn("NO SSO-Target found in configuration. Single Sign-On is deaktivated!");
+ session.setSsoRequested(false);
+
+ }
+
+ if (session.isSsoRequested()) {
+ //load identityLink with SSO Target
+ boolean isbuisness = false;
+
+ if (domainIdentifier.startsWith(PREFIX_WPBK)) {
+
+ isbuisness = true;
+
+ } else {
+ isbuisness = false;
+
+ }
+
+ //build ReadInfobox request
+ infoboxReadRequest = new InfoboxReadRequestBuilder().build(
+ isbuisness, domainIdentifier);
+
+ } else {
+
+ if (oaParam.getStorkService())
+ // build stork request
+ infoboxReadRequest = new InfoboxReadRequestBuilder().buildStorkReadRequest(
+ oaParam.getIdentityLinkDomainIdentifier());
+ else
+ //build ReadInfobox request
+ infoboxReadRequest = new InfoboxReadRequestBuilder().build(
+ oaParam.getBusinessService(), oaParam
+ .getIdentityLinkDomainIdentifier());
+ }
+
+
+ String dataURL = new DataURLBuilder().buildDataURL(
+ session.getAuthURL(), REQ_VERIFY_IDENTITY_LINK, session
+ .getSessionID());
+
+ //removed in MOAID 2.0
+ String pushInfobox = "";
// VerifyInfoboxParameters verifyInfoboxParameters = oaParam
// .getVerifyInfoboxParameters();
@@ -307,11 +310,11 @@ public class AuthenticationServer implements MOAIDAuthConstants {
// .buildDataURL(session.getAuthURL(), REQ_START_AUTHENTICATION,
// session.getSessionID());
- //get Applet Parameters
- String appletwidth = req.getParameter(PARAM_APPLET_WIDTH);
- String appletheigth = req.getParameter(PARAM_APPLET_HEIGTH);
- appletheigth = StringEscapeUtils.escapeHtml(appletheigth);
- appletwidth = StringEscapeUtils.escapeHtml(appletwidth);
+ //get Applet Parameters
+ String appletwidth = req.getParameter(PARAM_APPLET_WIDTH);
+ String appletheigth = req.getParameter(PARAM_APPLET_HEIGTH);
+ appletheigth = StringEscapeUtils.escapeHtml(appletheigth);
+ appletwidth = StringEscapeUtils.escapeHtml(appletwidth);
//TODO: cleanup before MOA-ID 2.1 release
@@ -319,1158 +322,1120 @@ public class AuthenticationServer implements MOAIDAuthConstants {
session.getBkuURL(), infoboxReadRequest, dataURL, null,
null, pushInfobox, oaParam, appletheigth, appletwidth);
- return htmlForm;
- }
-
- /**
- * Processes an <code>&lt;InfoboxReadResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;InfoboxReadResponse&gt;</code></li>
- * <li>Parses identity link enclosed in
- * <code>&lt;InfoboxReadResponse&gt;</code></li>
- * <li>Verifies identity link by calling the MOA SP component</li>
- * <li>Checks certificate authority of identity link</li>
- * <li>Stores identity link in the session</li>
- * <li>Verifies all additional infoboxes returned from the BKU</li>
- * <li>Creates an authentication block to be signed by the user</li>
- * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
- * containg the authentication block, meant to be returned to the security
- * layer implementation</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param infoboxReadResponseParameters
- * The parameters from the response returned from the BKU
- * including the <code>&lt;InfoboxReadResponse&gt;</code>
- * @return String representation of the
- * <code>&lt;CreateXMLSignatureRequest&gt;</code>
- * @throws BKUException
- */
- public String verifyIdentityLink(AuthenticationSession session,
- Map<String, String> infoboxReadResponseParameters) throws AuthenticationException,
- BuildException, ParseException, ConfigurationException,
- ValidateException, ServiceException, BKUException {
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_IDENTITY_LINK, PARAM_SESSIONID });
-
- String xmlInfoboxReadResponse = (String) infoboxReadResponseParameters
- .get(PARAM_XMLRESPONSE);
-
- if (isEmpty(xmlInfoboxReadResponse))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_IDENTITY_LINK, PARAM_XMLRESPONSE });
-
- AuthConfigurationProvider authConf = AuthConfigurationProvider
- .getInstance();
-
- // check if an identity link was found
- // Errorcode 2911 von Trustdesk BKU (nicht spezifikationskonform
- // (SL1.2))
- // CharSequence se = "ErrorCode>2911".substring(0);
- // boolean b = xmlInfoboxReadResponse.contains(se);
- String se = "ErrorCode>2911";
- int b = xmlInfoboxReadResponse.indexOf(se);
- if (b != -1) { // no identity link found
- Logger
- .info("Es konnte keine Personenbindung auf der Karte gefunden werden. Versuche Anmeldung als auslaendische eID.");
- return null;
- }
- // spezifikationsgemaess (SL1.2) Errorcode
- se = "ErrorCode>4002";
- // b = xmlInfoboxReadResponse.contains(se);
- b = xmlInfoboxReadResponse.indexOf(se);
- if (b != -1) { // Unbekannter Infoboxbezeichner
- Logger
- .info("Unbekannter Infoboxbezeichner. Versuche Anmeldung als auslaendische eID.");
- return null;
- }
-
- // parses the <InfoboxReadResponse>
- IdentityLink identityLink = new InfoboxReadResponseParser(
- xmlInfoboxReadResponse).parseIdentityLink();
- // validates the identity link
- IdentityLinkValidator.getInstance().validate(identityLink);
- // builds a <VerifyXMLSignatureRequest> for a call of MOA-SP
- Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder()
- .build(identityLink, authConf
- .getMoaSpIdentityLinkTrustProfileID());
-
- // invokes the call
- Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker()
- .verifyXMLSignature(domVerifyXMLSignatureRequest);
- // parses the <VerifyXMLSignatureResponse>
- VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser(
- domVerifyXMLSignatureResponse).parseData();
-
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
-
- // if OA is type is business service the manifest validation result has
- // to be ignored
- boolean ignoreManifestValidationResult = oaParam.getBusinessService() ? true
- : false;
-
- // validates the <VerifyXMLSignatureResponse>
- VerifyXMLSignatureResponseValidator.getInstance().validate(
- verifyXMLSignatureResponse,
- authConf.getIdentityLinkX509SubjectNames(),
- VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK,
- ignoreManifestValidationResult);
-
- session.setIdentityLink(identityLink);
- // now validate the extended infoboxes
-
- //Removed in MOA-ID 2.0
- //verifyInfoboxes(session, infoboxReadResponseParameters, false);
-
- return "found!";
- }
-
- /**
- * Processes an <code>&lt;InfoboxReadResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;InfoboxReadResponse&gt;</code></li>
- * <li>Parses identity link enclosed in
- * <code>&lt;InfoboxReadResponse&gt;</code></li>
- * <li>Verifies identity link by calling the MOA SP component</li>
- * <li>Checks certificate authority of identity link</li>
- * <li>Stores identity link in the session</li>
- * <li>Verifies all additional infoboxes returned from the BKU</li>
- * <li>Creates an authentication block to be signed by the user</li>
- * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
- * containg the authentication block, meant to be returned to the security
- * layer implementation</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param infoboxReadResponseParameters
- * The parameters from the response returned from the BKU
- * including the <code>&lt;InfoboxReadResponse&gt;</code>
- * @return String representation of the
- * <code>&lt;CreateXMLSignatureRequest&gt;</code>
- */
- public String verifyCertificate(AuthenticationSession session,
- X509Certificate certificate) throws AuthenticationException,
- BuildException, ParseException, ConfigurationException,
- ValidateException, ServiceException, MOAIDException{
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID });
-
- // check if person is a Organwalter
- // if true - don't show bPK in AUTH Block
- try {
- for (ObjectID OWid : MOAIDAuthConstants.OW_LIST) {
- if (certificate.getExtension(OWid) != null) {
- session.setOW(true);
- }
-
- }
-
- } catch (X509ExtensionInitException e) {
- Logger.warn("Certificate extension is not readable.");
- session.setOW(false);
- }
-
- AuthConfigurationProvider authConf = AuthConfigurationProvider
- .getInstance();
-
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
-
- String returnvalue = getCreateXMLSignatureRequestAuthBlockOrRedirect(session,
- authConf, oaParam);
-
- return returnvalue;
- }
-
- /**
- * Processes an <code>Mandate</code> sent by the MIS.<br>
- * <ul>
- * <li>Validates given <code>Mandate</code></li>
- * <li>Verifies Mandate by calling the MOA SP component</li>
- * <li>Creates an authentication block to be signed by the user</li>
- * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
- * containg the authentication block, meant to be returned to the security
- * layer implementation</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param infoboxReadResponseParameters
- * The parameters from the response returned from the BKU
- * including the <code>&lt;InfoboxReadResponse&gt;</code>
- * @return String representation of the
- * <code>&lt;CreateXMLSignatureRequest&gt;</code>
- */
- public void verifyMandate(AuthenticationSession session, MISMandate mandate)
- throws AuthenticationException, BuildException, ParseException,
- ConfigurationException, ValidateException, ServiceException {
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- GET_MIS_SESSIONID, PARAM_SESSIONID });
-
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
-
- try {
- // sets the extended SAML attributes for OID (Organwalter)
- setExtendedSAMLAttributeForMandatesOID(session, mandate, oaParam
- .getBusinessService());
-
- validateExtendedSAMLAttributeForMandates(session, mandate, oaParam.getBusinessService());
-
-
- } catch (SAXException e) {
- throw new AuthenticationException("auth.16",
- new Object[] { GET_MIS_SESSIONID }, e);
- } catch (IOException e) {
- throw new AuthenticationException("auth.16",
- new Object[] { GET_MIS_SESSIONID }, e);
- } catch (ParserConfigurationException e) {
- throw new AuthenticationException("auth.16",
- new Object[] { GET_MIS_SESSIONID }, e);
- } catch (TransformerException e) {
- throw new AuthenticationException("auth.16",
- new Object[] { GET_MIS_SESSIONID }, e);
- }
-
- }
-
- /**
- *
- * @param session
- * @param authConf
- * @param oaParam
- * @return
- * @throws ConfigurationException
- * @throws BuildException
- * @throws ValidateException
- */
- public String getCreateXMLSignatureRequestAuthBlockOrRedirect(
- AuthenticationSession session, AuthConfigurationProvider authConf,
- OAAuthParameter oaParam) throws ConfigurationException,
- BuildException, ValidateException {
-
- // check for intermediate processing of the infoboxes
- if (session.isValidatorInputPending())
- return "Redirect to Input Processor";
-
- if (authConf == null)
- authConf = AuthConfigurationProvider.getInstance();
- if (oaParam == null)
- oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(
- session.getPublicOAURLPrefix());
-
- // builds the AUTH-block
- String authBlock = buildAuthenticationBlock(session, oaParam);
-
- // builds the <CreateXMLSignatureRequest>
- List<String> transformsInfos = oaParam.getTransformsInfos();
- if ((transformsInfos == null) || (transformsInfos.size() == 0)) {
- // no OA specific transforms specified, use default ones
- transformsInfos = authConf.getTransformsInfos();
- }
- String createXMLSignatureRequest = new CreateXMLSignatureRequestBuilder()
- .build(authBlock, oaParam.getKeyBoxIdentifier(),
- transformsInfos);
- return createXMLSignatureRequest;
- }
-
- /**
- * Returns an CreateXMLSignatureRequest for signing the ERnP statement.<br>
- * <ul>
- * <li>Creates an CreateXMLSignatureRequest to be signed by the user</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param cert
- * The certificate from the user
- * @return String representation of the
- * <code>&lt;CreateXMLSignatureRequest&gt;</code>
- */
- public String createXMLSignatureRequestForeignID(AuthenticationSession session,
- X509Certificate cert) throws AuthenticationException,
- BuildException, ParseException, ConfigurationException,
- ValidateException, ServiceException {
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID });
-
- AuthConfigurationProvider authConf = AuthConfigurationProvider
- .getInstance();
-
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
-
- return getCreateXMLSignatureRequestForeigID(session, authConf, oaParam,
- cert);
- }
-
- public String getCreateXMLSignatureRequestForeigID(
- AuthenticationSession session, AuthConfigurationProvider authConf,
- OAAuthParameter oaParam, X509Certificate cert)
- throws ConfigurationException {
-
- // check for intermediate processing of the infoboxes
- if (session.isValidatorInputPending())
- return "Redirect to Input Processor";
-
- if (authConf == null)
- authConf = AuthConfigurationProvider.getInstance();
- if (oaParam == null)
- oaParam = AuthConfigurationProvider.getInstance()
- .getOnlineApplicationParameter(
- session.getPublicOAURLPrefix());
-
- Principal subject = cert.getSubjectDN();
-
- String createXMLSignatureRequest = new CreateXMLSignatureRequestBuilder()
- .buildForeignID(subject.toString(), oaParam, session);
- return createXMLSignatureRequest;
- }
-
- /**
- * Processes an <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Parses response enclosed in
- * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Verifies signature by calling the MOA SP component</li>
- * <li>Returns the signer certificate</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param createXMLSignatureResponseParameters
- * The parameters from the response returned from the BKU
- * including the <code>&lt;CreateXMLSignatureResponse&gt;</code>
- * @throws BKUException
- */
- public X509Certificate verifyXMLSignature(String sessionID,
- Map<String, String> createXMLSignatureResponseParameters)
- throws AuthenticationException, BuildException, ParseException,
- ConfigurationException, ValidateException, ServiceException, BKUException {
-
- if (isEmpty(sessionID))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_GET_FOREIGN_ID, PARAM_SESSIONID });
-
- String xmlCreateXMLSignatureResponse = (String) createXMLSignatureResponseParameters
- .get(PARAM_XMLRESPONSE);
-
- if (isEmpty(xmlCreateXMLSignatureResponse))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_GET_FOREIGN_ID, PARAM_XMLRESPONSE });
-
- AuthConfigurationProvider authConf = AuthConfigurationProvider
- .getInstance();
-
- // parses the <CreateXMLSignatureResponse>
- CreateXMLSignatureResponseParser p = new CreateXMLSignatureResponseParser(
- xmlCreateXMLSignatureResponse);
- CreateXMLSignatureResponse createXMLSignatureResponse = p
- .parseResponseDsig();
-
- // builds a <VerifyXMLSignatureRequest> for a call of MOA-SP
- Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder()
- .buildDsig(createXMLSignatureResponse, authConf
- .getMoaSpAuthBlockTrustProfileID());
-
- // invokes the call
- Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker()
- .verifyXMLSignature(domVerifyXMLSignatureRequest);
-
- // parses the <VerifyXMLSignatureResponse>
- VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser(
- domVerifyXMLSignatureResponse).parseData();
-
- return verifyXMLSignatureResponse.getX509certificate();
-
- }
-
- /**
- * Processes an <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Parses response enclosed in
- * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Verifies signature by calling the MOA SP component</li>
- * <li>Returns the signer certificate</li>
- * </ul>
- *
- * @param sessionID
- * ID of associated authentication session data
- * @param readInfoboxResponseParameters
- * The parameters from the response returned from the BKU
- * including the <code>&lt;ReadInfoboxResponse&gt;</code>
- * @throws BKUException
- */
- public X509Certificate getCertificate(String sessionID,
- Map<String, String> readInfoboxResponseParameters) throws AuthenticationException,
- BuildException, ParseException, ConfigurationException,
- ValidateException, ServiceException, BKUException {
-
- if (isEmpty(sessionID))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID });
-
- String xmlReadInfoboxResponse = (String) readInfoboxResponseParameters
- .get(PARAM_XMLRESPONSE);
-
- if (isEmpty(xmlReadInfoboxResponse))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_CERTIFICATE, PARAM_XMLRESPONSE });
-
- // parses the <CreateXMLSignatureResponse>
- InfoboxReadResponseParser p = new InfoboxReadResponseParser(
- xmlReadInfoboxResponse);
- X509Certificate cert = p.parseCertificate();
-
- return cert;
-
- }
-
- /**
- * Builds an authentication block <code>&lt;saml:Assertion&gt;</code> from
- * given session data.
- *
- * @param session
- * authentication session
- *
- * @return <code>&lt;saml:Assertion&gt;</code> as a String
- *
- * @throws BuildException
- * If an error occurs on serializing an extended SAML attribute
- * to be appended to the AUTH-Block.
- */
- private String buildAuthenticationBlock(AuthenticationSession session,
- OAAuthParameter oaParam) throws BuildException {
-
- IdentityLink identityLink = session.getIdentityLink();
- String issuer = identityLink.getName();
- String gebDat = identityLink.getDateOfBirth();
-
- String identificationValue = null;
- String identificationType = null;
-
- //set empty AuthBlock BPK in case of OW or SSO or bpk is not requested
- if (session.isOW() || session.isSsoRequested() || oaParam.isRemovePBKFromAuthBlock()) {
- identificationType = "";
- identificationValue = "";
-
- } else if (identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
-
- if (oaParam.getBusinessService()) {
-
- String bpkBase64 = new BPKBuilder().buildWBPK(identityLink
- .getIdentificationValue(), oaParam.getIdentityLinkDomainIdentifier());
- identificationValue = bpkBase64;
-
- if (oaParam.getIdentityLinkDomainIdentifier().startsWith(Constants.URN_PREFIX_WBPK + "+" ))
- identificationType = oaParam.getIdentityLinkDomainIdentifier();
- else
- identificationType = Constants.URN_PREFIX_WBPK + "+" + oaParam.getIdentityLinkDomainIdentifier();
-
- } else {
- String bpkBase64 = new BPKBuilder().buildBPK(identityLink
- .getIdentificationValue(), session.getTarget());
- identificationValue = bpkBase64;
- identificationType = Constants.URN_PREFIX_CDID + "+" + session.getTarget();
- }
-
-
- } else {
- identificationValue = identityLink.getIdentificationValue();
- identificationType = identityLink.getIdentificationType();
-
- }
-
- String issueInstant = DateTimeUtils.buildDateTimeUTC(Calendar
- .getInstance());
- session.setIssueInstant(issueInstant);
- String authURL = session.getAuthURL();
- String target = session.getTarget();
- String targetFriendlyName = session.getTargetFriendlyName();
-
- // Bug #485
- // (https://egovlabs.gv.at/tracker/index.php?func=detail&aid=485&group_id=6&atid=105)
- // String oaURL = session.getPublicOAURLPrefix();
-
- List<ExtendedSAMLAttribute> extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH();
-
-
- if (session.isSsoRequested()) {
- String oaURL = new String();
- try {
- oaURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix();
-
- if (MiscUtil.isNotEmpty(oaURL))
- oaURL = oaURL.replaceAll("&", "&amp;");
-
- } catch (ConfigurationException e) {
- }
- String authBlock = new AuthenticationBlockAssertionBuilder()
- .buildAuthBlockSSO(issuer, issueInstant, authURL, target,
- targetFriendlyName, identificationValue,
- identificationType, oaURL, gebDat,
- extendedSAMLAttributes, session, oaParam);
- return authBlock;
-
- } else {
- String oaURL = session.getPublicOAURLPrefix().replaceAll("&", "&amp;");
- String authBlock = new AuthenticationBlockAssertionBuilder()
- .buildAuthBlock(issuer, issueInstant, authURL, target,
- targetFriendlyName, identificationValue,
- identificationType, oaURL, gebDat,
- extendedSAMLAttributes, session, oaParam);
- return authBlock;
- }
- }
-
-
-
- /**
- * Verifies the infoboxes (except of the identity link infobox) returned by
- * the BKU by calling appropriate validator classes.
- *
- * @param session
- * The actual authentication session.
- * @param mandate
- * The Mandate from the MIS
- *
- * @throws AuthenticationException
- * @throws ConfigurationException
- * @throws TransformerException
- * @throws ParserConfigurationException
- * @throws IOException
- * @throws SAXException
- */
- private void validateExtendedSAMLAttributeForMandates(
- AuthenticationSession session, MISMandate mandate,
- boolean business)
- throws ValidateException, ConfigurationException, SAXException,
- IOException, ParserConfigurationException, TransformerException {
-
- ExtendedSAMLAttribute[] extendedSAMLAttributes = addExtendedSamlAttributes(
- mandate, business, false);
-
- int length = extendedSAMLAttributes.length;
- for (int i = 0; i < length; i++) {
- ExtendedSAMLAttribute samlAttribute = extendedSAMLAttributes[i];
-
- verifySAMLAttribute(samlAttribute, i, "MISService",
- "MISService");
-
- }
- }
-
- /**
- * Verifies the infoboxes (except of the identity link infobox) returned by
- * the BKU by calling appropriate validator classes.
- *
- * @param session
- * The actual authentication session.
- * @param mandate
- * The Mandate from the MIS
- *
- * @throws AuthenticationException
- * @throws ConfigurationException
- * @throws TransformerException
- * @throws ParserConfigurationException
- * @throws IOException
- * @throws SAXException
- */
- private void setExtendedSAMLAttributeForMandatesOID(
- AuthenticationSession session, MISMandate mandate, boolean business)
- throws ValidateException, ConfigurationException, SAXException,
- IOException, ParserConfigurationException, TransformerException {
-
- ExtendedSAMLAttribute[] extendedSamlAttributes = addExtendedSamlAttributesOID(
- mandate, business);
-
- AddAdditionalSAMLAttributes(session, extendedSamlAttributes,
- "MISService", "MISService");
-
- }
-
- /**
- * Adds given SAML Attributes to the current session. They will be appended
- * to the final SAML Assertion or the AUTH block. If the attributes are
- * already in the list, they will be replaced.
- *
- * @param session
- * The current session
- * @param extendedSAMLAttributes
- * The SAML attributes to add
- * @param identifier
- * The infobox identifier for debug purposes
- * @param friendlyNam
- * The friendly name of the infobox for debug purposes
- */
- private static void AddAdditionalSAMLAttributes(
- AuthenticationSession session,
- ExtendedSAMLAttribute[] extendedSAMLAttributes, String identifier,
- String friendlyName) throws ValidateException {
- if (extendedSAMLAttributes == null)
- return;
- List<ExtendedSAMLAttribute> oaAttributes = session.getExtendedSAMLAttributesOA();
- if (oaAttributes == null)
- oaAttributes = new Vector<ExtendedSAMLAttribute>();
- List<ExtendedSAMLAttribute> authAttributes = session.getExtendedSAMLAttributesAUTH();
- if (authAttributes == null)
- authAttributes = new Vector<ExtendedSAMLAttribute>();
- int length = extendedSAMLAttributes.length;
- for (int i = 0; i < length; i++) {
- ExtendedSAMLAttribute samlAttribute = extendedSAMLAttributes[i];
-
- Object value = verifySAMLAttribute(samlAttribute, i, identifier,
- friendlyName);
-
- if ((value instanceof String) || (value instanceof Element)) {
- switch (samlAttribute.getAddToAUTHBlock()) {
- case ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY:
- replaceExtendedSAMLAttribute(authAttributes, samlAttribute);
- break;
- case ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK:
- replaceExtendedSAMLAttribute(authAttributes, samlAttribute);
- replaceExtendedSAMLAttribute(oaAttributes, samlAttribute);
- break;
- case ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK:
- replaceExtendedSAMLAttribute(oaAttributes, samlAttribute);
- break;
- default:
- Logger
- .info("Invalid return value from method \"getAddToAUTHBlock()\" ("
- + samlAttribute.getAddToAUTHBlock()
- + ") in SAML attribute number "
- + (i + 1)
- + " for infobox " + identifier);
- throw new ValidateException("validator.47", new Object[] {
- friendlyName, String.valueOf((i + 1)) });
- }
- } else {
- Logger
- .info("The type of SAML-Attribute number "
- + (i + 1)
- + " returned from "
- + identifier
- + "-infobox validator is not valid. Must be either \"java.Lang.String\""
- + " or \"org.w3c.dom.Element\"");
- throw new ValidateException("validator.46", new Object[] {
- identifier, String.valueOf((i + 1)) });
- }
- }
- session.setExtendedSAMLAttributesAUTH(authAttributes);
- session.setExtendedSAMLAttributesOA(oaAttributes);
- }
-
- /**
- * Adds the AUTH block related SAML attributes to the validation result.
- * This is needed always before the AUTH block is to be signed, because the
- * name of the mandator has to be set
- *
- * @throws ParserConfigurationException
- * @throws IOException
- * @throws SAXException
- * @throws TransformerException
- */
-
- protected static ExtendedSAMLAttribute[] addExtendedSamlAttributes(
- MISMandate mandate, boolean business, boolean provideStammzahl)
- throws SAXException, IOException, ParserConfigurationException,
- TransformerException {
- Vector<ExtendedSAMLAttribute> extendedSamlAttributes = new Vector<ExtendedSAMLAttribute>();
-
- extendedSamlAttributes.clear();
-
- // Name
- Element domMandate = mandateToElement(mandate);
- Element nameSpaceNode = domMandate.getOwnerDocument().createElement(
- "NameSpaceNode");
- nameSpaceNode.setAttribute("xmlns" + SZRGWConstants.PD_POSTFIX,
- Constants.PD_NS_URI);
- nameSpaceNode.setAttribute("xmlns" + SZRGWConstants.MANDATE_POSTFIX,
- SZRGWConstants.MANDATE_NS);
-
- Element mandator = (Element) XPathAPI.selectSingleNode(domMandate,
- "//md:Mandate/md:Mandator", nameSpaceNode);
-
- // Mandate
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_RAW, domMandate,
- SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
-
- // (w)bpk
- String wbpk = ParepUtils.extractMandatorWbpk(mandator);
- if (!ParepUtils.isEmpty(wbpk)) {
- if (!ParepUtils.isPhysicalPerson(mandator)) {
- String idType = ParepUtils
- .extractMandatorIdentificationType(mandator);
- if (!ParepUtils.isEmpty(idType)
- && idType.startsWith(Constants.URN_PREFIX_BASEID)) {
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_CB_BASE_ID,
- ParepUtils.getRegisterString(idType) + ": " + wbpk,
- SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY));
- }
- } else if (business) {
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_WBPK, wbpk,
- SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY));
- }
- }
-
- ExtendedSAMLAttribute[] ret = new ExtendedSAMLAttribute[extendedSamlAttributes
- .size()];
- extendedSamlAttributes.copyInto(ret);
- Logger.debug("ExtendedSAML Attributes: " + ret.length);
- return ret;
-
- }
-
- /**
- * Adds the AUTH block related SAML attributes to the validation result.
- * This is needed always before the AUTH block is to be signed, because the
- * name of the mandator has to be set
- *
- * @throws ParserConfigurationException
- * @throws IOException
- * @throws SAXException
- * @throws TransformerException
- */
- private static ExtendedSAMLAttribute[] addExtendedSamlAttributesOID(
- MISMandate mandate, boolean business) throws SAXException,
- IOException, ParserConfigurationException, TransformerException {
-
- Vector<ExtendedSAMLAttribute> extendedSamlAttributes = new Vector<ExtendedSAMLAttribute>();
-
- extendedSamlAttributes.clear();
-
- // RepresentationType
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_REPRESENTATIONTYPE,
- EXT_SAML_MANDATE_REPRESENTATIONTEXT,
- SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
-
- String oid = mandate.getProfRep();
-
- if (oid != null) {
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_OID, oid,
- SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
- String oidDescription = mandate.getTextualDescriptionOfOID();
- extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
- EXT_SAML_MANDATE_OIDTEXTUALDESCRIPTION,
- oidDescription, SZRGWConstants.MANDATE_NS,
- ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
-
- }
-
- ExtendedSAMLAttribute[] ret = new ExtendedSAMLAttribute[extendedSamlAttributes
- .size()];
- extendedSamlAttributes.copyInto(ret);
- Logger.debug("ExtendedSAML Attributes: " + ret.length);
- return ret;
-
- }
-
- /**
- *
- * @param mandate
- * @return
- * @throws ParserConfigurationException
- * @throws IOException
- * @throws SAXException
- */
- private static Element mandateToElement(MISMandate mandate)
- throws SAXException, IOException, ParserConfigurationException {
- ByteArrayInputStream bais = new ByteArrayInputStream(mandate
- .getMandate());
- Document doc = DOMUtils.parseDocumentSimple(bais);
- return doc.getDocumentElement();
- }
-
- protected static void replaceExtendedSAMLAttribute(List<ExtendedSAMLAttribute> attributes,
- ExtendedSAMLAttribute samlAttribute) {
- if (null == attributes) {
- attributes = new Vector<ExtendedSAMLAttribute>();
- } else {
- String id = samlAttribute.getName();
- int length = attributes.size();
- for (int i = 0; i < length; i++) {
- ExtendedSAMLAttribute att = (ExtendedSAMLAttribute) attributes
- .get(i);
- if (id.equals(att.getName())) {
- // replace attribute
- attributes.set(i, samlAttribute);
- return;
- }
- }
- attributes.add(samlAttribute);
- }
- }
-
- /**
- * Processes a <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Parses <code>&lt;CreateXMLSignatureResponse&gt;</code> for error
- * codes</li>
- * <li>Parses authentication block enclosed in
- * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Verifies authentication block by calling the MOA SP component</li>
- * <li>Creates authentication data</li>
- * <li>Creates a corresponding SAML artifact</li>
- * <li>Stores authentication data in the authentication data store indexed
- * by the SAML artifact</li>
- * <li>Deletes authentication session</li>
- * <li>Returns the SAML artifact, encoded BASE64</li>
- * </ul>
- *
- * @param sessionID
- * session ID of the running authentication session
- * @param xmlCreateXMLSignatureReadResponse
- * String representation of the
- * <code>&lt;CreateXMLSignatureResponse&gt;</code>
- * @return SAML artifact needed for retrieving authentication data, encoded
- * BASE64
- * @throws BKUException
- */
- public String verifyAuthenticationBlock(AuthenticationSession session,
- String xmlCreateXMLSignatureReadResponse)
- throws AuthenticationException, BuildException, ParseException,
- ConfigurationException, ServiceException, ValidateException, BKUException {
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_AUTH_BLOCK, PARAM_SESSIONID });
- if (isEmpty(xmlCreateXMLSignatureReadResponse))
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE });
-
- AuthConfigurationProvider authConf = AuthConfigurationProvider
- .getInstance();
- // parses <CreateXMLSignatureResponse>
- CreateXMLSignatureResponse csresp = new CreateXMLSignatureResponseParser(
- xmlCreateXMLSignatureReadResponse).parseResponse();
-
- try {
- String serializedAssertion = DOMUtils.serializeNode(csresp
- .getSamlAssertion());
- session.setAuthBlock(serializedAssertion);
- } catch (TransformerException e) {
- throw new ParseException("parser.04", new Object[] {
- REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE });
- } catch (IOException e) {
- throw new ParseException("parser.04", new Object[] {
- REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE });
- }
- // validates <CreateXMLSignatureResponse>
- if (session.isSsoRequested())
- new CreateXMLSignatureResponseValidator().validateSSO(csresp, session);
- else
- new CreateXMLSignatureResponseValidator().validate(csresp, session);
-
- // builds a <VerifyXMLSignatureRequest> for a MOA-SPSS call
- List<String> vtids = authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs();
- String tpid = authConf.getMoaSpAuthBlockTrustProfileID();
- Element domVsreq = new VerifyXMLSignatureRequestBuilder().build(csresp,
- vtids, tpid);
- // debug output
-
- // invokes the call
- Element domVsresp = new SignatureVerificationInvoker()
- .verifyXMLSignature(domVsreq);
- // debug output
-
- // parses the <VerifyXMLSignatureResponse>
- VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponseParser(
- domVsresp).parseData();
-
- if (Logger.isTraceEnabled()) {
- if (domVsresp != null) {
- try {
- String xmlVerifyXMLSignatureResponse = DOMUtils
- .serializeNode(domVsresp, true);
- Logger.trace(new LogMsg(xmlCreateXMLSignatureReadResponse));
- Logger.trace(new LogMsg(xmlVerifyXMLSignatureResponse));
- } catch (Throwable t) {
- t.printStackTrace();
- Logger.info(new LogMsg(t.getStackTrace()));
- }
- }
- }
-
- // validates the <VerifyXMLSignatureResponse>
- VerifyXMLSignatureResponseValidator.getInstance().validate(vsresp,
- null, VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK,
- false);
-
- // Compare AuthBlock Data with information stored in session, especially
- // date and time
- CreateXMLSignatureResponseValidator.getInstance().validateSigningDateTime(csresp);
-
- // compares the public keys from the identityLink with the AuthBlock
- VerifyXMLSignatureResponseValidator.getInstance().validateCertificate(
- vsresp, session.getIdentityLink());
-
- // post processing of the infoboxes
- Iterator iter = session.getInfoboxValidatorIterator();
- boolean formpending = false;
- if (iter != null) {
- while (!formpending && iter.hasNext()) {
- Vector infoboxValidatorVector = (Vector) iter.next();
- String identifier = (String) infoboxValidatorVector.get(0);
- String friendlyName = (String) infoboxValidatorVector.get(1);
- InfoboxValidator infoboxvalidator = (InfoboxValidator) infoboxValidatorVector
- .get(2);
- InfoboxValidationResult infoboxValidationResult = null;
- try {
- infoboxValidationResult = infoboxvalidator.validate(csresp
- .getSamlAssertion());
- } catch (ValidateException e) {
- Logger.error("Error validating " + identifier + " infobox:"
- + e.getMessage());
- throw new ValidateException("validator.44",
- new Object[] { friendlyName });
- }
- if (!infoboxValidationResult.isValid()) {
- Logger.info("Validation of " + identifier
- + " infobox failed.");
- throw new ValidateException("validator.40", new Object[] {
- friendlyName,
- infoboxValidationResult.getErrorMessage() });
- }
- String form = infoboxvalidator.getForm();
- if (ParepUtils.isEmpty(form)) {
- AddAdditionalSAMLAttributes(
- session,
- infoboxValidationResult.getExtendedSamlAttributes(),
- identifier, friendlyName);
- } else {
- return "Redirect to Input Processor";
- }
- }
- }
-
- session.setXMLVerifySignatureResponse(vsresp);
- session.setSignerCertificate(vsresp.getX509certificate());
- vsresp.setX509certificate(null);
- session.setForeigner(false);
-
- if (session.getUseMandate()) {
- // mandate mode
- return null;
-
- } else {
-
- session.setAuthenticatedUsed(false);
- session.setAuthenticated(true);
-
- //set QAA Level four in case of card authentifcation
- session.setQAALevel(PVPConstants.STORK_QAA_1_4);
-
-
- String oldsessionID = session.getSessionID();
-
- //Session is implicte stored in changeSessionID!!!
- String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(session);
-
- Logger.info("Changed MOASession " + oldsessionID + " to Session " + newMOASessionID);
- Logger.info("Daten angelegt zu MOASession " + newMOASessionID);
-
- return newMOASessionID;
- }
- }
-
- /**
- * Processes a <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
- * security layer implementation.<br>
- * <ul>
- * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Parses <code>&lt;CreateXMLSignatureResponse&gt;</code> for error
- * codes</li>
- * <li>Parses authentication block enclosed in
- * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
- * <li>Verifies authentication block by calling the MOA SP component</li>
- * <li>Creates authentication data</li>
- * <li>Creates a corresponding SAML artifact</li>
- * <li>Stores authentication data in the authentication data store indexed
- * by the SAML artifact</li>
- * <li>Deletes authentication session</li>
- * <li>Returns the SAML artifact, encoded BASE64</li>
- * </ul>
- *
- * @param sessionID
- * session ID of the running authentication session
- * @param xmlCreateXMLSignatureReadResponse
- * String representation of the
- * <code>&lt;CreateXMLSignatureResponse&gt;</code>
- * @return SAML artifact needed for retrieving authentication data, encoded
- * BASE64
- */
-
- protected Element createIdentificationBPK(Element mandatePerson,
- String baseid, String target) throws BuildException {
- Element identificationBpK = mandatePerson.getOwnerDocument()
- .createElementNS(Constants.PD_NS_URI, "Identification");
- Element valueBpK = mandatePerson.getOwnerDocument().createElementNS(
- Constants.PD_NS_URI, "Value");
-
- String bpkBase64 = new BPKBuilder().buildBPK(baseid, target);
- valueBpK.appendChild(mandatePerson.getOwnerDocument().createTextNode(
- bpkBase64));
- Element typeBpK = mandatePerson.getOwnerDocument().createElementNS(
- Constants.PD_NS_URI, "Type");
- typeBpK.appendChild(mandatePerson.getOwnerDocument().createTextNode(
- "urn:publicid:gv.at:cdid+bpk"));
- identificationBpK.appendChild(valueBpK);
- identificationBpK.appendChild(typeBpK);
-
- return identificationBpK;
-
- }
-
- protected String getBaseId(Element mandatePerson)
- throws TransformerException, IOException {
- NodeList list = mandatePerson.getElementsByTagNameNS(
- Constants.PD_NS_URI, "Identification");
- for (int i = 0; i < list.getLength(); i++) {
- Element identification = (Element) list.item(i);
- Element type = (Element) identification.getElementsByTagNameNS(
- Constants.PD_NS_URI, "Type").item(0);
- if (type.getTextContent().compareToIgnoreCase(
- "urn:publicid:gv.at:baseid") == 0) {
- Element value = (Element) identification
- .getElementsByTagNameNS(Constants.PD_NS_URI, "Value")
- .item(0);
- return value.getTextContent();
- }
- }
- return null;
-
- }
-
- /**
- * Gets the foreign authentication data.<br>
- * <ul>
- * <li>Creates authentication data</li>
- * <li>Creates a corresponding SAML artifact</li>
- * <li>Stores authentication data in the authentication data store indexed
- * by the SAML artifact</li>
- * <li>Deletes authentication session</li>
- * <li>Returns the SAML artifact, encoded BASE64</li>
- * </ul>
- *
- * @param sessionID
- * session ID of the running authentication session
- * @return SAML artifact needed for retrieving authentication data, encoded
- * BASE64
- */
- public String getForeignAuthenticationData(AuthenticationSession session)
- throws AuthenticationException, BuildException, ParseException,
- ConfigurationException, ServiceException, ValidateException {
-
- if (session == null)
- throw new AuthenticationException("auth.10", new Object[] {
- REQ_VERIFY_AUTH_BLOCK, PARAM_SESSIONID });
-
- // post processing of the infoboxes
- Iterator iter = session.getInfoboxValidatorIterator();
- boolean formpending = false;
- if (iter != null) {
- while (!formpending && iter.hasNext()) {
- Vector infoboxValidatorVector = (Vector) iter.next();
- String identifier = (String) infoboxValidatorVector.get(0);
- String friendlyName = (String) infoboxValidatorVector.get(1);
- InfoboxValidator infoboxvalidator = (InfoboxValidator) infoboxValidatorVector
- .get(2);
- InfoboxValidationResult infoboxValidationResult = null;
- try {
- infoboxValidationResult = infoboxvalidator.validate(session
- .getIdentityLink().getSamlAssertion());
- } catch (ValidateException e) {
- Logger.error("Error validating " + identifier + " infobox:"
- + e.getMessage());
- throw new ValidateException("validator.44",
- new Object[] { friendlyName });
- }
- if (!infoboxValidationResult.isValid()) {
- Logger.info("Validation of " + identifier
- + " infobox failed.");
- throw new ValidateException("validator.40", new Object[] {
- friendlyName,
- infoboxValidationResult.getErrorMessage() });
- }
- String form = infoboxvalidator.getForm();
- if (ParepUtils.isEmpty(form)) {
- AddAdditionalSAMLAttributes(
- session,
- infoboxValidationResult.getExtendedSamlAttributes(),
- identifier, friendlyName);
- } else {
- return "Redirect to Input Processor";
- }
- }
- }
-
- VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponse();
- X509Certificate cert = session.getSignerCertificate();
- vsresp.setX509certificate(cert);
-
- session.setAuthenticatedUsed(false);
- session.setAuthenticated(true);
-
-
- session.setXMLVerifySignatureResponse(vsresp);
- session.setSignerCertificate(vsresp.getX509certificate());
- vsresp.setX509certificate(null);
- session.setForeigner(true);
-
- //TODO: regenerate MOASession ID!
- return "new Session";
- }
-
- /**
- * Builds the AuthenticationData object together with the corresponding
- * <code>&lt;saml:Assertion&gt;</code>
- *
- * @param session
- * authentication session
- * @param verifyXMLSigResp
- * VerifyXMLSignatureResponse from MOA-SP
- * @param useUTC uses correct UTC time format
- * @param useUTC indicates that authenticated citizen is a foreigner
- * @param isForeigner indicates whether Austrian (false) or foreigner (true) authenticates
- * @return AuthenticationData object
- * @throws ConfigurationException
- * while accessing configuration data
- * @throws BuildException
- * while building the <code>&lt;saml:Assertion&gt;</code>
- */
- public static AuthenticationData buildAuthenticationData(
- AuthenticationSession session, OAAuthParameter oaParam, String target)
- throws ConfigurationException, BuildException {
+ return htmlForm;
+ }
+
+ /**
+ * Processes an <code>&lt;InfoboxReadResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;InfoboxReadResponse&gt;</code></li>
+ * <li>Parses identity link enclosed in
+ * <code>&lt;InfoboxReadResponse&gt;</code></li>
+ * <li>Verifies identity link by calling the MOA SP component</li>
+ * <li>Checks certificate authority of identity link</li>
+ * <li>Stores identity link in the session</li>
+ * <li>Verifies all additional infoboxes returned from the BKU</li>
+ * <li>Creates an authentication block to be signed by the user</li>
+ * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ * containg the authentication block, meant to be returned to the security
+ * layer implementation</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param infoboxReadResponseParameters The parameters from the response returned from the BKU
+ * including the <code>&lt;InfoboxReadResponse&gt;</code>
+ * @return String representation of the
+ * <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ * @throws BKUException
+ */
+ public String verifyIdentityLink(AuthenticationSession session,
+ Map<String, String> infoboxReadResponseParameters) throws AuthenticationException,
+ BuildException, ParseException, ConfigurationException,
+ ValidateException, ServiceException, BKUException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_IDENTITY_LINK, PARAM_SESSIONID});
+
+ String xmlInfoboxReadResponse = (String) infoboxReadResponseParameters
+ .get(PARAM_XMLRESPONSE);
+
+ if (isEmpty(xmlInfoboxReadResponse))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_IDENTITY_LINK, PARAM_XMLRESPONSE});
+
+ AuthConfigurationProvider authConf = AuthConfigurationProvider
+ .getInstance();
+
+ // check if an identity link was found
+ // Errorcode 2911 von Trustdesk BKU (nicht spezifikationskonform
+ // (SL1.2))
+ // CharSequence se = "ErrorCode>2911".substring(0);
+ // boolean b = xmlInfoboxReadResponse.contains(se);
+ String se = "ErrorCode>2911";
+ int b = xmlInfoboxReadResponse.indexOf(se);
+ if (b != -1) { // no identity link found
+ Logger
+ .info("Es konnte keine Personenbindung auf der Karte gefunden werden. Versuche Anmeldung als auslaendische eID.");
+ return null;
+ }
+ // spezifikationsgemaess (SL1.2) Errorcode
+ se = "ErrorCode>4002";
+ // b = xmlInfoboxReadResponse.contains(se);
+ b = xmlInfoboxReadResponse.indexOf(se);
+ if (b != -1) { // Unbekannter Infoboxbezeichner
+ Logger
+ .info("Unbekannter Infoboxbezeichner. Versuche Anmeldung als auslaendische eID.");
+ return null;
+ }
+
+ // parses the <InfoboxReadResponse>
+ IdentityLink identityLink = new InfoboxReadResponseParser(
+ xmlInfoboxReadResponse).parseIdentityLink();
+ // validates the identity link
+ IdentityLinkValidator.getInstance().validate(identityLink);
+ // builds a <VerifyXMLSignatureRequest> for a call of MOA-SP
+ Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder()
+ .build(identityLink, authConf
+ .getMoaSpIdentityLinkTrustProfileID());
+
+ // invokes the call
+ Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker()
+ .verifyXMLSignature(domVerifyXMLSignatureRequest);
+ // parses the <VerifyXMLSignatureResponse>
+ VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser(
+ domVerifyXMLSignatureResponse).parseData();
+
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
+
+ // if OA is type is business service the manifest validation result has
+ // to be ignored
+ boolean ignoreManifestValidationResult = (oaParam.getBusinessService() || oaParam.getStorkService()) ? true
+ : false;
+
+ // validates the <VerifyXMLSignatureResponse>
+ VerifyXMLSignatureResponseValidator.getInstance().validate(
+ verifyXMLSignatureResponse,
+ authConf.getIdentityLinkX509SubjectNames(),
+ VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK,
+ ignoreManifestValidationResult);
+
+ session.setIdentityLink(identityLink);
+ // now validate the extended infoboxes
+
+ //Removed in MOA-ID 2.0
+ //verifyInfoboxes(session, infoboxReadResponseParameters, false);
+
+ return "found!";
+ }
+
+ /**
+ * Processes an <code>&lt;InfoboxReadResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;InfoboxReadResponse&gt;</code></li>
+ * <li>Parses identity link enclosed in
+ * <code>&lt;InfoboxReadResponse&gt;</code></li>
+ * <li>Verifies identity link by calling the MOA SP component</li>
+ * <li>Checks certificate authority of identity link</li>
+ * <li>Stores identity link in the session</li>
+ * <li>Verifies all additional infoboxes returned from the BKU</li>
+ * <li>Creates an authentication block to be signed by the user</li>
+ * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ * containg the authentication block, meant to be returned to the security
+ * layer implementation</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param infoboxReadResponseParameters The parameters from the response returned from the BKU
+ * including the <code>&lt;InfoboxReadResponse&gt;</code>
+ * @return String representation of the
+ * <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ */
+ public String verifyCertificate(AuthenticationSession session,
+ X509Certificate certificate) throws AuthenticationException,
+ BuildException, ParseException, ConfigurationException,
+ ValidateException, ServiceException, MOAIDException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID});
+
+ // check if person is a Organwalter
+ // if true - don't show bPK in AUTH Block
+ try {
+ for (ObjectID OWid : MOAIDAuthConstants.OW_LIST) {
+ if (certificate.getExtension(OWid) != null) {
+ session.setOW(true);
+ }
+
+ }
+
+ } catch (X509ExtensionInitException e) {
+ Logger.warn("Certificate extension is not readable.");
+ session.setOW(false);
+ }
+
+ AuthConfigurationProvider authConf = AuthConfigurationProvider
+ .getInstance();
+
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
+
+ String returnvalue = getCreateXMLSignatureRequestAuthBlockOrRedirect(session,
+ authConf, oaParam);
+
+ return returnvalue;
+ }
+
+ /**
+ * Processes an <code>Mandate</code> sent by the MIS.<br>
+ * <ul>
+ * <li>Validates given <code>Mandate</code></li>
+ * <li>Verifies Mandate by calling the MOA SP component</li>
+ * <li>Creates an authentication block to be signed by the user</li>
+ * <li>Creates and returns a <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ * containg the authentication block, meant to be returned to the security
+ * layer implementation</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param infoboxReadResponseParameters The parameters from the response returned from the BKU
+ * including the <code>&lt;InfoboxReadResponse&gt;</code>
+ * @return String representation of the
+ * <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ */
+ public void verifyMandate(AuthenticationSession session, MISMandate mandate)
+ throws AuthenticationException, BuildException, ParseException,
+ ConfigurationException, ValidateException, ServiceException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ GET_MIS_SESSIONID, PARAM_SESSIONID});
+
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
+
+ try {
+ // sets the extended SAML attributes for OID (Organwalter)
+ setExtendedSAMLAttributeForMandatesOID(session, mandate, oaParam
+ .getBusinessService());
+
+ validateExtendedSAMLAttributeForMandates(session, mandate, oaParam.getBusinessService());
+
+
+ } catch (SAXException e) {
+ throw new AuthenticationException("auth.16",
+ new Object[]{GET_MIS_SESSIONID}, e);
+ } catch (IOException e) {
+ throw new AuthenticationException("auth.16",
+ new Object[]{GET_MIS_SESSIONID}, e);
+ } catch (ParserConfigurationException e) {
+ throw new AuthenticationException("auth.16",
+ new Object[]{GET_MIS_SESSIONID}, e);
+ } catch (TransformerException e) {
+ throw new AuthenticationException("auth.16",
+ new Object[]{GET_MIS_SESSIONID}, e);
+ }
+
+ }
+
+ /**
+ * @param session
+ * @param authConf
+ * @param oaParam
+ * @return
+ * @throws ConfigurationException
+ * @throws BuildException
+ * @throws ValidateException
+ */
+ public String getCreateXMLSignatureRequestAuthBlockOrRedirect(
+ AuthenticationSession session, AuthConfigurationProvider authConf,
+ OAAuthParameter oaParam) throws ConfigurationException,
+ BuildException, ValidateException {
+
+ // check for intermediate processing of the infoboxes
+ if (session.isValidatorInputPending())
+ return "Redirect to Input Processor";
+
+ if (authConf == null)
+ authConf = AuthConfigurationProvider.getInstance();
+ if (oaParam == null)
+ oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(
+ session.getPublicOAURLPrefix());
+
+ // builds the AUTH-block
+ String authBlock = buildAuthenticationBlock(session, oaParam);
+
+ // builds the <CreateXMLSignatureRequest>
+ List<String> transformsInfos = oaParam.getTransformsInfos();
+ if ((transformsInfos == null) || (transformsInfos.size() == 0)) {
+ // no OA specific transforms specified, use default ones
+ transformsInfos = authConf.getTransformsInfos();
+ }
+ String createXMLSignatureRequest = new CreateXMLSignatureRequestBuilder()
+ .build(authBlock, oaParam.getKeyBoxIdentifier(),
+ transformsInfos);
+ return createXMLSignatureRequest;
+ }
+
+ /**
+ * Returns an CreateXMLSignatureRequest for signing the ERnP statement.<br>
+ * <ul>
+ * <li>Creates an CreateXMLSignatureRequest to be signed by the user</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param cert The certificate from the user
+ * @return String representation of the
+ * <code>&lt;CreateXMLSignatureRequest&gt;</code>
+ */
+ public String createXMLSignatureRequestForeignID(AuthenticationSession session,
+ X509Certificate cert) throws AuthenticationException,
+ BuildException, ParseException, ConfigurationException,
+ ValidateException, ServiceException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID});
+
+ AuthConfigurationProvider authConf = AuthConfigurationProvider
+ .getInstance();
+
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(session.getPublicOAURLPrefix());
+
+ return getCreateXMLSignatureRequestForeigID(session, authConf, oaParam,
+ cert);
+ }
+
+ public String getCreateXMLSignatureRequestForeigID(
+ AuthenticationSession session, AuthConfigurationProvider authConf,
+ OAAuthParameter oaParam, X509Certificate cert)
+ throws ConfigurationException {
+
+ // check for intermediate processing of the infoboxes
+ if (session.isValidatorInputPending())
+ return "Redirect to Input Processor";
+
+ if (authConf == null)
+ authConf = AuthConfigurationProvider.getInstance();
+ if (oaParam == null)
+ oaParam = AuthConfigurationProvider.getInstance()
+ .getOnlineApplicationParameter(
+ session.getPublicOAURLPrefix());
+
+ Principal subject = cert.getSubjectDN();
+
+ String createXMLSignatureRequest = new CreateXMLSignatureRequestBuilder()
+ .buildForeignID(subject.toString(), oaParam, session);
+ return createXMLSignatureRequest;
+ }
+
+ /**
+ * Processes an <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Parses response enclosed in
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Verifies signature by calling the MOA SP component</li>
+ * <li>Returns the signer certificate</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param createXMLSignatureResponseParameters The parameters from the response returned from the BKU
+ * including the <code>&lt;CreateXMLSignatureResponse&gt;</code>
+ * @throws BKUException
+ */
+ public X509Certificate verifyXMLSignature(String sessionID,
+ Map<String, String> createXMLSignatureResponseParameters)
+ throws AuthenticationException, BuildException, ParseException,
+ ConfigurationException, ValidateException, ServiceException, BKUException {
+
+ if (isEmpty(sessionID))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_GET_FOREIGN_ID, PARAM_SESSIONID});
+
+ String xmlCreateXMLSignatureResponse = (String) createXMLSignatureResponseParameters
+ .get(PARAM_XMLRESPONSE);
+
+ if (isEmpty(xmlCreateXMLSignatureResponse))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_GET_FOREIGN_ID, PARAM_XMLRESPONSE});
+
+ AuthConfigurationProvider authConf = AuthConfigurationProvider
+ .getInstance();
+
+ // parses the <CreateXMLSignatureResponse>
+ CreateXMLSignatureResponseParser p = new CreateXMLSignatureResponseParser(
+ xmlCreateXMLSignatureResponse);
+ CreateXMLSignatureResponse createXMLSignatureResponse = p
+ .parseResponseDsig();
+
+ // builds a <VerifyXMLSignatureRequest> for a call of MOA-SP
+ Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder()
+ .buildDsig(createXMLSignatureResponse, authConf
+ .getMoaSpAuthBlockTrustProfileID());
+
+ // invokes the call
+ Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker()
+ .verifyXMLSignature(domVerifyXMLSignatureRequest);
+
+ // parses the <VerifyXMLSignatureResponse>
+ VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser(
+ domVerifyXMLSignatureResponse).parseData();
+
+ return verifyXMLSignatureResponse.getX509certificate();
+
+ }
+
+ /**
+ * Processes an <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Parses response enclosed in
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Verifies signature by calling the MOA SP component</li>
+ * <li>Returns the signer certificate</li>
+ * </ul>
+ *
+ * @param sessionID ID of associated authentication session data
+ * @param readInfoboxResponseParameters The parameters from the response returned from the BKU
+ * including the <code>&lt;ReadInfoboxResponse&gt;</code>
+ * @throws BKUException
+ */
+ public X509Certificate getCertificate(String sessionID,
+ Map<String, String> readInfoboxResponseParameters) throws AuthenticationException,
+ BuildException, ParseException, ConfigurationException,
+ ValidateException, ServiceException, BKUException {
+
+ if (isEmpty(sessionID))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID});
+
+ String xmlReadInfoboxResponse = (String) readInfoboxResponseParameters
+ .get(PARAM_XMLRESPONSE);
+
+ if (isEmpty(xmlReadInfoboxResponse))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_CERTIFICATE, PARAM_XMLRESPONSE});
+
+ // parses the <CreateXMLSignatureResponse>
+ InfoboxReadResponseParser p = new InfoboxReadResponseParser(
+ xmlReadInfoboxResponse);
+ X509Certificate cert = p.parseCertificate();
+
+ return cert;
+
+ }
+
+ /**
+ * Builds an authentication block <code>&lt;saml:Assertion&gt;</code> from
+ * given session data.
+ *
+ * @param session authentication session
+ * @return <code>&lt;saml:Assertion&gt;</code> as a String
+ * @throws BuildException If an error occurs on serializing an extended SAML attribute
+ * to be appended to the AUTH-Block.
+ */
+ private String buildAuthenticationBlock(AuthenticationSession session,
+ OAAuthParameter oaParam) throws BuildException {
+
+ IdentityLink identityLink = session.getIdentityLink();
+ String issuer = identityLink.getName();
+ String gebDat = identityLink.getDateOfBirth();
+
+ String identificationValue = null;
+ String identificationType = null;
+
+ //set empty AuthBlock BPK in case of OW or SSO or bpk is not requested
+ if (session.isOW() || session.isSsoRequested() || oaParam.isRemovePBKFromAuthBlock()) {
+ identificationType = "";
+ identificationValue = "";
+
+ } else if (identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
+
+ if (oaParam.getBusinessService()) {
+
+ String bpkBase64 = new BPKBuilder().buildWBPK(identityLink
+ .getIdentificationValue(), oaParam.getIdentityLinkDomainIdentifier());
+ identificationValue = bpkBase64;
+
+ if (oaParam.getIdentityLinkDomainIdentifier().startsWith(Constants.URN_PREFIX_WBPK + "+"))
+ identificationType = oaParam.getIdentityLinkDomainIdentifier();
+ else
+ identificationType = Constants.URN_PREFIX_WBPK + "+" + oaParam.getIdentityLinkDomainIdentifier();
+
+ } else {
+ String bpkBase64 = new BPKBuilder().buildBPK(identityLink
+ .getIdentificationValue(), session.getTarget());
+ identificationValue = bpkBase64;
+ identificationType = Constants.URN_PREFIX_CDID + "+" + session.getTarget();
+ }
+
+
+ } else {
+ identificationValue = identityLink.getIdentificationValue();
+ identificationType = identityLink.getIdentificationType();
+
+ }
+
+ String issueInstant = DateTimeUtils.buildDateTimeUTC(Calendar
+ .getInstance());
+ session.setIssueInstant(issueInstant);
+ String authURL = session.getAuthURL();
+ String target = session.getTarget();
+ String targetFriendlyName = session.getTargetFriendlyName();
+
+ // Bug #485
+ // (https://egovlabs.gv.at/tracker/index.php?func=detail&aid=485&group_id=6&atid=105)
+ // String oaURL = session.getPublicOAURLPrefix();
+
+ List<ExtendedSAMLAttribute> extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH();
+
+
+ if (session.isSsoRequested()) {
+ String oaURL = new String();
+ try {
+ oaURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix();
+
+ if (MiscUtil.isNotEmpty(oaURL))
+ oaURL = oaURL.replaceAll("&", "&amp;");
+
+ } catch (ConfigurationException e) {
+ }
+ String authBlock = new AuthenticationBlockAssertionBuilder()
+ .buildAuthBlockSSO(issuer, issueInstant, authURL, target,
+ targetFriendlyName, identificationValue,
+ identificationType, oaURL, gebDat,
+ extendedSAMLAttributes, session, oaParam);
+ return authBlock;
+
+ } else {
+ String oaURL = session.getPublicOAURLPrefix().replaceAll("&", "&amp;");
+ String authBlock = new AuthenticationBlockAssertionBuilder()
+ .buildAuthBlock(issuer, issueInstant, authURL, target,
+ targetFriendlyName, identificationValue,
+ identificationType, oaURL, gebDat,
+ extendedSAMLAttributes, session, oaParam);
+ return authBlock;
+ }
+ }
+
+
+ /**
+ * Verifies the infoboxes (except of the identity link infobox) returned by
+ * the BKU by calling appropriate validator classes.
+ *
+ * @param session The actual authentication session.
+ * @param mandate The Mandate from the MIS
+ * @throws AuthenticationException
+ * @throws ConfigurationException
+ * @throws TransformerException
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ */
+ private void validateExtendedSAMLAttributeForMandates(
+ AuthenticationSession session, MISMandate mandate,
+ boolean business)
+ throws ValidateException, ConfigurationException, SAXException,
+ IOException, ParserConfigurationException, TransformerException {
+
+ ExtendedSAMLAttribute[] extendedSAMLAttributes = addExtendedSamlAttributes(
+ mandate, business, false);
+
+ int length = extendedSAMLAttributes.length;
+ for (int i = 0; i < length; i++) {
+ ExtendedSAMLAttribute samlAttribute = extendedSAMLAttributes[i];
+
+ verifySAMLAttribute(samlAttribute, i, "MISService",
+ "MISService");
+
+ }
+ }
+
+ /**
+ * Verifies the infoboxes (except of the identity link infobox) returned by
+ * the BKU by calling appropriate validator classes.
+ *
+ * @param session The actual authentication session.
+ * @param mandate The Mandate from the MIS
+ * @throws AuthenticationException
+ * @throws ConfigurationException
+ * @throws TransformerException
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ */
+ private void setExtendedSAMLAttributeForMandatesOID(
+ AuthenticationSession session, MISMandate mandate, boolean business)
+ throws ValidateException, ConfigurationException, SAXException,
+ IOException, ParserConfigurationException, TransformerException {
+
+ ExtendedSAMLAttribute[] extendedSamlAttributes = addExtendedSamlAttributesOID(
+ mandate, business);
+
+ AddAdditionalSAMLAttributes(session, extendedSamlAttributes,
+ "MISService", "MISService");
+
+ }
+
+ /**
+ * Adds given SAML Attributes to the current session. They will be appended
+ * to the final SAML Assertion or the AUTH block. If the attributes are
+ * already in the list, they will be replaced.
+ *
+ * @param session The current session
+ * @param extendedSAMLAttributes The SAML attributes to add
+ * @param identifier The infobox identifier for debug purposes
+ * @param friendlyNam The friendly name of the infobox for debug purposes
+ */
+ private static void AddAdditionalSAMLAttributes(
+ AuthenticationSession session,
+ ExtendedSAMLAttribute[] extendedSAMLAttributes, String identifier,
+ String friendlyName) throws ValidateException {
+ if (extendedSAMLAttributes == null)
+ return;
+ List<ExtendedSAMLAttribute> oaAttributes = session.getExtendedSAMLAttributesOA();
+ if (oaAttributes == null)
+ oaAttributes = new Vector<ExtendedSAMLAttribute>();
+ List<ExtendedSAMLAttribute> authAttributes = session.getExtendedSAMLAttributesAUTH();
+ if (authAttributes == null)
+ authAttributes = new Vector<ExtendedSAMLAttribute>();
+ int length = extendedSAMLAttributes.length;
+ for (int i = 0; i < length; i++) {
+ ExtendedSAMLAttribute samlAttribute = extendedSAMLAttributes[i];
+
+ Object value = verifySAMLAttribute(samlAttribute, i, identifier,
+ friendlyName);
+
+ if ((value instanceof String) || (value instanceof Element)) {
+ switch (samlAttribute.getAddToAUTHBlock()) {
+ case ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY:
+ replaceExtendedSAMLAttribute(authAttributes, samlAttribute);
+ break;
+ case ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK:
+ replaceExtendedSAMLAttribute(authAttributes, samlAttribute);
+ replaceExtendedSAMLAttribute(oaAttributes, samlAttribute);
+ break;
+ case ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK:
+ replaceExtendedSAMLAttribute(oaAttributes, samlAttribute);
+ break;
+ default:
+ Logger
+ .info("Invalid return value from method \"getAddToAUTHBlock()\" ("
+ + samlAttribute.getAddToAUTHBlock()
+ + ") in SAML attribute number "
+ + (i + 1)
+ + " for infobox " + identifier);
+ throw new ValidateException("validator.47", new Object[]{
+ friendlyName, String.valueOf((i + 1))});
+ }
+ } else {
+ Logger
+ .info("The type of SAML-Attribute number "
+ + (i + 1)
+ + " returned from "
+ + identifier
+ + "-infobox validator is not valid. Must be either \"java.Lang.String\""
+ + " or \"org.w3c.dom.Element\"");
+ throw new ValidateException("validator.46", new Object[]{
+ identifier, String.valueOf((i + 1))});
+ }
+ }
+ session.setExtendedSAMLAttributesAUTH(authAttributes);
+ session.setExtendedSAMLAttributesOA(oaAttributes);
+ }
+
+ /**
+ * Adds the AUTH block related SAML attributes to the validation result.
+ * This is needed always before the AUTH block is to be signed, because the
+ * name of the mandator has to be set
+ *
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ * @throws TransformerException
+ */
+
+ protected static ExtendedSAMLAttribute[] addExtendedSamlAttributes(
+ MISMandate mandate, boolean business, boolean provideStammzahl)
+ throws SAXException, IOException, ParserConfigurationException,
+ TransformerException {
+ Vector<ExtendedSAMLAttribute> extendedSamlAttributes = new Vector<ExtendedSAMLAttribute>();
+
+ extendedSamlAttributes.clear();
+
+ // Name
+ Element domMandate = mandateToElement(mandate);
+ Element nameSpaceNode = domMandate.getOwnerDocument().createElement(
+ "NameSpaceNode");
+ nameSpaceNode.setAttribute("xmlns" + SZRGWConstants.PD_POSTFIX,
+ Constants.PD_NS_URI);
+ nameSpaceNode.setAttribute("xmlns" + SZRGWConstants.MANDATE_POSTFIX,
+ SZRGWConstants.MANDATE_NS);
+
+ Element mandator = (Element) XPathAPI.selectSingleNode(domMandate,
+ "//md:Mandate/md:Mandator", nameSpaceNode);
+
+ // Mandate
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_RAW, domMandate,
+ SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
+
+ // (w)bpk
+ String wbpk = ParepUtils.extractMandatorWbpk(mandator);
+ if (!ParepUtils.isEmpty(wbpk)) {
+ if (!ParepUtils.isPhysicalPerson(mandator)) {
+ String idType = ParepUtils
+ .extractMandatorIdentificationType(mandator);
+ if (!ParepUtils.isEmpty(idType)
+ && idType.startsWith(Constants.URN_PREFIX_BASEID)) {
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_CB_BASE_ID,
+ ParepUtils.getRegisterString(idType) + ": " + wbpk,
+ SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY));
+ }
+ } else if (business) {
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_WBPK, wbpk,
+ SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY));
+ }
+ }
+
+ ExtendedSAMLAttribute[] ret = new ExtendedSAMLAttribute[extendedSamlAttributes
+ .size()];
+ extendedSamlAttributes.copyInto(ret);
+ Logger.debug("ExtendedSAML Attributes: " + ret.length);
+ return ret;
+
+ }
+
+ /**
+ * Adds the AUTH block related SAML attributes to the validation result.
+ * This is needed always before the AUTH block is to be signed, because the
+ * name of the mandator has to be set
+ *
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ * @throws TransformerException
+ */
+ private static ExtendedSAMLAttribute[] addExtendedSamlAttributesOID(
+ MISMandate mandate, boolean business) throws SAXException,
+ IOException, ParserConfigurationException, TransformerException {
+
+ Vector<ExtendedSAMLAttribute> extendedSamlAttributes = new Vector<ExtendedSAMLAttribute>();
+
+ extendedSamlAttributes.clear();
+
+ // RepresentationType
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_REPRESENTATIONTYPE,
+ EXT_SAML_MANDATE_REPRESENTATIONTEXT,
+ SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
+
+ String oid = mandate.getProfRep();
+
+ if (oid != null) {
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_OID, oid,
+ SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
+ String oidDescription = mandate.getTextualDescriptionOfOID();
+ extendedSamlAttributes.add(new ExtendedSAMLAttributeImpl(
+ EXT_SAML_MANDATE_OIDTEXTUALDESCRIPTION,
+ oidDescription, SZRGWConstants.MANDATE_NS,
+ ExtendedSAMLAttribute.NOT_ADD_TO_AUTHBLOCK));
+
+ }
+
+ ExtendedSAMLAttribute[] ret = new ExtendedSAMLAttribute[extendedSamlAttributes
+ .size()];
+ extendedSamlAttributes.copyInto(ret);
+ Logger.debug("ExtendedSAML Attributes: " + ret.length);
+ return ret;
+
+ }
+
+ /**
+ * @param mandate
+ * @return
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ */
+ private static Element mandateToElement(MISMandate mandate)
+ throws SAXException, IOException, ParserConfigurationException {
+ ByteArrayInputStream bais = new ByteArrayInputStream(mandate
+ .getMandate());
+ Document doc = DOMUtils.parseDocumentSimple(bais);
+ return doc.getDocumentElement();
+ }
+
+ protected static void replaceExtendedSAMLAttribute(List<ExtendedSAMLAttribute> attributes,
+ ExtendedSAMLAttribute samlAttribute) {
+ if (null == attributes) {
+ attributes = new Vector<ExtendedSAMLAttribute>();
+ } else {
+ String id = samlAttribute.getName();
+ int length = attributes.size();
+ for (int i = 0; i < length; i++) {
+ ExtendedSAMLAttribute att = (ExtendedSAMLAttribute) attributes
+ .get(i);
+ if (id.equals(att.getName())) {
+ // replace attribute
+ attributes.set(i, samlAttribute);
+ return;
+ }
+ }
+ attributes.add(samlAttribute);
+ }
+ }
+
+ /**
+ * Processes a <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Parses <code>&lt;CreateXMLSignatureResponse&gt;</code> for error
+ * codes</li>
+ * <li>Parses authentication block enclosed in
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Verifies authentication block by calling the MOA SP component</li>
+ * <li>Creates authentication data</li>
+ * <li>Creates a corresponding SAML artifact</li>
+ * <li>Stores authentication data in the authentication data store indexed
+ * by the SAML artifact</li>
+ * <li>Deletes authentication session</li>
+ * <li>Returns the SAML artifact, encoded BASE64</li>
+ * </ul>
+ *
+ * @param sessionID session ID of the running authentication session
+ * @param xmlCreateXMLSignatureReadResponse String representation of the
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code>
+ * @return SAML artifact needed for retrieving authentication data, encoded
+ * BASE64
+ * @throws BKUException
+ */
+ public String verifyAuthenticationBlock(AuthenticationSession session,
+ String xmlCreateXMLSignatureReadResponse)
+ throws AuthenticationException, BuildException, ParseException,
+ ConfigurationException, ServiceException, ValidateException, BKUException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_AUTH_BLOCK, PARAM_SESSIONID});
+ if (isEmpty(xmlCreateXMLSignatureReadResponse))
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE});
+
+ AuthConfigurationProvider authConf = AuthConfigurationProvider
+ .getInstance();
+ // parses <CreateXMLSignatureResponse>
+ CreateXMLSignatureResponse csresp = new CreateXMLSignatureResponseParser(
+ xmlCreateXMLSignatureReadResponse).parseResponse();
+
+ try {
+ String serializedAssertion = DOMUtils.serializeNode(csresp
+ .getSamlAssertion());
+ session.setAuthBlock(serializedAssertion);
+ } catch (TransformerException e) {
+ throw new ParseException("parser.04", new Object[]{
+ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE});
+ } catch (IOException e) {
+ throw new ParseException("parser.04", new Object[]{
+ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE});
+ }
+ // validates <CreateXMLSignatureResponse>
+ if (session.isSsoRequested())
+ new CreateXMLSignatureResponseValidator().validateSSO(csresp, session);
+ else
+ new CreateXMLSignatureResponseValidator().validate(csresp, session);
+
+ // builds a <VerifyXMLSignatureRequest> for a MOA-SPSS call
+ List<String> vtids = authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs();
+ String tpid = authConf.getMoaSpAuthBlockTrustProfileID();
+ Element domVsreq = new VerifyXMLSignatureRequestBuilder().build(csresp,
+ vtids, tpid);
+ // debug output
+
+ // invokes the call
+ Element domVsresp = new SignatureVerificationInvoker()
+ .verifyXMLSignature(domVsreq);
+ // debug output
+
+ // parses the <VerifyXMLSignatureResponse>
+ VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponseParser(
+ domVsresp).parseData();
+
+ if (Logger.isTraceEnabled()) {
+ if (domVsresp != null) {
+ try {
+ String xmlVerifyXMLSignatureResponse = DOMUtils
+ .serializeNode(domVsresp, true);
+ Logger.trace(new LogMsg(xmlCreateXMLSignatureReadResponse));
+ Logger.trace(new LogMsg(xmlVerifyXMLSignatureResponse));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Logger.info(new LogMsg(t.getStackTrace()));
+ }
+ }
+ }
+
+ // validates the <VerifyXMLSignatureResponse>
+ VerifyXMLSignatureResponseValidator.getInstance().validate(vsresp,
+ null, VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK,
+ false);
+
+ // Compare AuthBlock Data with information stored in session, especially
+ // date and time
+ CreateXMLSignatureResponseValidator.getInstance().validateSigningDateTime(csresp);
+
+ // compares the public keys from the identityLink with the AuthBlock
+ VerifyXMLSignatureResponseValidator.getInstance().validateCertificate(
+ vsresp, session.getIdentityLink());
+
+ // post processing of the infoboxes
+ Iterator iter = session.getInfoboxValidatorIterator();
+ boolean formpending = false;
+ if (iter != null) {
+ while (!formpending && iter.hasNext()) {
+ Vector infoboxValidatorVector = (Vector) iter.next();
+ String identifier = (String) infoboxValidatorVector.get(0);
+ String friendlyName = (String) infoboxValidatorVector.get(1);
+ InfoboxValidator infoboxvalidator = (InfoboxValidator) infoboxValidatorVector
+ .get(2);
+ InfoboxValidationResult infoboxValidationResult = null;
+ try {
+ infoboxValidationResult = infoboxvalidator.validate(csresp
+ .getSamlAssertion());
+ } catch (ValidateException e) {
+ Logger.error("Error validating " + identifier + " infobox:"
+ + e.getMessage());
+ throw new ValidateException("validator.44",
+ new Object[]{friendlyName});
+ }
+ if (!infoboxValidationResult.isValid()) {
+ Logger.info("Validation of " + identifier
+ + " infobox failed.");
+ throw new ValidateException("validator.40", new Object[]{
+ friendlyName,
+ infoboxValidationResult.getErrorMessage()});
+ }
+ String form = infoboxvalidator.getForm();
+ if (ParepUtils.isEmpty(form)) {
+ AddAdditionalSAMLAttributes(
+ session,
+ infoboxValidationResult.getExtendedSamlAttributes(),
+ identifier, friendlyName);
+ } else {
+ return "Redirect to Input Processor";
+ }
+ }
+ }
+
+ session.setXMLVerifySignatureResponse(vsresp);
+ session.setSignerCertificate(vsresp.getX509certificate());
+ vsresp.setX509certificate(null);
+ session.setForeigner(false);
+
+ if (session.getUseMandate()) {
+ // mandate mode
+ return null;
+
+ } else {
+
+ session.setAuthenticatedUsed(false);
+ session.setAuthenticated(true);
+
+ //set QAA Level four in case of card authentifcation
+ session.setQAALevel(PVPConstants.STORK_QAA_1_4);
+
+
+ String oldsessionID = session.getSessionID();
+
+ //Session is implicte stored in changeSessionID!!!
+ String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(session);
+
+ Logger.info("Changed MOASession " + oldsessionID + " to Session " + newMOASessionID);
+ Logger.info("Daten angelegt zu MOASession " + newMOASessionID);
+
+ return newMOASessionID;
+ }
+ }
+
+ /**
+ * Processes a <code>&lt;CreateXMLSignatureResponse&gt;</code> sent by the
+ * security layer implementation.<br>
+ * <ul>
+ * <li>Validates given <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Parses <code>&lt;CreateXMLSignatureResponse&gt;</code> for error
+ * codes</li>
+ * <li>Parses authentication block enclosed in
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code></li>
+ * <li>Verifies authentication block by calling the MOA SP component</li>
+ * <li>Creates authentication data</li>
+ * <li>Creates a corresponding SAML artifact</li>
+ * <li>Stores authentication data in the authentication data store indexed
+ * by the SAML artifact</li>
+ * <li>Deletes authentication session</li>
+ * <li>Returns the SAML artifact, encoded BASE64</li>
+ * </ul>
+ *
+ * @param sessionID session ID of the running authentication session
+ * @param xmlCreateXMLSignatureReadResponse String representation of the
+ * <code>&lt;CreateXMLSignatureResponse&gt;</code>
+ * @return SAML artifact needed for retrieving authentication data, encoded
+ * BASE64
+ */
+
+ protected Element createIdentificationBPK(Element mandatePerson,
+ String baseid, String target) throws BuildException {
+ Element identificationBpK = mandatePerson.getOwnerDocument()
+ .createElementNS(Constants.PD_NS_URI, "Identification");
+ Element valueBpK = mandatePerson.getOwnerDocument().createElementNS(
+ Constants.PD_NS_URI, "Value");
+
+ String bpkBase64 = new BPKBuilder().buildBPK(baseid, target);
+ valueBpK.appendChild(mandatePerson.getOwnerDocument().createTextNode(
+ bpkBase64));
+ Element typeBpK = mandatePerson.getOwnerDocument().createElementNS(
+ Constants.PD_NS_URI, "Type");
+ typeBpK.appendChild(mandatePerson.getOwnerDocument().createTextNode(
+ "urn:publicid:gv.at:cdid+bpk"));
+ identificationBpK.appendChild(valueBpK);
+ identificationBpK.appendChild(typeBpK);
+
+ return identificationBpK;
+
+ }
+
+ protected String getBaseId(Element mandatePerson)
+ throws TransformerException, IOException {
+ NodeList list = mandatePerson.getElementsByTagNameNS(
+ Constants.PD_NS_URI, "Identification");
+ for (int i = 0; i < list.getLength(); i++) {
+ Element identification = (Element) list.item(i);
+ Element type = (Element) identification.getElementsByTagNameNS(
+ Constants.PD_NS_URI, "Type").item(0);
+ if (type.getTextContent().compareToIgnoreCase(
+ "urn:publicid:gv.at:baseid") == 0) {
+ Element value = (Element) identification
+ .getElementsByTagNameNS(Constants.PD_NS_URI, "Value")
+ .item(0);
+ return value.getTextContent();
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Gets the foreign authentication data.<br>
+ * <ul>
+ * <li>Creates authentication data</li>
+ * <li>Creates a corresponding SAML artifact</li>
+ * <li>Stores authentication data in the authentication data store indexed
+ * by the SAML artifact</li>
+ * <li>Deletes authentication session</li>
+ * <li>Returns the SAML artifact, encoded BASE64</li>
+ * </ul>
+ *
+ * @param sessionID session ID of the running authentication session
+ * @return SAML artifact needed for retrieving authentication data, encoded
+ * BASE64
+ */
+ public String getForeignAuthenticationData(AuthenticationSession session)
+ throws AuthenticationException, BuildException, ParseException,
+ ConfigurationException, ServiceException, ValidateException {
+
+ if (session == null)
+ throw new AuthenticationException("auth.10", new Object[]{
+ REQ_VERIFY_AUTH_BLOCK, PARAM_SESSIONID});
+
+ // post processing of the infoboxes
+ Iterator iter = session.getInfoboxValidatorIterator();
+ boolean formpending = false;
+ if (iter != null) {
+ while (!formpending && iter.hasNext()) {
+ Vector infoboxValidatorVector = (Vector) iter.next();
+ String identifier = (String) infoboxValidatorVector.get(0);
+ String friendlyName = (String) infoboxValidatorVector.get(1);
+ InfoboxValidator infoboxvalidator = (InfoboxValidator) infoboxValidatorVector
+ .get(2);
+ InfoboxValidationResult infoboxValidationResult = null;
+ try {
+ infoboxValidationResult = infoboxvalidator.validate(session
+ .getIdentityLink().getSamlAssertion());
+ } catch (ValidateException e) {
+ Logger.error("Error validating " + identifier + " infobox:"
+ + e.getMessage());
+ throw new ValidateException("validator.44",
+ new Object[]{friendlyName});
+ }
+ if (!infoboxValidationResult.isValid()) {
+ Logger.info("Validation of " + identifier
+ + " infobox failed.");
+ throw new ValidateException("validator.40", new Object[]{
+ friendlyName,
+ infoboxValidationResult.getErrorMessage()});
+ }
+ String form = infoboxvalidator.getForm();
+ if (ParepUtils.isEmpty(form)) {
+ AddAdditionalSAMLAttributes(
+ session,
+ infoboxValidationResult.getExtendedSamlAttributes(),
+ identifier, friendlyName);
+ } else {
+ return "Redirect to Input Processor";
+ }
+ }
+ }
+
+ VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponse();
+ X509Certificate cert = session.getSignerCertificate();
+ vsresp.setX509certificate(cert);
+
+ session.setAuthenticatedUsed(false);
+ session.setAuthenticated(true);
+
+
+ session.setXMLVerifySignatureResponse(vsresp);
+ session.setSignerCertificate(vsresp.getX509certificate());
+ vsresp.setX509certificate(null);
+ session.setForeigner(true);
+
+ //TODO: regenerate MOASession ID!
+ return "new Session";
+ }
+
+ /**
+ * Builds the AuthenticationData object together with the corresponding
+ * <code>&lt;saml:Assertion&gt;</code>
+ *
+ * @param session authentication session
+ * @param verifyXMLSigResp VerifyXMLSignatureResponse from MOA-SP
+ * @param useUTC uses correct UTC time format
+ * @param useUTC indicates that authenticated citizen is a foreigner
+ * @param isForeigner indicates whether Austrian (false) or foreigner (true) authenticates
+ * @return AuthenticationData object
+ * @throws ConfigurationException while accessing configuration data
+ * @throws BuildException while building the <code>&lt;saml:Assertion&gt;</code>
+ */
+ public static AuthenticationData buildAuthenticationData(
+ AuthenticationSession session, OAAuthParameter oaParam, String target)
+ throws ConfigurationException, BuildException {
IdentityLink identityLink = session.getIdentityLink();
AuthenticationData authData = new AuthenticationData();
@@ -1503,276 +1468,202 @@ public class AuthenticationServer implements MOAIDAuthConstants {
try {
- if (session.getUseMandate() && session.isOW()) {
- MISMandate mandate = session.getMISMandate();
+ MISMandate mandate = session.getMISMandate();
+
+ if (session.getUseMandate() && session.isOW()
+ && mandate != null && MiscUtil.isNotEmpty(mandate.getOWbPK())) {
authData.setBPK(mandate.getOWbPK());
authData.setBPKType(Constants.URN_PREFIX_CDID + "+" + "OW");
authData.setIdentityLink(identityLink);
-
Logger.trace("Authenticated User is OW: " + mandate.getOWbPK());
- } else {
-
- if (businessService) {
- //since we have foreigner, wbPK is not calculated in BKU
- if(identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
-
- String registerAndOrdNr = oaParam.getIdentityLinkDomainIdentifier();
-
- if (registerAndOrdNr.startsWith(AuthenticationSession.REGISTERANDORDNR_PREFIX_)) {
- // If domainIdentifier starts with prefix
- // "urn:publicid:gv.at:wbpk+"; remove this prefix
- registerAndOrdNr = registerAndOrdNr
- .substring(AuthenticationSession.REGISTERANDORDNR_PREFIX_.length());
- Logger.debug("Register and ordernumber prefix stripped off; resulting register string: "
- + registerAndOrdNr);
- }
-
- String wbpkBase64 = new BPKBuilder().buildWBPK(identityLink.getIdentificationValue(), registerAndOrdNr);
- authData.setBPK(wbpkBase64);
- authData.setBPKType( Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr);
-
- } else {
- authData.setBPK(identityLink.getIdentificationValue());
- authData.setBPKType(identityLink.getIdentificationType());
-
- }
-
- Logger.trace("Authenticate user with wbPK " + authData.getBPK());
-
- Element idlassertion = session.getIdentityLink().getSamlAssertion();
- //set bpk/wpbk;
- Node prIdentification = XPathUtils.selectSingleNode(idlassertion, IdentityLinkAssertionParser.PERSON_IDENT_VALUE_XPATH);
- prIdentification.getFirstChild().setNodeValue(authData.getBPK());
- //set bkp/wpbk type
- Node prIdentificationType = XPathUtils.selectSingleNode(idlassertion, IdentityLinkAssertionParser.PERSON_IDENT_TYPE_XPATH);
- prIdentificationType.getFirstChild().setNodeValue(authData.getBPKType());
-
- IdentityLinkAssertionParser idlparser = new IdentityLinkAssertionParser(idlassertion);
- IdentityLink idl = idlparser.parseIdentityLink();
- authData.setIdentityLink(idl);
-
- } else {
-
- if(identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
- // only compute bPK if online application is a public service and we have the Stammzahl
- String bpkBase64 = new BPKBuilder().buildBPK(identityLink.getIdentificationValue(), target);
- authData.setBPK(bpkBase64);
- authData.setBPKType(Constants.URN_PREFIX_CDID + "+" + oaParam.getTarget());
- }
-
- Logger.trace("Authenticate user with bPK " + authData.getBPK());
-
- authData.setIdentityLink(identityLink);
- }
- }
-
- return authData;
-
- } catch (Throwable ex) {
- throw new BuildException("builder.00", new Object[] {
- "AuthenticationData", ex.toString() }, ex);
- }
- }
-
- /**
- * Retrieves a session from the session store.
- *
- * @param id
- * session ID
- * @return <code>AuthenticationSession</code> stored with given session ID,
- * <code>null</code> if session ID unknown
- */
- public static AuthenticationSession getSession(String id)
- throws AuthenticationException {
-
- AuthenticationSession session;
- try {
- session = AuthenticationSessionStoreage.getSession(id);
-
- if (session == null)
- throw new AuthenticationException("auth.02", new Object[] { id });
- return session;
-
- } catch (MOADatabaseException e) {
- throw new AuthenticationException("parser.04", new Object[] { id });
- }
- }
-
- /**
- * Cleans up expired session and authentication data stores.
- */
- public void cleanup() {
- long now = new Date().getTime();
-
- //clean AuthenticationSessionStore
-
- AuthenticationSessionStoreage.clean(now, sessionTimeOutCreated, sessionTimeOutUpdated);
+ } else {
- //clean AssertionStore
- AssertionStorage assertionstore = AssertionStorage.getInstance();
- assertionstore.clean(now, authDataTimeOut);
+ if (businessService) {
+ //since we have foreigner, wbPK is not calculated in BKU
+ if (identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
- //clean ExeptionStore
- DBExceptionStoreImpl exstore = DBExceptionStoreImpl.getStore();
- exstore.clean(now, authDataTimeOut);
-
- }
-
- /**
- * Sets the sessionTimeOut.
- *
- * @param seconds
- * Time out of the session in seconds
- */
- public void setSecondsSessionTimeOutCreated(long seconds) {
- sessionTimeOutCreated = seconds * 1000;
- }
-
- public void setSecondsSessionTimeOutUpdated(long seconds) {
- sessionTimeOutUpdated = seconds * 1000;
- }
-
- /**
- * Sets the authDataTimeOut.
- *
- * @param seconds
- * Time out for signing AuthData in seconds
- */
- public void setSecondsAuthDataTimeOut(long seconds) {
- authDataTimeOut = seconds * 1000;
- }
-
- /**
- * Checks a parameter.
- *
- * @param param
- * parameter
- * @return true if the parameter is null or empty
- */
- private boolean isEmpty(String param) {
- return param == null || param.length() == 0;
- }
-
- /**
- * Checks the correctness of SAML attributes and returns its value.
- *
- * @param param
- * samlAttribute
- * @param i
- * the number of the verified attribute for messages
- * @param identifier
- * the infobox identifier for messages
- * @param friendlyname
- * the friendly name of the infobox for messages
- * @return the SAML attribute value (Element or String)
- */
- protected static Object verifySAMLAttribute(
- ExtendedSAMLAttribute samlAttribute, int i, String identifier,
- String friendlyName) throws ValidateException {
- String name = samlAttribute.getName();
-
- if (name == null) {
- Logger.info("The name of SAML-Attribute number " + (i + 1)
- + " returned from " + identifier
- + "-infobox validator is null.");
- throw new ValidateException("validator.45", new Object[] {
- friendlyName, "Name", String.valueOf((i + 1)), "null" });
- }
- if (name == "") {
- Logger.info("The name of SAML-Attribute number " + (i + 1)
- + " returned from " + identifier
- + "-infobox validator is empty.");
- throw new ValidateException("validator.45", new Object[] {
- friendlyName, "Name", String.valueOf((i + 1)), "leer" });
- }
- if (samlAttribute.getNameSpace() == null) {
- Logger.info("The namespace of SAML-Attribute number " + (i + 1)
- + " returned from " + identifier
- + "-infobox validator is null.");
- throw new ValidateException("validator.45",
- new Object[] { friendlyName, "Namespace",
- String.valueOf((i + 1)), "null" });
- }
- Object value = samlAttribute.getValue();
- if (value == null) {
- Logger.info("The value of SAML-Attribute number " + (i + 1)
- + " returned from " + identifier
- + "-infobox validator is null.");
- throw new ValidateException("validator.45", new Object[] {
- friendlyName, "Wert", String.valueOf((i + 1)), "null" });
- }
-
- return value;
- }
-
- /**
- * Does the request to the SZR-GW
- * @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, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException {
-
- try {
- AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance();
- ConnectionParameter connectionParameters = authConf.getForeignIDConnectionParameter();
-
- SZRGWClient client = new SZRGWClient(connectionParameters);
-
-
- CreateIdentityLinkRequest request = new CreateIdentityLinkRequest();
- request.setSignature(citizenSignature.getBytes());
-
- PEPSData data = new PEPSData();
- data.setDateOfBirth(PEPSDateOfBirth);
- data.setFamilyname(PEPSFamilyname);
- data.setFirstname(PEPSFirstname);
- data.setIdentifier(PEPSIdentifier);
-
- data.setRepresentative(representative);
- data.setRepresented(represented);
- data.setMandateContent(mandateContent);
-
- data.setLegalPersonCanonicalRegisteredAddress(organizationAddress);
- data.setLegalPersonTranslatableType(organizationType);
-
- if(null != mandateContent) {
- MISType mis = new MISType();
-
- Target targetObject = new Target();
- targetObject.setType(targetType);
- targetObject.setValue(targetValue);
- 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());
- return response;
-
- }
- catch (ConfigurationException e) {
- Logger.warn(e);
- Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", null ));
- }
-
- return null;
-
- }
+ String registerAndOrdNr = oaParam.getIdentityLinkDomainIdentifier();
+ if (registerAndOrdNr.startsWith(AuthenticationSession.REGISTERANDORDNR_PREFIX_)) {
+ // If domainIdentifier starts with prefix
+ // "urn:publicid:gv.at:wbpk+"; remove this prefix
+ registerAndOrdNr = registerAndOrdNr
+ .substring(AuthenticationSession.REGISTERANDORDNR_PREFIX_.length());
+ Logger.debug("Register and ordernumber prefix stripped off; resulting register string: "
+ + registerAndOrdNr);
+ }
+
+ String wbpkBase64 = new BPKBuilder().buildWBPK(identityLink.getIdentificationValue(), registerAndOrdNr);
+ authData.setBPK(wbpkBase64);
+ authData.setBPKType(Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr);
+
+ } else {
+ authData.setBPK(identityLink.getIdentificationValue());
+ authData.setBPKType(identityLink.getIdentificationType());
+
+ }
+
+ Logger.trace("Authenticate user with wbPK " + authData.getBPK());
+
+ Element idlassertion = session.getIdentityLink().getSamlAssertion();
+ //set bpk/wpbk;
+ Node prIdentification = XPathUtils.selectSingleNode(idlassertion, IdentityLinkAssertionParser.PERSON_IDENT_VALUE_XPATH);
+ prIdentification.getFirstChild().setNodeValue(authData.getBPK());
+ //set bkp/wpbk type
+ Node prIdentificationType = XPathUtils.selectSingleNode(idlassertion, IdentityLinkAssertionParser.PERSON_IDENT_TYPE_XPATH);
+ prIdentificationType.getFirstChild().setNodeValue(authData.getBPKType());
+
+ IdentityLinkAssertionParser idlparser = new IdentityLinkAssertionParser(idlassertion);
+ IdentityLink idl = idlparser.parseIdentityLink();
+ authData.setIdentityLink(idl);
+
+ } else {
+
+ if (identityLink.getIdentificationType().equals(Constants.URN_PREFIX_BASEID)) {
+ // only compute bPK if online application is a public service and we have the Stammzahl
+ String bpkBase64 = new BPKBuilder().buildBPK(identityLink.getIdentificationValue(), target);
+ authData.setBPK(bpkBase64);
+ authData.setBPKType(Constants.URN_PREFIX_CDID + "+" + oaParam.getTarget());
+ }
+
+ Logger.trace("Authenticate user with bPK " + authData.getBPK());
+
+ authData.setIdentityLink(identityLink);
+ }
+ }
+
+ return authData;
+
+ } catch (Throwable ex) {
+ throw new BuildException("builder.00", new Object[]{
+ "AuthenticationData", ex.toString()}, ex);
+ }
+ }
+
+ /**
+ * Retrieves a session from the session store.
+ *
+ * @param id session ID
+ * @return <code>AuthenticationSession</code> stored with given session ID,
+ * <code>null</code> if session ID unknown
+ */
+ public static AuthenticationSession getSession(String id)
+ throws AuthenticationException {
+
+ AuthenticationSession session;
+ try {
+ session = AuthenticationSessionStoreage.getSession(id);
+
+ if (session == null)
+ throw new AuthenticationException("auth.02", new Object[]{id});
+ return session;
+
+ } catch (MOADatabaseException e) {
+ throw new AuthenticationException("parser.04", new Object[]{id});
+ }
+ }
+
+ /**
+ * Cleans up expired session and authentication data stores.
+ */
+ public void cleanup() {
+ long now = new Date().getTime();
+
+ //clean AuthenticationSessionStore
+
+ AuthenticationSessionStoreage.clean(now, sessionTimeOutCreated, sessionTimeOutUpdated);
+
+ //clean AssertionStore
+ AssertionStorage assertionstore = AssertionStorage.getInstance();
+ assertionstore.clean(now, authDataTimeOut);
+
+ //clean ExeptionStore
+ DBExceptionStoreImpl exstore = DBExceptionStoreImpl.getStore();
+ exstore.clean(now, authDataTimeOut);
+
+ }
+
+ /**
+ * Sets the sessionTimeOut.
+ *
+ * @param seconds Time out of the session in seconds
+ */
+ public void setSecondsSessionTimeOutCreated(long seconds) {
+ sessionTimeOutCreated = seconds * 1000;
+ }
+
+ public void setSecondsSessionTimeOutUpdated(long seconds) {
+ sessionTimeOutUpdated = seconds * 1000;
+ }
+
+ /**
+ * Sets the authDataTimeOut.
+ *
+ * @param seconds Time out for signing AuthData in seconds
+ */
+ public void setSecondsAuthDataTimeOut(long seconds) {
+ authDataTimeOut = seconds * 1000;
+ }
+
+ /**
+ * Checks a parameter.
+ *
+ * @param param parameter
+ * @return true if the parameter is null or empty
+ */
+ private boolean isEmpty(String param) {
+ return param == null || param.length() == 0;
+ }
+
+ /**
+ * Checks the correctness of SAML attributes and returns its value.
+ *
+ * @param param samlAttribute
+ * @param i the number of the verified attribute for messages
+ * @param identifier the infobox identifier for messages
+ * @param friendlyname the friendly name of the infobox for messages
+ * @return the SAML attribute value (Element or String)
+ */
+ protected static Object verifySAMLAttribute(
+ ExtendedSAMLAttribute samlAttribute, int i, String identifier,
+ String friendlyName) throws ValidateException {
+ String name = samlAttribute.getName();
+
+ if (name == null) {
+ Logger.info("The name of SAML-Attribute number " + (i + 1)
+ + " returned from " + identifier
+ + "-infobox validator is null.");
+ throw new ValidateException("validator.45", new Object[]{
+ friendlyName, "Name", String.valueOf((i + 1)), "null"});
+ }
+ if (name == "") {
+ Logger.info("The name of SAML-Attribute number " + (i + 1)
+ + " returned from " + identifier
+ + "-infobox validator is empty.");
+ throw new ValidateException("validator.45", new Object[]{
+ friendlyName, "Name", String.valueOf((i + 1)), "leer"});
+ }
+ if (samlAttribute.getNameSpace() == null) {
+ Logger.info("The namespace of SAML-Attribute number " + (i + 1)
+ + " returned from " + identifier
+ + "-infobox validator is null.");
+ throw new ValidateException("validator.45",
+ new Object[]{friendlyName, "Namespace",
+ String.valueOf((i + 1)), "null"});
+ }
+ Object value = samlAttribute.getValue();
+ if (value == null) {
+ Logger.info("The value of SAML-Attribute number " + (i + 1)
+ + " returned from " + identifier
+ + "-infobox validator is null.");
+ throw new ValidateException("validator.45", new Object[]{
+ friendlyName, "Wert", String.valueOf((i + 1)), "null"});
+ }
+
+ return value;
+ }
+
/**
* Does the request to the SZR-GW.
*
@@ -1782,9 +1673,9 @@ 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));
+ return getIdentityLink(null, null, null, null, XMLHelper.nodeToString(signature), null);
}
-
+
/**
* Does the request to the SZR-GW.
*
@@ -1797,28 +1688,8 @@ public class AuthenticationServer implements MOAIDAuthConstants {
* @throws SZRGWClientException the sZRGW client exception
* @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, null, 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, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException {
- return getIdentityLink(null, null, null, null, null,
- citizenSignature, represented, representative, mandateContent, organizationAddress,
- organizationType, targetType, targetValue, oaFriendlyName, filters);
+ public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature, String PEPSFiscalNumber) throws SZRGWClientException {
+ return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, null, signature, null, null, null, null, null, null, null, PEPSFiscalNumber);
}
/**
@@ -1838,251 +1709,331 @@ 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 targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException {
+ String mandate, String targetType, String targetValue, String oaFriendlyName, List<String> filters, String PEPSFiscalNumber) throws SZRGWClientException {
return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender,
citizenSignature, representative, represented, mandate, null,
- null, targetType, targetValue, oaFriendlyName, filters);
+ null, targetType, targetValue, oaFriendlyName, filters, PEPSFiscalNumber);
}
+
+ /**
+ * 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, String targetType, String targetValue, String oaFriendlyName, List<String> filters, String PEPSFiscalNumber) throws SZRGWClientException {
+ return getIdentityLink(null, null, null, null, null,
+ citizenSignature, represented, representative, mandateContent, organizationAddress,
+ organizationType, targetType, targetValue, oaFriendlyName, filters, PEPSFiscalNumber);
+ }
+
+ 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, List<String> filters, String PEPSFiscalNumber) throws SZRGWClientException {
- /**
- * Starts a MOA-ID authentication process using STORK
- * @param req HttpServletRequest
- * @param resp HttpServletResponse
- * @param ccc Citizen country code
- * @param oaURL URL of the online application
- * @param target Target parameter
- * @param targetFriendlyName Friendly Name of Target
- * @param authURL Authentication URL
- * @param sourceID SourceID parameter
- * @throws MOAIDException
- * @throws AuthenticationException
- * @throws WrongParametersException
- * @throws ConfigurationException
- */
- public static void startSTORKAuthentication(
- HttpServletRequest req,
- HttpServletResponse resp,
- AuthenticationSession moasession) throws MOAIDException, AuthenticationException, WrongParametersException, ConfigurationException {
-
- if (moasession == null) {
- throw new AuthenticationException("auth.18", new Object[] { });
- }
-
- //read configuration paramters of OA
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix());
- if (oaParam == null)
- throw new AuthenticationException("auth.00", new Object[] { moasession.getPublicOAURLPrefix() });
-
- //Start of STORK Processing
- STORKConfig storkConfig = AuthConfigurationProvider.getInstance().getStorkConfig();
-
- CPEPS cpeps = storkConfig.getCPEPS(moasession.getCcc());
-
- Logger.debug("Preparing to assemble STORK AuthnRequest witt the following values:");
- String destination = cpeps.getPepsURL().toExternalForm();
- Logger.debug("C-PEPS URL: " + destination);
-
- String issuerValue = AuthConfigurationProvider.getInstance().getPublicURLPrefix();
- String providerName= oaParam.getFriendlyName();
- Logger.debug("Issuer value: " + issuerValue);
-
- String acsURL = issuerValue + PEPSConnectorServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN;
- Logger.debug("MOA Assertion Consumer URL (PEPSConnctor): " + acsURL);
-
- // prepare collection of required attributes
- // - attributes for online application
- List<OAStorkAttribute> attributesFromConfig = oaParam.getRequestedAttributes();
-
- // - prepare attribute list
- PersonalAttributeList attributeList = new PersonalAttributeList();
-
- // - fill container
- for(OAStorkAttribute current : attributesFromConfig) {
- PersonalAttribute newAttribute = new PersonalAttribute();
- newAttribute.setName(current.getName());
-
- boolean globallyMandatory = false;
- for(StorkAttribute currentGlobalAttribute : storkConfig.getStorkAttributes())
- if(current.getName().equals(currentGlobalAttribute.getName())) {
- globallyMandatory = currentGlobalAttribute.isMandatory();
- break;
- }
-
- newAttribute.setIsRequired(current.isMandatory() || globallyMandatory);
- attributeList.add(newAttribute);
- }
-
- // add sign request
- PersonalAttribute newAttribute = new PersonalAttribute();
- newAttribute.setName("signedDoc");
- List<String> value = new ArrayList<String>();
- 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);
-
-
- if (Logger.isDebugEnabled()) {
- Logger.debug("The following attributes are requested for this OA:");
- for (OAStorkAttribute logReqAttr : attributesFromConfig)
- Logger.debug("OA specific requested attribute: " + logReqAttr.getName() + ", isRequired: " + logReqAttr.isMandatory());
- }
-
- //TODO: check Target in case of SSO!!
- String spSector = StringUtils.isEmpty(moasession.getTarget()) ? "Business" : moasession.getTarget();
- String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName();
- String spApplication = spInstitution;
- String spCountry = "AT";
-
- //generate AuthnRquest
- STORKAuthnRequest authnRequest = new STORKAuthnRequest();
- authnRequest.setDestination(destination);
- authnRequest.setAssertionConsumerServiceURL(acsURL);
- authnRequest.setProviderName(providerName);
- authnRequest.setIssuer(issuerValue);
- authnRequest.setQaa(oaParam.getQaaLevel());
- authnRequest.setSpInstitution(spInstitution);
- authnRequest.setCountry(spCountry);
- authnRequest.setSpApplication(spApplication);
- authnRequest.setSpSector(spSector);
- authnRequest.setPersonalAttributeList(attributeList);
-
- authnRequest.setEIDCrossBorderShare(true);
- authnRequest.setEIDCrossSectorShare(true);
- authnRequest.setEIDSectorShare(true);
-
- authnRequest.setCitizenCountryCode(moasession.getCcc());
-
-
- Logger.debug("STORK AuthnRequest succesfully assembled.");
-
- STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing");
- try {
- authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest);
- } catch (STORKSAMLEngineException e) {
- Logger.error("Could not sign STORK SAML AuthnRequest.", e);
- throw new MOAIDException("stork.00", null);
- }
-
- Logger.info("STORK AuthnRequest successfully signed!");
-
- //validate AuthnRequest
- try {
- samlEngine.validateSTORKAuthnRequest(authnRequest.getTokenSaml());
- } catch (STORKSAMLEngineException e) {
- Logger.error("STORK SAML AuthnRequest not valid.", e);
- throw new MOAIDException("stork.01", null);
- }
-
- Logger.debug("STORK AuthnRequest successfully internally validated.");
-
- //send
- moasession.setStorkAuthnRequest(authnRequest);
- HttpSession httpSession = req.getSession();
- httpSession.setAttribute("MOA-Session-ID", moasession.getSessionID());
-
-
- Logger.info("Preparing to send STORK AuthnRequest.");
- Logger.info("prepared STORKAuthnRequest: ");
- Logger.info(new String(authnRequest.getTokenSaml()));
-
- try {
- Logger.trace("Initialize VelocityEngine...");
-
- VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
- 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);
-
- StringWriter writer = new StringWriter();
- template.merge(context, writer);
-
- resp.getOutputStream().write(writer.toString().getBytes());
- } catch (Exception e) {
- Logger.error("Error sending STORK SAML AuthnRequest.", e);
- httpSession.invalidate();
- throw new MOAIDException("stork.02", new Object[] { destination });
- }
-
- Logger.info("STORK AuthnRequest successfully successfully prepared for client with target location: " + authnRequest.getDestination());
- }
-
- private static String generateDssSignRequest(String text, String mimeType, String citizenCountry) {
- IdentifierGenerator idGenerator;
- try {
- idGenerator = new SecureRandomIdentifierGenerator();
-
- DocumentType doc = new DocumentType();
- doc.setBase64XML(text.getBytes());
- doc.setID(idGenerator.generateIdentifier());
-
- SignRequest request = new SignRequest();
- request.setInputDocuments(ApiUtils.createInputDocuments(doc));
-
- String id = idGenerator.generateIdentifier();
- request.setRequestID(id);
- request.setDocUI(id);
-
- 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);
- } 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 (IOException e) {
- Logger.error("Could not create SignRequest", e);
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Extracts an X509 Certificate out of an XML signagture element
- * @param signedXML XML signature element
- * @return X509Certificate
- * @throws CertificateException
- */
- public static X509Certificate getCertificateFromXML(Element signedXML) throws CertificateException {
-
- NodeList nList = signedXML.getElementsByTagNameNS(Constants.DSIG_NS_URI, "X509Certificate");
-
- String base64CertString = XMLUtil.getFirstTextValueFromNodeList(nList);
-
- if (StringUtils.isEmpty(base64CertString)) {
- String msg = "XML does not contain a X509Certificate element.";
- Logger.error(msg);
- throw new CertificateException(msg);
- }
-
- InputStream is = new ByteArrayInputStream(Base64.decode(base64CertString));
-
- X509Certificate cert;
try {
- cert = new X509Certificate(is);
- return cert;
+ AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance();
+ ConnectionParameter connectionParameters = authConf.getForeignIDConnectionParameter();
- } catch (Throwable e) {
- throw new CertificateException(e);
+ SZRGWClient client = new SZRGWClient(connectionParameters);
+
+ CreateIdentityLinkRequest request = new CreateIdentityLinkRequest();
+ request.setSignature(citizenSignature.getBytes());
+
+ PEPSData data = new PEPSData();
+ data.setDateOfBirth(PEPSDateOfBirth);
+ data.setFamilyname(PEPSFamilyname);
+ data.setFirstname(PEPSFirstname);
+ data.setIdentifier(PEPSIdentifier);
+
+ data.setRepresentative(representative);
+ data.setRepresented(represented);
+ data.setMandateContent(mandateContent);
+
+ data.setLegalPersonCanonicalRegisteredAddress(organizationAddress);
+ data.setLegalPersonTranslatableType(organizationType);
+
+ if (null != mandateContent) {
+ MISType mis = new MISType();
+
+ Target targetObject = new Target();
+ targetObject.setType(targetType);
+ targetObject.setValue(targetValue);
+ mis.setTarget(targetObject);
+
+ mis.setOAFriendlyName(oaFriendlyName);
+
+ Filters filterObject = new Filters();
+ MandateIdentifiers mandateIds = new MandateIdentifiers();
+ for(String current : filters)
+ 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());
+ return response;
+
+ }
+ catch (ConfigurationException e) {
+ Logger.warn(e);
+ Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", null ));
}
- }
+
+ return null;
+
+ }
+
+ /**
+ * Starts a MOA-ID authentication process using STORK
+ *
+ * @param req HttpServletRequest
+ * @param resp HttpServletResponse
+ * @param ccc Citizen country code
+ * @param oaURL URL of the online application
+ * @param target Target parameter
+ * @param targetFriendlyName Friendly Name of Target
+ * @param authURL Authentication URL
+ * @param sourceID SourceID parameter
+ * @throws MOAIDException
+ * @throws AuthenticationException
+ * @throws WrongParametersException
+ * @throws ConfigurationException
+ */
+ public static void startSTORKAuthentication(
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ AuthenticationSession moasession) throws MOAIDException, AuthenticationException, WrongParametersException, ConfigurationException {
+
+ if (moasession == null) {
+ throw new AuthenticationException("auth.18", new Object[]{});
+ }
+
+ //read configuration paramters of OA
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix());
+ if (oaParam == null)
+ throw new AuthenticationException("auth.00", new Object[]{moasession.getPublicOAURLPrefix()});
+
+ //Start of STORK Processing
+ STORKConfig storkConfig = AuthConfigurationProvider.getInstance().getStorkConfig();
+
+ CPEPS cpeps = storkConfig.getCPEPS(moasession.getCcc());
+
+ Logger.debug("Preparing to assemble STORK AuthnRequest with the following values:");
+ String destination = cpeps.getPepsURL().toExternalForm();
+ Logger.debug("C-PEPS URL: " + destination);
+
+ String acsURL = HTTPUtils.getBaseURL(req) + PEPSConnectorServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN;
+ Logger.debug("MOA Assertion Consumer URL (PEPSConnctor): " + acsURL);
+
+ String providerName = oaParam.getFriendlyName();
+ String issuerValue = HTTPUtils.getBaseURL(req);
+ Logger.debug("Issuer value: " + issuerValue);
+
+ // prepare collection of required attributes
+ // - attributes for online application
+ List<OAStorkAttribute> attributesFromConfig = oaParam.getRequestedAttributes();
+
+ // - prepare attribute list
+ PersonalAttributeList attributeList = new PersonalAttributeList();
+
+ // - fill container
+ for (OAStorkAttribute current : attributesFromConfig) {
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName(current.getName());
+
+ boolean globallyMandatory = false;
+ for (StorkAttribute currentGlobalAttribute : storkConfig.getStorkAttributes())
+ if (current.getName().equals(currentGlobalAttribute.getName())) {
+ globallyMandatory = currentGlobalAttribute.isMandatory();
+ break;
+ }
+
+ newAttribute.setIsRequired(current.isMandatory() || globallyMandatory);
+ attributeList.add(newAttribute);
+ }
+
+ // add sign request
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName("signedDoc");
+ List<String> value = new ArrayList<String>();
+ 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);
+
+
+ if (Logger.isDebugEnabled()) {
+ Logger.debug("The following attributes are requested for this OA:");
+ for (OAStorkAttribute logReqAttr : attributesFromConfig)
+ Logger.debug("OA specific requested attribute: " + logReqAttr.getName() + ", isRequired: " + logReqAttr.isMandatory());
+ }
+
+ //TODO: check Target in case of SSO!!
+ String spSector = StringUtils.isEmpty(moasession.getTarget()) ? "Business" : moasession.getTarget();
+ String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName();
+ String spApplication = spInstitution;
+ String spCountry = "AT";
+
+ //generate AuthnRquest
+ STORKAuthnRequest authnRequest = new STORKAuthnRequest();
+ authnRequest.setDestination(destination);
+ authnRequest.setAssertionConsumerServiceURL(acsURL);
+ authnRequest.setProviderName(providerName);
+ authnRequest.setIssuer(issuerValue);
+ authnRequest.setQaa(oaParam.getQaaLevel());
+ authnRequest.setSpInstitution(spInstitution);
+ authnRequest.setCountry(spCountry);
+ authnRequest.setSpApplication(spApplication);
+ authnRequest.setSpSector(spSector);
+ authnRequest.setPersonalAttributeList(attributeList);
+
+ authnRequest.setEIDCrossBorderShare(true);
+ authnRequest.setEIDCrossSectorShare(true);
+ authnRequest.setEIDSectorShare(true);
+
+ authnRequest.setCitizenCountryCode(moasession.getCcc());
+
+
+ Logger.debug("STORK AuthnRequest succesfully assembled.");
+
+ STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing");
+ try {
+ authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest);
+ } catch (STORKSAMLEngineException e) {
+ Logger.error("Could not sign STORK SAML AuthnRequest.", e);
+ throw new MOAIDException("stork.00", null);
+ }
+
+ Logger.info("STORK AuthnRequest successfully signed!");
+
+ //validate AuthnRequest
+ try {
+ samlEngine.validateSTORKAuthnRequest(authnRequest.getTokenSaml());
+ } catch (STORKSAMLEngineException e) {
+ Logger.error("STORK SAML AuthnRequest not valid.", e);
+ throw new MOAIDException("stork.01", null);
+ }
+
+ Logger.debug("STORK AuthnRequest successfully internally validated.");
+
+ //send
+ moasession.setStorkAuthnRequest(authnRequest);
+ HttpSession httpSession = req.getSession();
+ httpSession.setAttribute("MOA-Session-ID", moasession.getSessionID());
+
+
+ Logger.info("Preparing to send STORK AuthnRequest.");
+ Logger.info("prepared STORKAuthnRequest: ");
+ Logger.info(new String(authnRequest.getTokenSaml()));
+
+ try {
+ Logger.trace("Initialize VelocityEngine...");
+
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ 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);
+
+ StringWriter writer = new StringWriter();
+ template.merge(context, writer);
+
+ resp.getOutputStream().write(writer.toString().getBytes());
+ } catch (Exception e) {
+ Logger.error("Error sending STORK SAML AuthnRequest.", e);
+ httpSession.invalidate();
+ throw new MOAIDException("stork.02", new Object[]{destination});
+ }
+
+ Logger.info("STORK AuthnRequest successfully successfully prepared for client with target location: " + authnRequest.getDestination());
+ }
+
+ private static String generateDssSignRequest(String text, String mimeType, String citizenCountry) {
+ IdentifierGenerator idGenerator;
+ try {
+ idGenerator = new SecureRandomIdentifierGenerator();
+
+ DocumentType doc = new DocumentType();
+ doc.setBase64XML(text.getBytes());
+ doc.setID(idGenerator.generateIdentifier());
+
+ SignRequest request = new SignRequest();
+ request.setInputDocuments(ApiUtils.createInputDocuments(doc));
+
+ String id = idGenerator.generateIdentifier();
+ request.setRequestID(id);
+ request.setDocUI(id);
+
+ 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);
+ } 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 (IOException e) {
+ Logger.error("Could not create SignRequest", e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Extracts an X509 Certificate out of an XML signagture element
+ *
+ * @param signedXML XML signature element
+ * @return X509Certificate
+ * @throws CertificateException
+ */
+ public static X509Certificate getCertificateFromXML(Element signedXML) throws CertificateException {
+
+ NodeList nList = signedXML.getElementsByTagNameNS(Constants.DSIG_NS_URI, "X509Certificate");
+
+ String base64CertString = XMLUtil.getFirstTextValueFromNodeList(nList);
+
+ if (StringUtils.isEmpty(base64CertString)) {
+ String msg = "XML does not contain a X509Certificate element.";
+ Logger.error(msg);
+ throw new CertificateException(msg);
+ }
+
+ InputStream is = new ByteArrayInputStream(Base64.decode(base64CertString));
+
+ X509Certificate cert;
+ try {
+ cert = new X509Certificate(is);
+ return cert;
+
+ } catch (Throwable e) {
+ throw new CertificateException(e);
+ }
+ }
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
index bd87737ed..866c5a923 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java
@@ -2,19 +2,19 @@
* Copyright 2014 Federal Chancellery Austria
* MOA-ID has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, 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
@@ -46,91 +46,148 @@
package at.gv.egovernment.moa.id.auth.builder;
-import java.security.MessageDigest;
-
import at.gv.egovernment.moa.id.auth.exception.BuildException;
+import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.Constants;
+import java.security.MessageDigest;
+
/**
* Builder for the bPK, as defined in
* <code>&quot;Ableitung f&uml;r die bereichsspezifische Personenkennzeichnung&quot;</code>
* version <code>1.0.1</code> from <code>&quot;reference.e-government.gv.at&quot;</code>.
- *
+ *
* @author Paul Schamberger
* @version $Id$
*/
public class BPKBuilder {
- /**
- * Builds the bPK from the given parameters.
- * @param identificationValue Base64 encoded "Stammzahl"
- * @param target "Bereich lt. Verordnung des BKA"
- * @return bPK in a BASE64 encoding
- * @throws BuildException if an error occurs on building the bPK
- */
- public String buildBPK(String identificationValue, String target)
- throws BuildException {
-
- if ((identificationValue == null ||
- identificationValue.length() == 0 ||
- target == null ||
- target.length() == 0))
- {
- throw new BuildException("builder.00",
- new Object[] {"BPK", "Unvollständige Parameterangaben: identificationValue=" +
- identificationValue + ",target=" + target});
+ /**
+ * Builds the bPK from the given parameters.
+ *
+ * @param identificationValue Base64 encoded "Stammzahl"
+ * @param target "Bereich lt. Verordnung des BKA"
+ * @return bPK in a BASE64 encoding
+ * @throws BuildException if an error occurs on building the bPK
+ */
+ public String buildBPK(String identificationValue, String target)
+ throws BuildException {
+
+ if ((identificationValue == null ||
+ identificationValue.length() == 0 ||
+ target == null ||
+ target.length() == 0)) {
+ throw new BuildException("builder.00",
+ new Object[]{"BPK", "Unvollständige Parameterangaben: identificationValue=" +
+ identificationValue + ",target=" + target});
+ }
+ String basisbegriff;
+ if (target.startsWith(Constants.URN_PREFIX_CDID + "+"))
+ basisbegriff = identificationValue + "+" + target;
+ else
+ basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_CDID + "+" + target;
+
+ try {
+ MessageDigest md = MessageDigest.getInstance("SHA-1");
+ byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
+ String hashBase64 = Base64Utils.encode(hash);
+ return hashBase64;
+ } catch (Exception ex) {
+ throw new BuildException("builder.00", new Object[]{"bPK", ex.toString()}, ex);
+ }
}
- String basisbegriff;
- if (target.startsWith(Constants.URN_PREFIX_CDID + "+"))
- basisbegriff = identificationValue + "+" + target;
- else
- basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_CDID + "+" + target;
-
- try {
- MessageDigest md = MessageDigest.getInstance("SHA-1");
- byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
- String hashBase64 = Base64Utils.encode(hash);
- return hashBase64;
- } catch (Exception ex) {
- throw new BuildException("builder.00", new Object[] {"bPK", ex.toString()}, ex);
+
+ /**
+ * Builds the wbPK from the given parameters.
+ *
+ * @param identificationValue Base64 encoded "Stammzahl"
+ * @param registerAndOrdNr type of register + "+" + number in register.
+ * @return wbPK in a BASE64 encoding
+ * @throws BuildException if an error occurs on building the wbPK
+ */
+ public String buildWBPK(String identificationValue, String registerAndOrdNr)
+ throws BuildException {
+
+ if ((identificationValue == null ||
+ identificationValue.length() == 0 ||
+ registerAndOrdNr == null ||
+ registerAndOrdNr.length() == 0)) {
+ throw new BuildException("builder.00",
+ new Object[]{"wbPK", "Unvollständige Parameterangaben: identificationValue=" +
+ identificationValue + ",Register+Registernummer=" + registerAndOrdNr});
+ }
+
+ String basisbegriff;
+ if (registerAndOrdNr.startsWith(Constants.URN_PREFIX_WBPK + "+"))
+ basisbegriff = identificationValue + "+" + registerAndOrdNr;
+ else
+ basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr;
+
+ try {
+ MessageDigest md = MessageDigest.getInstance("SHA-1");
+ byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
+ String hashBase64 = Base64Utils.encode(hash);
+ return hashBase64;
+ } catch (Exception ex) {
+ throw new BuildException("builder.00", new Object[]{"wbPK", ex.toString()}, ex);
+ }
}
- }
-
- /**
- * Builds the wbPK from the given parameters.
- * @param identificationValue Base64 encoded "Stammzahl"
- * @param registerAndOrdNr type of register + "+" + number in register.
- * @return wbPK in a BASE64 encoding
- * @throws BuildException if an error occurs on building the wbPK
- */
- public String buildWBPK(String identificationValue, String registerAndOrdNr)
- throws BuildException {
-
- if ((identificationValue == null ||
- identificationValue.length() == 0 ||
- registerAndOrdNr == null ||
- registerAndOrdNr.length() == 0))
- {
- throw new BuildException("builder.00",
- new Object[] {"wbPK", "Unvollständige Parameterangaben: identificationValue=" +
- identificationValue + ",Register+Registernummer=" + registerAndOrdNr});
+
+ /**
+ * Builds the storkeid from the given parameters.
+ *
+ * @param identificationValue Base64 encoded "Stammzahl"
+ * @param destinationCountry destination country code (2 chars)
+ * @return storkid in a BASE64 encoding
+ * @throws BuildException if an error occurs on building the wbPK
+ */
+ public String buildStorkbPK(String identificationValue, String destinationCountry)
+ throws BuildException {
+ return buildStorkbPK(identificationValue, "AT", destinationCountry);
}
-
- String basisbegriff;
- if (registerAndOrdNr.startsWith(Constants.URN_PREFIX_WBPK + "+" ))
- basisbegriff = identificationValue + "+" + registerAndOrdNr;
- else
- basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr;
-
- try {
- MessageDigest md = MessageDigest.getInstance("SHA-1");
- byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
- String hashBase64 = Base64Utils.encode(hash);
- return hashBase64;
- } catch (Exception ex) {
- throw new BuildException("builder.00", new Object[] {"wbPK", ex.toString()}, ex);
+
+
+ /**
+ * Builds the storkeid from the given parameters.
+ *
+ * @param identificationValue Base64 encoded "Stammzahl"
+ * @param sourceCountry source country code (2 chars)
+ * @param destinationCountry destination country code (2 chars)
+ * @return storkid in a BASE64 encoding
+ * @throws BuildException if an error occurs on building the wbPK
+ */
+ public String buildStorkbPK(String identificationValue, String sourceCountry, String destinationCountry)
+ throws BuildException {
+
+ if ((identificationValue == null ||
+ identificationValue.length() == 0 ||
+ destinationCountry == null ||
+ destinationCountry.length() == 0 ||
+ sourceCountry == null ||
+ sourceCountry.length() == 0)) {
+ throw new BuildException("builder.00",
+ new Object[]{"storkid", "Unvollständige Parameterangaben: identificationValue=" +
+ identificationValue + ", Zielland=" + destinationCountry + ", Ursprungsland=" + sourceCountry});
+ }
+ Logger.info("Building STORK identification from: " + sourceCountry+"/"+destinationCountry+"/" + "[identValue]");
+ String eIdentifier = sourceCountry+"/"+destinationCountry+"/"+identificationValue;
+
+ /* Commented - it is already done by BKU, we need only to add Stork values
+ String basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_STORK + "+" + sourceCountry + "+" + destinationCountry;
+ Logger.info("Building STORK identification from: [identValue]+" + Constants.URN_PREFIX_STORK + "+" + sourceCountry + "+" + destinationCountry);
+ try {
+ MessageDigest md = MessageDigest.getInstance("SHA-1");
+ byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1"));
+ String hashBase64 = Base64Utils.encode(hash);
+ Logger.info("STORK identification defined as: " + hashBase64);
+ return hashBase64;
+ } catch (Exception ex) {
+ throw new BuildException("builder.00", new Object[]{"storkid", ex.toString()}, ex);
+ }
+ */
+ return eIdentifier;
}
- }
+
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilderForeign.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilderForeign.java
index e7e1e5cbd..f4b5cb4c9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilderForeign.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilderForeign.java
@@ -144,7 +144,7 @@ public class CreateXMLSignatureRequestBuilderForeign extends Builder {
else if (ch == '<')
out.write("&lt;");
else if (ch == '>')
- out.write("&gt;");
+ out.write("&gt;");
else if (ch == 'ä')
out.write("&auml;");
else if (ch == 'ö')
@@ -164,7 +164,7 @@ public class CreateXMLSignatureRequestBuilderForeign extends Builder {
}
}
catch (IOException ex) {
- throw new BuildException("builder.00", new Object[] {"GetIdentityLinkForm", ex.toString()});
+ throw new BuildException("builder.00", new Object[] {"CreateXMLSignatureRequest", ex.toString()});
}
return out.toString();
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java
index c09cde787..ab93f509c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java
@@ -212,28 +212,29 @@ public class GetIdentityLinkFormBuilder extends Builder {
StringWriter out = new StringWriter();
try {
for (int ch = in.read(); ch >= 0; ch = in.read()) {
- if (ch == '"')
+ if (ch == '"') {
out.write("&quot;");
- else if (ch == '<')
+ } else if (ch == '<') {
out.write("&lt;");
- else if (ch == '>')
+ } else if (ch == '>') {
out.write("&gt;");
- else if (ch == 'ä')
+ } else if (ch == 'ä') {
out.write("&auml;");
- else if (ch == 'ö')
+ } else if (ch == 'ö') {
out.write("&ouml;");
- else if (ch == 'ü')
+ } else if (ch == 'ü') {
out.write("&uuml;");
- else if (ch == 'Ä')
+ } else if (ch == 'Ä') {
out.write("&Auml;");
- else if (ch == 'Ö')
+ } else if (ch == 'Ö') {
out.write("&Ouml;");
- else if (ch == 'Ü')
+ } else if (ch == 'Ü') {
out.write("&Uuml;");
- else if (ch == 'ß')
+ } else if (ch == 'ß') {
out.write("&szlig;");
- else
+ } else {
out.write(ch);
+ }
}
}
catch (IOException ex) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java
index 828fc78ab..81ef5e408 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java
@@ -2,19 +2,19 @@
* Copyright 2014 Federal Chancellery Austria
* MOA-ID has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, 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
@@ -46,87 +46,150 @@
package at.gv.egovernment.moa.id.auth.builder;
+import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
/**
* Builder for the <code>&lt;InfoboxReadRequest&gt;</code> structure
* used for requesting the identity link from the security layer implementation.
- *
+ *
* @author Paul Ivancsics
* @version $Id$
*/
public class InfoboxReadRequestBuilder implements Constants {
- /**
- * Constructor for InfoboxReadRequestBuilder.
- */
- public InfoboxReadRequestBuilder() {
- }
-
-
- /**
- * Builds an <code>&lt;InfoboxReadRequest&gt;</code>.
- *
- * @param slVersion12 specifies whether the Security Layer version is
- * version 1.2 or not
- * @param businessService specifies whether the online application is a
- * business service or not
- * @param identityLinkDomainIdentifier the identification number of the business
- * company; maybe <code>null</code> if the OA
- * is a public service; must not be <code>null</code>
- * if the OA is a business service
- *
- * @return <code>&lt;InfoboxReadRequest&gt;</code> as String
- */
- public String build(boolean businessService, String identityLinkDomainIdentifier) {
-
- String slPrefix;
- String slNsDeclaration;
-
+ /**
+ * Constructor for InfoboxReadRequestBuilder.
+ */
+ public InfoboxReadRequestBuilder() {
+ }
+
+
+ /**
+ * Builds an <code>&lt;InfoboxReadRequest&gt;</code>.
+ *
+ * @param slVersion12 specifies whether the Security Layer version is
+ * version 1.2 or not
+ * @param businessService specifies whether the online application is a
+ * business service or not
+ * @param identityLinkDomainIdentifier the identification number of the business
+ * company; maybe <code>null</code> if the OA
+ * is a public service; must not be <code>null</code>
+ * if the OA is a business service
+ * @return <code>&lt;InfoboxReadRequest&gt;</code> as String
+ */
+ public String build(boolean businessService, String identityLinkDomainIdentifier) {
+ Logger.info("Building InfoBoxReadRequest");
+ String slPrefix;
+ String slNsDeclaration;
+
// if (slVersion12) {
- slPrefix = SL12_PREFIX;
- slNsDeclaration = SL12_NS_URI;
+ slPrefix = SL12_PREFIX;
+ slNsDeclaration = SL12_NS_URI;
// } else {
// slPrefix = SL10_PREFIX;
// slNsDeclaration = SL10_NS_URI;
// }
-
- StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
- sb.append("<");
- sb.append(slPrefix);
- sb.append(":InfoboxReadRequest xmlns:");
- sb.append(slPrefix);
- sb.append("=\"");
- sb.append(slNsDeclaration);
- sb.append("\">");
- sb.append("<");
- sb.append(slPrefix);
- sb.append(":InfoboxIdentifier>IdentityLink</");
- sb.append(slPrefix);
- sb.append(":InfoboxIdentifier>");
- sb.append("<");
- sb.append(slPrefix);
- sb.append(":BinaryFileParameters ContentIsXMLEntity=\"true\"/>");
- if (businessService) {
- sb.append("<");
- sb.append(slPrefix);
- sb.append(":BoxSpecificParameters>");
- sb.append("<");
- sb.append(slPrefix);
- sb.append(":IdentityLinkDomainIdentifier>");
- sb.append(identityLinkDomainIdentifier);
- sb.append("</sl:IdentityLinkDomainIdentifier>");
- sb.append("</");
- sb.append(slPrefix);
- sb.append(":BoxSpecificParameters>");
+
+ StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":InfoboxReadRequest xmlns:");
+ sb.append(slPrefix);
+ sb.append("=\"");
+ sb.append(slNsDeclaration);
+ sb.append("\">");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":InfoboxIdentifier>IdentityLink</");
+ sb.append(slPrefix);
+ sb.append(":InfoboxIdentifier>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":BinaryFileParameters ContentIsXMLEntity=\"true\"/>");
+ if (businessService) {
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":BoxSpecificParameters>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":IdentityLinkDomainIdentifier>");
+ sb.append(identityLinkDomainIdentifier);
+ sb.append("</sl:IdentityLinkDomainIdentifier>");
+ sb.append("</");
+ sb.append(slPrefix);
+ sb.append(":BoxSpecificParameters>");
+ }
+ sb.append("</");
+ sb.append(slPrefix);
+ sb.append(":InfoboxReadRequest>");
+
+ return sb.toString();
+
+ }
+
+
+ /**
+ * Builds an <code>&lt;InfoboxReadRequest&gt;</code>.
+ *
+ * @param slVersion12 specifies whether the Security Layer version is
+ * version 1.2 or not
+ * @param businessService specifies whether the online application is a
+ * business service or not
+ * @param identityLinkDomainIdentifier the identification number of the business
+ * company; maybe <code>null</code> if the OA
+ * is a public service; must not be <code>null</code>
+ * if the OA is a business service
+ * @return <code>&lt;InfoboxReadRequest&gt;</code> as String
+ *
+ */
+ public String buildStorkReadRequest(String identityLinkDomainIdentifier) {
+ Logger.info("Building Stork InfoBoxReadRequest for " + identityLinkDomainIdentifier);
+
+ String slPrefix;
+ String slNsDeclaration;
+
+ slPrefix = SL12_PREFIX;
+ slNsDeclaration = SL12_NS_URI;
+
+ StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":InfoboxReadRequest xmlns:");
+ sb.append(slPrefix);
+ sb.append("=\"");
+ sb.append(slNsDeclaration);
+ sb.append("\">");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":InfoboxIdentifier>IdentityLink</");
+ sb.append(slPrefix);
+ sb.append(":InfoboxIdentifier>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":BinaryFileParameters ContentIsXMLEntity=\"true\"/>");
+
+ // append box parameters - necessary for stork?
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":BoxSpecificParameters>");
+ sb.append("<");
+ sb.append(slPrefix);
+ sb.append(":IdentityLinkDomainIdentifier>");
+ sb.append(identityLinkDomainIdentifier);
+ sb.append("</sl:IdentityLinkDomainIdentifier>");
+ sb.append("</");
+ sb.append(slPrefix);
+ sb.append(":BoxSpecificParameters>");
+ // end appending box parameters
+
+ sb.append("</");
+ sb.append(slPrefix);
+ sb.append(":InfoboxReadRequest>");
+
+ return sb.toString();
+
}
- sb.append("</");
- sb.append(slPrefix);
- sb.append(":InfoboxReadRequest>");
-
- return sb.toString();
-
- }
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/RedirectFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/RedirectFormBuilder.java
index e2a736330..2a5c8d418 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/RedirectFormBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/RedirectFormBuilder.java
@@ -31,7 +31,8 @@ import at.gv.egovernment.moa.logging.Logger;
public class RedirectFormBuilder {
- private static String URL = "#URL#";
+ private static String URL = "#URL#";
+ private static String TARGET = "#TARGET#";
private static String template;
private static String getTemplate() {
@@ -53,9 +54,10 @@ public class RedirectFormBuilder {
return template;
}
- public static String buildLoginForm(String url) {
+ public static String buildLoginForm(String url, String redirectTarget) {
String value = getTemplate();
value = value.replace(URL, url);
+ value = value.replace(TARGET, redirectTarget);
return value;
}
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 896feed9e..2a6bde1e8 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
@@ -220,6 +220,8 @@ public class AuthenticationSession implements Serializable {
*/
private STORKAuthnRequest storkAuthnRequest;
+ private String storkAuthnResponse;
+
// private AuthenticationData authData;
// protocol selection
@@ -1022,6 +1024,21 @@ public class AuthenticationSession implements Serializable {
QAALevel = qAALevel;
}
+ /**
+ * @return the storkAuthnResponse
+ */
+ public String getStorkAuthnResponse() {
+ return storkAuthnResponse;
+ }
+
+ /**
+ * @param storkAuthnResponse the storkAuthnResponse to set
+ */
+ public void setStorkAuthnResponse(String storkAuthnResponse) {
+ this.storkAuthnResponse = storkAuthnResponse;
+ }
+
+
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
index d6d22fe4a..479775dd5 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
@@ -110,9 +110,11 @@ public class SignatureVerificationInvoker {
authConnParam = authConfigProvider.getMoaSpConnectionParameter();
//If the ConnectionParameter do NOT exist, we try to get the api to work....
if (authConnParam != null) {
+ Logger.debug("Connecting using auth url: " + authConnParam.getUrl() + ", service " + serviceName.getNamespaceURI() + " : " + serviceName.getLocalPart() + " : "+ serviceName.getPrefix());
endPoint = authConnParam.getUrl();
call.setTargetEndpointAddress(endPoint);
responses = (Vector) call.invoke(serviceName, params);
+ Logger.debug("Got responses: " + responses.size()); // TODO handle axis 302 response when incorrect service url is used
response = (SOAPBodyElement) responses.get(0);
return response.getAsDOM();
}
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 f4212cc78..5ad937b2a 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
@@ -67,6 +67,7 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.auth.exception.ParseException;
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;
@@ -169,13 +170,29 @@ public class GetForeignIDServlet extends AuthServlet {
session = AuthenticationServer.getSession(sessionID);
-
+ //change MOASessionID
+ sessionID = AuthenticationSessionStoreage.changeSessionID(session);
Logger.debug(xmlCreateXMLSignatureResponse);
CreateXMLSignatureResponse csresp =
new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse).parseResponseDsig();
+ try {
+ String serializedAssertion = DOMUtils.serializeNode(csresp
+ .getSamlAssertion());
+ session.setAuthBlock(serializedAssertion);
+
+ } catch (TransformerException e) {
+ throw new ParseException("parser.04", new Object[] {
+ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE });
+
+ } catch (IOException e) {
+ throw new ParseException("parser.04", new Object[] {
+ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE });
+
+ }
+
Element signature = csresp.getDsigSignature();
try {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java
index 8bf437cca..5733cee85 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java
@@ -174,6 +174,9 @@ public class GetMISSessionIDServlet extends AuthServlet {
session = AuthenticationServer.getSession(sessionID);
+ //change MOASessionID
+ sessionID = AuthenticationSessionStoreage.changeSessionID(session);
+
String misSessionID = session.getMISSessionID();
AuthConfigurationProvider authConf = AuthConfigurationProvider
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
index f3495966a..800393b30 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
@@ -54,12 +54,14 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.moduls.AuthenticationManager;
import at.gv.egovernment.moa.id.moduls.RequestStorage;
import at.gv.egovernment.moa.id.moduls.SSOManager;
import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage;
import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.MiscUtil;
public class LogOutServlet extends AuthServlet {
@@ -80,6 +82,11 @@ public class LogOutServlet extends AuthServlet {
//get SSO token from request
String ssoid = ssomanager.getSSOSessionID(req);
+ if (MiscUtil.isEmpty(redirectUrl))
+ //set default redirect Target
+ Logger.debug("Set default RedirectURL back to MOA-ID-Auth");
+ redirectUrl = AuthConfigurationProvider.getInstance().getPublicURLPrefix();
+
if (ssomanager.isValidSSOSession(ssoid, req)) {
//TODO: Single LogOut Implementation
@@ -88,8 +95,7 @@ public class LogOutServlet extends AuthServlet {
AuthenticationManager authmanager = AuthenticationManager.getInstance();
String moasessionid = AuthenticationSessionStoreage.getMOASessionID(ssoid);
- RequestStorage.removePendingRequest(RequestStorage.getPendingRequest(req.getSession()),
- AuthenticationSessionStoreage.getPendingRequestID(moasessionid));
+ RequestStorage.removePendingRequest(AuthenticationSessionStoreage.getPendingRequestID(moasessionid));
authmanager.logout(req, resp, moasessionid);
Logger.info("User with SSO Id " + ssoid + " is logged out and get redirect to "+ redirectUrl);
@@ -105,7 +111,7 @@ public class LogOutServlet extends AuthServlet {
}
//Redirect to Application
- resp.setStatus(301);
+ resp.setStatus(302);
resp.addHeader("Location", redirectUrl);
}
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 b356c6f35..328a441cd 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
@@ -26,10 +26,8 @@ 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;
-
+import javax.activation.DataSource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -40,6 +38,7 @@ import javax.xml.bind.JAXBElement;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringEscapeUtils;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
@@ -51,9 +50,10 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
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;
+import at.gv.egovernment.moa.id.auth.exception.WrongParametersException;
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.ConfigurationDBUtils;
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;
@@ -61,13 +61,17 @@ import at.gv.egovernment.moa.id.moduls.ModulUtils;
import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage;
import at.gv.egovernment.moa.id.util.HTTPUtils;
+import at.gv.egovernment.moa.id.util.ParamValidatorUtils;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
import at.gv.egovernment.moa.logging.Logger;
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.profile.DocumentWithSignature;
+import eu.stork.oasisdss.api.LightweightSourceResolver;
+import eu.stork.oasisdss.api.exceptions.ApiUtilsException;
import eu.stork.oasisdss.profile.SignResponse;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
import eu.stork.peps.auth.commons.PEPSUtil;
import eu.stork.peps.auth.commons.PersonalAttribute;
import eu.stork.peps.auth.commons.STORKAuthnRequest;
@@ -111,17 +115,28 @@ public class PEPSConnectorServlet extends AuthServlet {
super.checkIfHTTPisAllowed(request.getRequestURL().toString());
Logger.debug("Trying to find MOA Session-ID");
- HttpSession httpSession = request.getSession();
- String moaSessionID = (String) httpSession.getAttribute("MOA-Session-ID");
+ String moaSessionID = request.getParameter(PARAM_SESSIONID);
+
+ // escape parameter strings
+ moaSessionID= StringEscapeUtils.escapeHtml(moaSessionID);
if (StringUtils.isEmpty(moaSessionID)) {
//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 });
}
-
+
+ if (!ParamValidatorUtils.isValidSessionID(moaSessionID))
+ throw new WrongParametersException("VerifyAuthenticationBlock", PARAM_SESSIONID, "auth.12");
+
pendingRequestID = AuthenticationSessionStoreage.getPendingRequestID(moaSessionID);
+ //load MOASession from database
+ AuthenticationSession moaSession = AuthenticationServer.getSession(moaSessionID);
+
+ //change MOASessionID
+ moaSessionID = AuthenticationSessionStoreage.changeSessionID(moaSession);
+
Logger.info("Found MOA sessionID: " + moaSessionID);
Logger.debug("Beginning to extract SAMLResponse out of HTTP Request");
@@ -162,10 +177,7 @@ public class PEPSConnectorServlet extends AuthServlet {
}
Logger.info("Got SAML response with authentication success message.");
-
- //check if authentication request was created before
- AuthenticationSession moaSession = AuthenticationServer.getSession(moaSessionID);
-
+
Logger.debug("MOA session is still valid");
STORKAuthnRequest storkAuthnRequest = moaSession.getStorkAuthnRequest();
@@ -179,7 +191,15 @@ public class PEPSConnectorServlet extends AuthServlet {
////////////// incorporate gender from parameters if not in stork response
- PersonalAttribute gender = authnResponse.getPersonalAttributeList().get("gender");
+ IPersonalAttributeList attributeList = authnResponse.getPersonalAttributeList();
+
+ // but first, check if we have a representation case
+ if(STORKResponseProcessor.hasAttribute("mandateContent", attributeList) || STORKResponseProcessor.hasAttribute("representative", attributeList) || STORKResponseProcessor.hasAttribute("represented", attributeList)) {
+ // in a representation case...
+ moaSession.setUseMandate("true");
+
+ // and check if we have the gender value
+ PersonalAttribute gender = attributeList.get("gender");
if(null == gender) {
String gendervalue = (String) request.getParameter("gender");
if(null != gendervalue) {
@@ -192,6 +212,7 @@ public class PEPSConnectorServlet extends AuthServlet {
authnResponse.getPersonalAttributeList().add(gender);
}
}
+ }
//////////////////////////////////////////////////////////////////////////
@@ -202,17 +223,15 @@ public class PEPSConnectorServlet extends AuthServlet {
String signatureInfo = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0);
SignResponse dssSignResponse = (SignResponse) ApiUtils.unmarshal(new StreamSource(new java.io.StringReader(signatureInfo)));
- List<DocumentWithSignature> 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();
+ DataSource ds = LightweightSourceResolver.getDataSource(dssSignResponse);
+ if(ds == null){
+ throw new ApiUtilsException("No datasource found in response");
+ }
+
+ InputStream incoming = ds.getInputStream();
+ citizenSignature = IOUtils.toString(incoming);
+ incoming.close();
JAXBContext ctx = JAXBContext.newInstance(SignatureType.class.getPackage().getName());
SignatureType root = ((JAXBElement<SignatureType>) ctx.createUnmarshaller().unmarshal(IOUtils.toInputStream(citizenSignature))).getValue();
@@ -298,7 +317,7 @@ public class PEPSConnectorServlet extends AuthServlet {
response.getOutputStream().write(writer.toString().getBytes());
} catch (Exception e1) {
Logger.error("Error sending gender retrival form.", e1);
- httpSession.invalidate();
+// httpSession.invalidate();
throw new MOAIDException("stork.10", null);
}
@@ -320,6 +339,9 @@ public class PEPSConnectorServlet extends AuthServlet {
Logger.debug("Adding addtional STORK attributes to MOA session");
moaSession.setStorkAttributes(authnResponse.getPersonalAttributeList());
+ Logger.debug("Add full STORK AuthnResponse to MOA session");
+ moaSession.setStorkAuthnResponse(request.getParameter("SAMLResponse"));
+
//We don't have BKUURL, setting from null to "Not applicable"
moaSession.setBkuURL("Not applicable (STORK Authentication)");
@@ -331,6 +353,7 @@ public class PEPSConnectorServlet extends AuthServlet {
//TODO: found better solution, but QAA Level in response could be not supported yet
try {
+
moasession.setQAALevel(authnResponse.getAssertions().get(0).
getAuthnStatements().get(0).getAuthnContext().
getAuthnContextClassRef().getAuthnContextClassRef());
@@ -365,6 +388,10 @@ public class PEPSConnectorServlet extends AuthServlet {
handleError(null, e, request, response, pendingRequestID);
}
+ finally {
+ ConfigurationDBUtils.closeSession();
+ }
+
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java
index 7c51e7d6b..671151bbe 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java
@@ -30,6 +30,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import at.gv.egovernment.moa.id.auth.builder.RedirectFormBuilder;
+import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
+import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
+import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.egovernment.moa.util.URLEncoder;
@@ -45,12 +48,45 @@ public class RedirectServlet extends AuthServlet{
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
- Logger.info("Receive " + RedirectServlet.class + " Request");
+ Logger.debug("Receive " + RedirectServlet.class + " Request");
String url = req.getParameter(REDIRCT_PARAM_URL);
String target = req.getParameter(PARAM_TARGET);
String artifact = req.getParameter(PARAM_SAMLARTIFACT);
+ if (MiscUtil.isEmpty(artifact)) {
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Parameters not valid");
+ return;
+ }
+
+ Logger.debug("Check URL against online-applications");
+ OnlineApplication oa = null;
+ String redirectTarget = "_parent";
+ try {
+ oa = ConfigurationDBRead.getActiveOnlineApplication(url);
+ if (oa == null) {
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Parameters not valid");
+ return;
+
+ } else {
+ try {
+ redirectTarget = oa.getAuthComponentOA().getTemplates().getBKUSelectionCustomization().getAppletRedirectTarget();
+
+ } catch (Exception e) {
+ Logger.debug("Use default redirectTarget.");
+ }
+
+ }
+
+ } catch (Throwable e) {
+ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Request not allowed.");
+ return;
+
+ } finally {
+ ConfigurationDBUtils.closeSession();
+
+ }
+
Logger.info("Redirect to " + url);
if (MiscUtil.isNotEmpty(target)) {
@@ -65,12 +101,15 @@ public class RedirectServlet extends AuthServlet{
URLEncoder.encode(artifact, "UTF-8"));
url = resp.encodeRedirectURL(url);
- String redirect_form = RedirectFormBuilder.buildLoginForm(url);
+ String redirect_form = RedirectFormBuilder.buildLoginForm(url, redirectTarget);
resp.setContentType("text/html;charset=UTF-8");
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.write(redirect_form);
out.flush();
+
+
}
+
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java
index 4f722c8b3..2b46c8ff2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java
@@ -50,6 +50,7 @@ import iaik.pki.PKIException;
import java.io.IOException;
import java.security.GeneralSecurityException;
+import java.util.List;
import java.util.Map;
import javax.net.ssl.SSLSocketFactory;
@@ -174,9 +175,8 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet {
// escape parameter strings
sessionID = StringEscapeUtils.escapeHtml(sessionID);
-
pendingRequestID = AuthenticationSessionStoreage.getPendingRequestID(sessionID);
-
+
String redirectURL = null;
try {
// check parameter
@@ -187,6 +187,9 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet {
AuthenticationSession session = AuthenticationServer.getSession(sessionID);
+ //change MOASessionID
+ sessionID = AuthenticationSessionStoreage.changeSessionID(session);
+
String samlArtifactBase64 = AuthenticationServer.getInstance().verifyAuthenticationBlock(session, createXMLSignatureResponse);
@@ -220,17 +223,17 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet {
String oaURL = session.getOAURLRequested();
OAAuthParameter oaParam = authConf.getOnlineApplicationParameter(oaURL);
- String profiles = oaParam.getMandateProfiles();
+ List<String> profiles = oaParam.getMandateProfiles();
if (profiles == null) {
Logger.error("No Mandate/Profile for OA configured.");
throw new AuthenticationException("auth.16", new Object[] { GET_MIS_SESSIONID});
}
- String profilesArray[] = profiles.split(",");
- for(int i = 0; i < profilesArray.length; i++) {
- profilesArray[i] = profilesArray[i].trim();
- }
+// String profilesArray[] = profiles.split(",");
+// for(int i = 0; i < profilesArray.length; i++) {
+// profilesArray[i] = profilesArray[i].trim();
+// }
String oaFriendlyName = oaParam.getFriendlyName();
String mandateReferenceValue = session.getMandateReferenceValue();
@@ -249,7 +252,7 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet {
targetType = AuthenticationSession.TARGET_PREFIX_ + oaParam.getTarget();
}
- MISSessionId misSessionID = MISSimpleClient.sendSessionIdRequest(connectionParameters.getUrl(), idl, cert, oaFriendlyName, redirectURL, mandateReferenceValue, profilesArray, targetType, sslFactory);
+ MISSessionId misSessionID = MISSimpleClient.sendSessionIdRequest(connectionParameters.getUrl(), idl, cert, oaFriendlyName, redirectURL, mandateReferenceValue, profiles, targetType, sslFactory);
if (misSessionID == null) {
Logger.error("Fehler bei Anfrage an Vollmachten Service. MIS Session ID ist null.");
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java
index 80b1547c9..fddd0d6b9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java
@@ -157,6 +157,8 @@ public class VerifyCertificateServlet extends AuthServlet {
session = AuthenticationServer.getSession(sessionID);
+ //change MOASessionID
+ sessionID = AuthenticationSessionStoreage.changeSessionID(session);
X509Certificate cert = AuthenticationServer.getInstance().getCertificate(sessionID, parameters);
if (cert == null) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java
index 7c2a032a1..10a41c487 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java
@@ -66,6 +66,7 @@ import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import at.gv.egovernment.moa.id.auth.exception.ParseException;
import at.gv.egovernment.moa.id.auth.exception.WrongParametersException;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
+import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils;
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;
@@ -147,8 +148,7 @@ public class VerifyIdentityLinkServlet extends AuthServlet {
throw new IOException(e.getMessage());
}
String sessionID = req.getParameter(PARAM_SESSIONID);
-
-
+
// escape parameter strings
sessionID = StringEscapeUtils.escapeHtml(sessionID);
@@ -167,6 +167,9 @@ public class VerifyIdentityLinkServlet extends AuthServlet {
AuthenticationSession session = AuthenticationServer.getSession(sessionID);
+
+ //change MOASessionID
+ sessionID = AuthenticationSessionStoreage.changeSessionID(session);
String createXMLSignatureRequestOrRedirect = AuthenticationServer.getInstance().verifyIdentityLink(session, parameters);
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 57843d0f3..c3b45f165 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
@@ -86,7 +86,7 @@ public class STORKResponseProcessor {
* @param attributeList the attribute list
* @return true, if successful
*/
- private static boolean hasAttribute(String attributeName, IPersonalAttributeList attributeList) {
+ public static boolean hasAttribute(String attributeName, IPersonalAttributeList attributeList) {
try {
getAttributeValue(attributeName, attributeList);
return true;
@@ -125,7 +125,7 @@ public class STORKResponseProcessor {
* @return Identity Link
* @throws STORKException the sTORK exception
*/
- public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList, String oaFriendlyName, String targetType, String targetValue, String filters) throws STORKException {
+ public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList, String oaFriendlyName, String targetType, String targetValue, List<String> filters) throws STORKException {
Logger.trace("Calling SZR Gateway with the following attributes:");
CreateIdentityLinkResponse identityLinkResponse = null;
@@ -133,12 +133,42 @@ public class STORKResponseProcessor {
try {
Logger.trace("Starting call...");
-
// if there is no signedDoc attribute, we cannot go on
String citizenSignature = getAttributeValue("signedDoc", attributeList);
+ String fiscalNumber = getAttributeValue("fiscalNumber", attributeList);
// if we have a signedDoc we test for a representation case
- if(hasAttribute("mandateContent", attributeList) || hasAttribute("representative", attributeList) || hasAttribute("represented", attributeList)) {
+ // - according to stork samlengine and commons
+ if(hasAttribute("mandate", attributeList)) {
+ // we have a representation case
+ String mandate = getAttributeValue("mandate", attributeList);
+
+ 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);
+
+ identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, null, null, mandate, organizationAddress, organizationType, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
+ } 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);
+
+ // 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, gender, citizenSignature, null,
+ null, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
+ }
+ }
+ // - according to stork spec
+ else 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);
@@ -148,15 +178,15 @@ public class STORKResponseProcessor {
// if we get here, we have a natural person representing a legal person
String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList);
String organizationType = getAttributeValue("translateableType", attributeList);
-
- identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType, targetType, targetValue, oaFriendlyName, filters);
+
+ identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
} 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);
-
+
// gender attribute is mandatory here because of some legal stuff
String gender = getAttributeValue("gender", attributeList);
@@ -165,7 +195,7 @@ public class STORKResponseProcessor {
identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier,
givenName, lastName, dateOfBirth, gender, citizenSignature, representative,
- represented, mandate, targetType, targetValue, oaFriendlyName, filters);
+ represented, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber);
}
} else {
// we do not have a representation case
@@ -175,7 +205,7 @@ public class STORKResponseProcessor {
String dateOfBirth = getAttributeValue("dateOfBirth", attributeList);
if (!StringUtils.isEmpty(dateOfBirth))
dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth);
- identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature);
+ identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, fiscalNumber);
}
if (null != identityLinkResponse.getErrorResponse()){
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
index 0d39a4bc5..038e92f1c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java
@@ -60,6 +60,8 @@ import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse;
import at.gv.egovernment.moa.id.auth.exception.ValidateException;
+import at.gv.egovernment.moa.id.config.ConfigurationException;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
import at.gv.egovernment.moa.logging.Logger;
@@ -101,12 +103,13 @@ public class VerifyXMLSignatureResponseValidator {
* manifest has to be ignored (identityLink validation if
* the OA is a business service) or not
* @throws ValidateException on any validation error
+ * @throws ConfigurationException
*/
public void validate(VerifyXMLSignatureResponse verifyXMLSignatureResponse,
List<String> identityLinkSignersSubjectDNNames,
String whatToCheck,
boolean ignoreManifestValidationResult)
- throws ValidateException {
+ throws ValidateException, ConfigurationException {
if (verifyXMLSignatureResponse.getSignatureCheckCode() != 0)
throw new ValidateException("validator.06", null);
@@ -123,13 +126,20 @@ public class VerifyXMLSignatureResponseValidator {
checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.24", null);
if (verifyXMLSignatureResponse.getCertificateCheckCode() == 5)
checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.25", null);
-
- if (whatToCheck.equals(CHECK_IDENTITY_LINK))
- throw new ValidateException("validator.07", new Object[] { checkFailedReason } );
- else
- throw new ValidateException("validator.19", new Object[] { checkFailedReason } );
+
+ // TEST CARDS
+ // if (whatToCheck.equals(CHECK_IDENTITY_LINK))
+ // throw new ValidateException("validator.07", new Object[] { checkFailedReason } );
+ // else
+ // throw new ValidateException("validator.19", new Object[] { checkFailedReason } );
}
+ //check QC
+ if (AuthConfigurationProvider.getInstance().isCertifiacteQCActive() &&
+ !whatToCheck.equals(CHECK_IDENTITY_LINK) &&
+ !verifyXMLSignatureResponse.isQualifiedCertificate())
+ throw new ValidateException("validator.71", null);
+
if (ignoreManifestValidationResult) {
Logger.debug("OA type is business service, thus ignoring DSIG manifest validation result");
} else {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java
index 7e21c6667..2d0a0e367 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java
@@ -55,7 +55,12 @@ public class OAParameter {
this.businessService = true;
else
this.businessService = false;
-
+
+ if (this.oaType.equals("storkService"))
+ this.storkService = true;
+ else
+ this.storkService = false;
+
this.publicURLPrefix = oa.getPublicURLPrefix();
this.friendlyName = oa.getFriendlyName();
@@ -81,8 +86,15 @@ public class OAParameter {
* if value of {@link #oaType} is "businessService"
*/
private boolean businessService;
-
- /**
+
+ /**
+ * specifies whether the online application is a stork application or not (<code>true</code>
+ * if value of {@link #oaType} is "storkService"
+ */
+ private boolean storkService;
+
+
+ /**
* public URL prefix of the online application
*/
private String publicURLPrefix;
@@ -139,5 +151,7 @@ public class OAParameter {
public OAOAUTH20 getoAuth20Config() {
return oAuth20Config;
}
+
+ public boolean getStorkService() { return storkService; }
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java
index 1674715d1..b02c0946c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java
@@ -42,21 +42,29 @@ public class AuthConfigLoader implements Runnable {
Logger.info("check for new config.");
MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
- Date dbdate = moaidconfig.getTimestampItem();
- Date pvprefresh = moaidconfig.getPvp2RefreshItem();
-
- Date date = AuthConfigurationProvider.getTimeStamp();
-
- if (dbdate != null && dbdate.after(date)) {
- AuthConfigurationProvider instance = AuthConfigurationProvider.getInstance();
- instance.reloadDataBaseConfig();
- }
- Date pvpdate = MOAMetadataProvider.getTimeStamp();
- if (pvprefresh != null && pvpdate != null && pvprefresh.after(pvpdate)) {
- MOAMetadataProvider.reInitialize();
+ if (moaidconfig != null) {
+ Date dbdate = moaidconfig.getTimestampItem();
+ Date pvprefresh = moaidconfig.getPvp2RefreshItem();
+
+ Date date = AuthConfigurationProvider.getTimeStamp();
+
+ if (dbdate != null && dbdate.after(date)) {
+ AuthConfigurationProvider instance = AuthConfigurationProvider.getInstance();
+ instance.reloadDataBaseConfig();
+ }
+
+ Date pvpdate = MOAMetadataProvider.getTimeStamp();
+ if (pvprefresh != null && pvpdate != null && pvprefresh.after(pvpdate)) {
+ MOAMetadataProvider.reInitialize();
+ }
+
+ } else {
+ Logger.warn("MOA-ID Configuration is actually not found. Reuse old configuration.");
+
}
+
} catch (Throwable e) {
Logger.warn("MOA-ID Configuration is actually not loadable. Reuse old configuration.", e);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
index f9a038d9f..8b5c8d796 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
@@ -998,6 +998,16 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
return publicURLPreFix;
}
+ public boolean isPVP2AssertionEncryptionActive() {
+ String prop = props.getProperty("protocols.pvp2.assertion.encryption.active", "true");
+ return Boolean.valueOf(prop);
+ }
+
+ public boolean isCertifiacteQCActive() {
+ String prop = props.getProperty("configuration.validation.certificate.QC.ignore", "false");
+ return !Boolean.valueOf(prop);
+ }
+
/**
* Retruns the STORK Configuration
* @return STORK Configuration
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
index 8e7ca0779..d16e85084 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
@@ -51,11 +51,13 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType;
import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS;
import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
+import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASSO;
@@ -221,13 +223,32 @@ public List<String> getTransformsInfos() {
/**
* @return the mandateProfiles
*/
-public String getMandateProfiles() {
+public List<String> getMandateProfiles() {
Mandates mandates = oa_auth.getMandates();
- if (mandates != null)
- return mandates.getProfiles();
- else
+ List<String> list = new ArrayList<String>();
+
+ if (mandates != null) {
+ String oldProfilList = mandates.getProfiles();
+
+ List<MandatesProfileNameItem> profileList = mandates.getProfileNameItems();
+ for (MandatesProfileNameItem el : profileList) {
+ list.add(el.getItem());
+
+ }
+
+ //only for RC1
+ if (MiscUtil.isNotEmpty(oldProfilList)) {
+ String profilesArray[] = oldProfilList.split(",");
+ for(int i = 0; i < profilesArray.length; i++) {
+ list.add(profilesArray[i].trim());
+ }
+ }
+
+ return list;
+
+ } else
return null;
}
@@ -348,6 +369,13 @@ public List<OAStorkAttribute> getRequestedAttributes() {
return oa_auth.getOASTORK().getOAAttributes();
}
+public boolean isRequireConsentForStorkAttributes() {
+ return oa_auth.getOASTORK().isRequireConsent();
+}
+
+public List<AttributeProviderPlugin> getStorkAPs() {
+ return oa_auth.getOASTORK().getAttributeProviders();
+}
public byte[] getBKUSelectionTemplate() {
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 7ecd7dde8..e6e77911a 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
@@ -28,6 +28,9 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -55,6 +58,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP;
import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
+import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASSO;
@@ -83,6 +87,7 @@ import at.gv.egovernment.moa.id.data.IssuerAndSerial;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.DOMUtils;
+import at.gv.egovernment.moa.util.FileUtils;
import at.gv.egovernment.moa.util.MiscUtil;
public class BuildFromLegacyConfig {
@@ -237,7 +242,10 @@ public class BuildFromLegacyConfig {
for (int i=0; i<transformsInfos.length; i++) {
TransformsInfoType transforminfotype = new TransformsInfoType();
- transforminfotype.setFilename(transformsInfoFileNames[i]);
+
+ String fileURL = FileUtils.makeAbsoluteURL(transformsInfoFileNames[i], rootConfigFileDir);
+ Path fileName_ = new File(new URI(fileURL)).toPath().getFileName();
+ transforminfotype.setFilename(fileName_.toString());
transforminfotype.setTransformation(Base64Utils.encode(transformsInfos[i].getBytes("UTF-8")).getBytes("UTF-8"));
auth_transformInfos.add(transforminfotype);
@@ -392,22 +400,32 @@ public class BuildFromLegacyConfig {
templates.setTemplate(template_list);
- //set TransformsInfo
+ //TransformsInfo not supported by MOAID 2.0
String[] transforminfos = oa.getTransformsInfos();
- ArrayList<TransformsInfoType> oa_transforminfos = new ArrayList<TransformsInfoType>();
- for (String e1 : transforminfos) {
- TransformsInfoType transforminfo = new TransformsInfoType();
- transforminfo.setFilename(e1);
- oa_transforminfos.add(transforminfo);
+ for (String e1 : transforminfos) {
+ if (MiscUtil.isNotEmpty(e1)) {
+ Logger.warn("OA specific transformation for OA " + oa.getPublicURLPrefix()
+ + " are not supported. USE AdditionalAuthBlock text!");
+ }
}
- oa_auth.setTransformsInfo(oa_transforminfos);
//VerifyInfoBoxes not supported by MOAID 2.0
//set Mandates
Mandates oa_mandates = new Mandates();
oa_auth.setMandates(oa_mandates);
- oa_mandates.setProfiles(oa.getMandateProfiles());
+ List<MandatesProfileNameItem> profileList = new ArrayList<MandatesProfileNameItem>();
+
+ String oldProfiles = oa.getMandateProfiles();
+ if (MiscUtil.isNotEmpty(oldProfiles)) {
+ String[] oldprofileList = oldProfiles.split(",");
+ for (int i=0; i<oldprofileList.length; i++) {
+ MandatesProfileNameItem item = new MandatesProfileNameItem();
+ item.setItem(oldprofileList[i].trim());
+ profileList.add(item);
+ }
+ oa_mandates.setProfileNameItems(profileList );
+ }
//STORK
//TODO: OA specific STORK config is deactivated in MOA 1.5.2
@@ -447,7 +465,16 @@ public class BuildFromLegacyConfig {
ChainingModes moa_chainingModes = new ChainingModes();
moaIDConfig.setChainingModes(moa_chainingModes);
- ChainingModeType type = ChainingModeType.fromValue(builder.getDefaultChainingMode());
+
+
+ String defaultmode = builder.getDefaultChainingMode();
+ ChainingModeType type;
+ if (defaultmode.equals(iaik.pki.pathvalidation.ChainingModes.CHAIN_MODE))
+ type = ChainingModeType.CHAINING;
+ else
+ type = ChainingModeType.PKIX;
+
+
moa_chainingModes.setSystemDefaultMode(type);
Map<IssuerAndSerial, String> chainingModes = builder.buildChainingModes();
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 ff481b825..4dec2c32e 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
@@ -25,6 +25,7 @@
*/
package at.gv.egovernment.moa.id.config.stork;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -33,10 +34,15 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+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.StorkAttribute;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.StringUtils;
+import org.opensaml.ws.message.encoder.MessageEncodingException;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
/**
* Encapsulates several STORK configuration parameters according MOA configuration
@@ -59,8 +65,15 @@ public class STORKConfig {
this.props = props;
//create CPEPS map
- List<at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS> cpeps = stork.getCPEPS();
-
+ //List<at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS> cpeps = stork.getCPEPS();
+ List<at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS> cpeps = new ArrayList<at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS>(); // TODO Change this
+
+ try {
+ cpeps = stork.getCPEPS();
+ } catch (NullPointerException ex) {
+ Logger.error("CPEPS not configured!");
+ }
+
cpepsMap = new HashMap<String, CPEPS>();
if (cpeps != null) {
@@ -76,8 +89,20 @@ public class STORKConfig {
+ 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.");
+ }*/
}
-
attr = new ArrayList<StorkAttribute>();
if (stork.getAttributes() != null) {
for(StorkAttribute current : stork.getAttributes()) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
index c9fc07b70..480deb867 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
@@ -54,6 +54,7 @@ import at.gv.egovernment.moa.id.moduls.ModulStorage;
import at.gv.egovernment.moa.id.moduls.NoPassivAuthenticationException;
import at.gv.egovernment.moa.id.moduls.RequestStorage;
import at.gv.egovernment.moa.id.moduls.SSOManager;
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.AuthnRequestValidatorException;
import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage;
import at.gv.egovernment.moa.id.storage.DBExceptionStoreImpl;
import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
@@ -108,41 +109,24 @@ public class DispatcherServlet extends AuthServlet{
Object idObject = req.getParameter(PARAM_TARGET_PENDINGREQUESTID);
- Map<String, IRequest> errorRequests = RequestStorage.getPendingRequest(req.getSession());
+ //Map<String, IRequest> errorRequests = RequestStorage.getPendingRequest(req.getSession());
String pendingRequestID = null;
if (idObject != null && (idObject instanceof String)) {
- if (errorRequests.containsKey((String)idObject))
- pendingRequestID = (String) idObject;
+ pendingRequestID = (String) idObject;
}
if (throwable != null) {
- if (errorRequests != null) {
-
- synchronized (errorRequests) {
IRequest errorRequest = null;
if (pendingRequestID != null) {
- errorRequest = errorRequests.get(pendingRequestID);
+ errorRequest = RequestStorage.getPendingRequest(pendingRequestID);
- //remove the
- RequestStorage.removePendingRequest(errorRequests, pendingRequestID);
- }
- else {
- if (errorRequests.size() > 1) {
- handleErrorNoRedirect(throwable.getMessage(), throwable,
- req, resp);
-
- } else {
- Set<String> keys = errorRequests.keySet();
- errorRequest = errorRequests.get(keys.toArray()[0]);
- RequestStorage.removeAllPendingRequests(req.getSession());
- }
-
}
if (errorRequest != null) {
-
+ RequestStorage.removePendingRequest(pendingRequestID);
+
try {
IModulInfo handlingModule = ModulStorage
.getModuleByPath(errorRequest
@@ -156,6 +140,10 @@ public class DispatcherServlet extends AuthServlet{
StatisticLogger logger = StatisticLogger.getInstance();
logger.logErrorOperation(throwable, errorRequest);
+ //remove MOASession
+ AuthenticationSession moaSession = AuthenticationSessionStoreage.getSessionWithPendingRequestID(pendingRequestID);
+ AuthenticationManager.getInstance().logout(req, resp, moaSession.getSessionID());
+
return;
}
}
@@ -172,16 +160,9 @@ public class DispatcherServlet extends AuthServlet{
}
handleErrorNoRedirect(throwable.getMessage(), throwable,
req, resp);
-
- } else {
- // TODO: use better string
- handleErrorNoRedirect("UNKOWN ERROR DETECTED!", null, req,
- resp);
- }
return;
}
- }
Object moduleObject = req.getParameter(PARAM_TARGET_MODULE);
String module = null;
@@ -242,32 +223,24 @@ public class DispatcherServlet extends AuthServlet{
}
}
- HttpSession httpSession = req.getSession();
- Map<String, IRequest> protocolRequests = null;
+ //HttpSession httpSession = req.getSession();
+ //Map<String, IRequest> protocolRequests = null;
IRequest protocolRequest = null;
try {
- protocolRequests = RequestStorage.getPendingRequest(httpSession);
-
Object idObject = req.getParameter(PARAM_TARGET_PENDINGREQUESTID);
- if (protocolRequests != null &&
- idObject != null && (idObject instanceof String)) {
+ if (idObject != null && (idObject instanceof String)) {
protocolRequestID = (String) idObject;
-
+ protocolRequest = RequestStorage.getPendingRequest(protocolRequestID);
+
//get IRequest if it exits
- if (protocolRequests.containsKey(protocolRequestID)) {
- protocolRequest = protocolRequests.get(protocolRequestID);
+ if (protocolRequest != null) {
Logger.debug(DispatcherServlet.class.getName()+": Found PendingRequest with ID " + protocolRequestID);
} else {
- Logger.error("No PendingRequest with ID " + protocolRequestID + " found.!");
-
- Set<String> mapkeys = protocolRequests.keySet();
- for (String el : mapkeys)
- Logger.debug("PendingRequest| ID=" + el + " OAIdentifier=" + protocolRequests.get(el));
-
+ Logger.error("No PendingRequest with ID " + protocolRequestID + " found.!");
handleErrorNoRedirect("Während des Anmeldevorgangs ist ein Fehler aufgetreten. Bitte versuchen Sie es noch einmal.",
null, req, resp);
return;
@@ -277,59 +250,38 @@ public class DispatcherServlet extends AuthServlet{
protocolRequest = info.preProcess(req, resp, action);
if (protocolRequest != null) {
+
+ //Start new Authentication
+ protocolRequest.setAction(action);
+ protocolRequest.setModule(module);
+ protocolRequestID = Random.nextRandom();
+ protocolRequest.setRequestID(protocolRequestID);
- if(protocolRequests != null) {
+ RequestStorage.setPendingRequest(protocolRequest);
- Set<String> mapkeys = protocolRequests.keySet();
- for (String el : mapkeys) {
- IRequest value = protocolRequests.get(el);
-
- if (value.getOAURL().equals(protocolRequest.getOAURL())) {
-
- if(!AuthenticationSessionStoreage.deleteSessionWithPendingRequestID(el)) {
- Logger.warn(DispatcherServlet.class.getName()+": NO MOASession with PendingRequestID " + el + " found. Delete all user sessions!");
- RequestStorage.removeAllPendingRequests(req.getSession());
-
- } else {
- RequestStorage.removePendingRequest(protocolRequests, el);
- }
- }
- }
-
- } else {
- protocolRequests = new ConcurrentHashMap<String, IRequest>();
- }
+ Logger.debug(DispatcherServlet.class.getName()+": Create PendingRequest with ID " + protocolRequestID + ".");
+
+ } else {
+ Logger.error("Failed to generate a valid protocol request!");
+ resp.setContentType("text/html;charset=UTF-8");
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "NO valid protocol request received!");
+ return;
- synchronized (protocolRequest) {
- synchronized (protocolRequests) {
-
- //Start new Authentication
- protocolRequest.setAction(action);
- protocolRequest.setModule(module);
- protocolRequestID = Random.nextRandom();
- protocolRequest.setRequestID(protocolRequestID);
- protocolRequests.put(protocolRequestID, protocolRequest);
- Logger.debug(DispatcherServlet.class.getName()+": Create PendingRequest with ID " + protocolRequestID + ".");
- }
- }
}
-
+
} catch (ProtocolNotActiveException e) {
resp.getWriter().write(e.getMessage());
resp.setContentType("text/html;charset=UTF-8");
resp.sendError(HttpServletResponse.SC_FORBIDDEN, e.getMessage());
return;
-
- } catch (MOAIDException e) {
- Logger.error("Failed to generate a valid protocol request!");
- resp.setContentType("text/html;charset=UTF-8");
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "NO valid protocol request received!");
+ } catch (AuthnRequestValidatorException e) {
+ //log Error Message
+ StatisticLogger logger = StatisticLogger.getInstance();
+ logger.logErrorOperation(e, e.getErrorRequest());
return;
-
- }
-
- if (protocolRequest == null) {
+
+ } catch (MOAIDException e) {
Logger.error("Failed to generate a valid protocol request!");
resp.setContentType("text/html;charset=UTF-8");
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "NO valid protocol request received!");
@@ -337,9 +289,7 @@ public class DispatcherServlet extends AuthServlet{
}
}
-
- RequestStorage.setPendingRequest(httpSession, protocolRequests);
-
+
AuthenticationManager authmanager = AuthenticationManager.getInstance();
SSOManager ssomanager = SSOManager.getInstance();
@@ -460,7 +410,7 @@ public class DispatcherServlet extends AuthServlet{
String assertionID = moduleAction.processRequest(protocolRequest, req, resp, moasession);
- RequestStorage.removePendingRequest(protocolRequests, protocolRequestID);
+ RequestStorage.removePendingRequest(protocolRequestID);
if (needAuthentication) {
boolean isSSOSession = MiscUtil.isNotEmpty(newSSOSessionId);
@@ -491,7 +441,7 @@ public class DispatcherServlet extends AuthServlet{
}
} catch (Throwable e) {
- Logger.info("An authentication error occous: " + e.getMessage());;
+ Logger.warn("An authentication error occured: ", e);;
// Try handle module specific, if not possible rethrow
if (!info.generateErrorMessage(e, req, resp, protocolRequest)) {
throw e;
@@ -510,6 +460,8 @@ public class DispatcherServlet extends AuthServlet{
ConfigurationDBUtils.closeSession();
}
+ Logger.info("Clossing Dispatcher processing loop");
+ Logger.info("Http response prepared sent: " + resp.toString());
}
@Override
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java
index 65634bed3..b6fe20a61 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java
@@ -2,19 +2,19 @@
* Copyright 2014 Federal Chancellery Austria
* MOA-ID has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, 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
@@ -46,98 +46,120 @@
package at.gv.egovernment.moa.id.iaik.config;
-import java.io.File;
-
import at.gv.egovernment.moa.id.config.ConfigurationException;
import at.gv.egovernment.moa.id.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl;
-import at.gv.egovernment.moa.util.FileUtils;
+import at.gv.egovernment.moa.logging.Logger;
import iaik.pki.store.certstore.CertStoreConfiguration;
import iaik.pki.store.certstore.CertStoreParameters;
import iaik.pki.store.certstore.CertStoreTypes;
import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters;
+import java.io.File;
+
/**
* Implementation of interface needed to initialize an IAIK JSSE <code>TrustManager</code>
+ *
* @author Paul Ivancsics
* @version $Id$
*/
-public class CertStoreConfigurationImpl extends ObservableImpl
- implements CertStoreConfiguration, DirectoryCertStoreParameters {
- /** identifies the rootDirectory */
- private String rootDirectory;
- /** ConfigurationProvider */
- private ConfigurationProvider conf;
- /** Array for storing all CertStoreParameters */
- private CertStoreParameters[] parameters;
-
- /**
- * Create a new <code>CertStoreConfigurationImpl</code>.
- *
- * @param conf The MOA configuration from which the configuration data is
- * @throws ConfigurationException an any config-error
- * being read.
- */
- public CertStoreConfigurationImpl(ConfigurationProvider conf) throws ConfigurationException {
- this.conf=conf;
-
- String certStoreRootDirParam = conf.getCertstoreDirectory();
-
- if (certStoreRootDirParam == null)
- throw new ConfigurationException(
- "config.08", new Object[] {"CertStoreDirectory"});
-
- rootDirectory = FileUtils.makeAbsoluteURL(certStoreRootDirParam, conf.getRootConfigFileDir());
- if(rootDirectory.startsWith("file:")) rootDirectory = rootDirectory.substring(6);
- File f = new File(rootDirectory);
- if (!f.isDirectory())
- throw new ConfigurationException(
- "config.05", new Object[] {"CertStoreDirectory"});
-
- parameters = new CertStoreParameters[] { this };
- }
-
- /**
- * @see iaik.pki.store.certstore.CertStoreConfiguration#getParameters()
- */
- public CertStoreParameters[] getParameters() {
- return parameters;
- }
-
- /**
- * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#getRootDirectory()
- */
- public String getRootDirectory() {
- return rootDirectory;
- }
-
- /**
- * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#createNew()
- */
- public boolean createNew() {
- return false;
- }
-
- /**
- * @see iaik.pki.store.certstore.CertStoreParameters#getId()
- */
- public String getId() {
- return "MOA ID Directory CertStore";
- }
-
- /**
- * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly()
- */
- public boolean isReadOnly() {
- return false;
- }
-
- /**
- * @return <code>CertStoreTypes.DIRECTORY</code>
- * @see iaik.pki.store.certstore.CertStoreParameters#getType()
- */
- public String getType() {
- return CertStoreTypes.DIRECTORY;
- }
+public class CertStoreConfigurationImpl extends ObservableImpl
+ implements CertStoreConfiguration, DirectoryCertStoreParameters {
+ /**
+ * identifies the rootDirectory
+ */
+ private String rootDirectory;
+ /**
+ * ConfigurationProvider
+ */
+ private ConfigurationProvider conf;
+ /**
+ * Array for storing all CertStoreParameters
+ */
+ private CertStoreParameters[] parameters;
+
+ /**
+ * Create a new <code>CertStoreConfigurationImpl</code>.
+ *
+ * @param conf The MOA configuration from which the configuration data is
+ * @throws ConfigurationException an any config-error
+ * being read.
+ */
+ public CertStoreConfigurationImpl(ConfigurationProvider conf) throws ConfigurationException {
+ this.conf = conf;
+
+ String certStoreRootDirParam = conf.getCertstoreDirectory();
+
+ if (certStoreRootDirParam == null)
+ throw new ConfigurationException(
+ "config.08", new Object[]{"CertStoreDirectory"});
+
+ //rootDirectory = FileUtils.makeAbsoluteURL(certStoreRootDirParam, conf.getRootConfigFileDir());
+ rootDirectory = certStoreRootDirParam;
+ Logger.error("Using file: " + rootDirectory);
+ if (rootDirectory.startsWith("file:")) rootDirectory = rootDirectory.substring(5);
+ Logger.error("Using file2: " + rootDirectory);
+
+ File f = new File(rootDirectory);
+ //Logger.error("Using file: " + certStoreRootDirParam + " param: " + conf.getRootConfigFileDir());
+
+ if (!f.exists()) {
+ Logger.error("File does not exists: " + f.getAbsolutePath());
+ throw new ConfigurationException(
+ "config.05", new Object[]{"CertStoreDirectory"});
+ }
+
+ if (!f.isDirectory()) {
+ Logger.error("File is not a directory: " + f.getAbsolutePath());
+ throw new ConfigurationException(
+ "config.05", new Object[]{"CertStoreDirectory"});
+ }
+
+
+ parameters = new CertStoreParameters[]{this};
+ }
+
+ /**
+ * @see iaik.pki.store.certstore.CertStoreConfiguration#getParameters()
+ */
+ public CertStoreParameters[] getParameters() {
+ return parameters;
+ }
+
+ /**
+ * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#getRootDirectory()
+ */
+ public String getRootDirectory() {
+ return rootDirectory;
+ }
+
+ /**
+ * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#createNew()
+ */
+ public boolean createNew() {
+ return false;
+ }
+
+ /**
+ * @see iaik.pki.store.certstore.CertStoreParameters#getId()
+ */
+ public String getId() {
+ return "MOA ID Directory CertStore";
+ }
+
+ /**
+ * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly()
+ */
+ public boolean isReadOnly() {
+ return false;
+ }
+
+ /**
+ * @return <code>CertStoreTypes.DIRECTORY</code>
+ * @see iaik.pki.store.certstore.CertStoreParameters#getType()
+ */
+ public String getType() {
+ return CertStoreTypes.DIRECTORY;
+ }
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
index 666224b3a..03a61d08f 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
@@ -252,7 +252,7 @@ public class AuthenticationManager extends AuthServlet {
}
//set MOAIDSession
- request.getSession().setAttribute(MOA_SESSION, moasession.getSessionID());
+ //request.getSession().setAttribute(MOA_SESSION, moasession.getSessionID());
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = new PrintWriter(response.getOutputStream());
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/ModulStorage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/ModulStorage.java
index 91f98608c..4a1da76e2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/ModulStorage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/ModulStorage.java
@@ -33,6 +33,7 @@ public class ModulStorage {
private static final String[] modulClasses = new String[]{
"at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol",
"at.gv.egovernment.moa.id.protocols.pvp2x.PVP2XProtocol",
+ "at.gv.egovernment.moa.id.protocols.stork2.STORKProtocol",
"at.gv.egovernment.moa.id.protocols.oauth20.protocol.OAuth20Protocol"
};
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java
index bfe1151c4..21b4e2b65 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java
@@ -22,64 +22,53 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.moduls;
-import java.util.Map;
-
-import javax.servlet.http.HttpSession;
-
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
+import at.gv.egovernment.moa.id.storage.AssertionStorage;
import at.gv.egovernment.moa.logging.Logger;
public class RequestStorage {
- private static final String PENDING_REQUEST = "PENDING_REQUEST";
-
- public static Map<String,IRequest> getPendingRequest(HttpSession session) {
+ public static IRequest getPendingRequest(String pendingReqID) {
-
- Object obj = session.getAttribute(PENDING_REQUEST);
- if (obj != null) {
- synchronized (obj) {
- if (obj instanceof Map<?,?>) {
- if (((Map<?,?>) obj).size() > 0) {
- if ( ((Map<?,?>) obj).keySet().toArray()[0] instanceof String) {
- if (((Map<?,?>) obj).get(((Map<?,?>) obj).keySet().toArray()[0])
- instanceof IRequest) {
- return (Map<String, IRequest>) obj;
-
-
-
- }
- }
- }
- }
- }
- session.setAttribute(PENDING_REQUEST, null);
- }
+ try {
+ AssertionStorage storage = AssertionStorage.getInstance();
+ IRequest pendingRequest = storage.get(pendingReqID, IRequest.class);
+ return pendingRequest;
+
+ } catch (MOADatabaseException e) {
+ Logger.info("No PendingRequst found with pendingRequestID " + pendingReqID);
return null;
+
+ }
}
- public static void setPendingRequest(HttpSession session, Map<String, IRequest> request) {
- session.setAttribute(PENDING_REQUEST, request);
- }
-
- public static void removeAllPendingRequests(HttpSession session) {
-
- Logger.debug(RequestStorage.class.getName()+": Remove all PendingRequests");
+ public static void setPendingRequest(Object pendingRequest) throws MOAIDException {
+ try {
+ AssertionStorage storage = AssertionStorage.getInstance();
+
+ if (pendingRequest instanceof IRequest) {
+ storage.put(((IRequest)pendingRequest).getRequestID(), pendingRequest);
+
+ } else {
+ throw new MOAIDException("auth.20", null);
+
+ }
+
+ } catch (MOADatabaseException e) {
+ Logger.warn("Pending Request with ID=" + ((IRequest)pendingRequest).getRequestID() +
+ " can not stored.", e);
+ throw new MOAIDException("auth.20", null);
+ }
- session.setAttribute(PENDING_REQUEST, null);
}
- public static void removePendingRequest(Map<String, IRequest> requestmap, String requestID) {
-
- if (requestmap != null && requestID != null) {
+ public static void removePendingRequest(String requestID) {
- synchronized (requestmap) {
-
- if (requestmap.containsKey(requestID)) {
- requestmap.remove(requestID);
- Logger.debug(RequestStorage.class.getName()+": Remove PendingRequest with ID " + requestID);
-
- }
- }
+ if (requestID != null) {
+ AssertionStorage storage = AssertionStorage.getInstance();
+ storage.remove(requestID);
+
}
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
index 82de940db..684c6630a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
@@ -147,9 +147,7 @@ public class SSOManager {
public String createSSOSessionInformations(String moaSessionID, String OAUrl) {
String newSSOId = Random.nextRandom();
-
- System.out.println("generate new SSO Tokken (" + newSSOId + ")");
-
+
if (MiscUtil.isEmpty(moaSessionID) || MiscUtil.isEmpty(OAUrl)) {
Logger.warn("MoaSessionID or OAUrl are empty -> SSO is not enabled!");
return null;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/opemsaml/MOAKeyStoreX509CredentialAdapter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/opemsaml/MOAKeyStoreX509CredentialAdapter.java
new file mode 100644
index 000000000..81afcfbc1
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/opemsaml/MOAKeyStoreX509CredentialAdapter.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, 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 at.gv.egovernment.moa.id.opemsaml;
+
+import java.security.KeyStore;
+
+import org.opensaml.xml.security.x509.X509Credential;
+
+
+/**
+ * @author tlenz
+ *
+ */
+public class MOAKeyStoreX509CredentialAdapter extends
+ org.opensaml.xml.security.x509.KeyStoreX509CredentialAdapter {
+
+ /**
+ * @param store
+ * @param alias
+ * @param password
+ */
+ public MOAKeyStoreX509CredentialAdapter(KeyStore store, String alias,
+ char[] password) {
+ super(store, alias, password);
+ }
+
+ public Class<? extends X509Credential> getCredentialType() {
+ return X509Credential.class;
+ }
+
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java
index 7bb97b9d8..394fd1430 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java
@@ -156,7 +156,6 @@ public final class OAuth20AttributeBuilder {
// STORK
buildersSTORK.add(new EIDSTORKTOKEN());
- buildersSTORK.add(new EIDSTORKTOKEN());
buildersSTORK.add(new STORKAdoptedFamilyNameAttributBuilder());
buildersSTORK.add(new STORKAgeAttributBuilder());
buildersSTORK.add(new STORKCanonicalResidenceAddressAttributBuilder());
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/AuthenticationAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/AuthenticationAction.java
index f0d503d88..10618071a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/AuthenticationAction.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/AuthenticationAction.java
@@ -36,7 +36,6 @@ public class AuthenticationAction implements IAction {
public String processRequest(IRequest req, HttpServletRequest httpReq,
HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
- System.out.println("Process PVP2 auth request!");
PVPTargetConfiguration pvpRequest = (PVPTargetConfiguration) req;
return RequestManager.getInstance().handle(pvpRequest.request, httpReq, httpResp, moasession);
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java
index 1668c31ce..99cba3277 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java
@@ -46,6 +46,7 @@ import org.opensaml.saml2.metadata.KeyDescriptor;
import org.opensaml.saml2.metadata.NameIDFormat;
import org.opensaml.saml2.metadata.SingleSignOnService;
import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.security.SecurityHelper;
import org.opensaml.xml.security.credential.Credential;
import org.opensaml.xml.security.credential.UsageType;
import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
@@ -106,7 +107,7 @@ public class MetadataAction implements IAction {
.getIDPOrganisation());
X509KeyInfoGeneratorFactory keyInfoFactory = new X509KeyInfoGeneratorFactory();
- keyInfoFactory.setEmitPublicKeyValue(true);
+ //keyInfoFactory.setEmitPublicKeyValue(true);
keyInfoFactory.setEmitEntityIDAsKeyName(true);
keyInfoFactory.setEmitEntityCertificate(true);
KeyInfoGenerator keyInfoGenerator = keyInfoFactory.newInstance();
@@ -114,7 +115,10 @@ public class MetadataAction implements IAction {
Credential metadataSigningCredential = CredentialProvider.getIDPMetaDataSigningCredential();
Signature signature = CredentialProvider
.getIDPSignature(metadataSigningCredential);
-
+
+ //set KeyInfo Element
+ SecurityHelper.prepareSignatureParams(signature, metadataSigningCredential, null, null);
+
idpEntitiesDescriptor.setSignature(signature);
// //set SignatureMethode
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
index 84c0138a5..e81b23d41 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
@@ -40,6 +40,7 @@ import org.opensaml.saml2.core.Response;
import org.opensaml.saml2.core.Status;
import org.opensaml.saml2.core.StatusCode;
import org.opensaml.saml2.core.StatusMessage;
+import org.opensaml.saml2.core.impl.AuthnRequestImpl;
import org.opensaml.saml2.metadata.AssertionConsumerService;
import org.opensaml.saml2.metadata.AttributeConsumingService;
import org.opensaml.saml2.metadata.EntityDescriptor;
@@ -58,11 +59,14 @@ import at.gv.egovernment.moa.id.protocols.pvp2x.binding.IEncoder;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.MOARequest;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.PostBinding;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.RedirectBinding;
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.AuthnRequestValidatorException;
import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.MandateAttributesNotHandleAbleException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.NameIDFormatNotSupportedException;
import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.NoMetadataInformationException;
import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.PVP2Exception;
import at.gv.egovernment.moa.id.protocols.pvp2x.utils.CheckMandateAttributes;
import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils;
+import at.gv.egovernment.moa.id.protocols.pvp2x.validation.AuthnRequestValidator;
import at.gv.egovernment.moa.id.protocols.pvp2x.verification.SAMLVerificationEngine;
import at.gv.egovernment.moa.id.protocols.pvp2x.verification.TrustEngineFactory;
import at.gv.egovernment.moa.id.util.VelocityLogAdapter;
@@ -90,6 +94,8 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
actions.put(POST, new AuthenticationAction());
actions.put(METADATA, new MetadataAction());
+ //TODO: insert getArtifact action
+
instance = new PVP2XProtocol();
new VelocityLogAdapter();
@@ -167,7 +173,7 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
if(!(samlReq instanceof AuthnRequest)) {
throw new MOAIDException("Unsupported request", new Object[] {});
}
-
+
EntityDescriptor metadata = moaRequest.getEntityMetadata();
if(metadata == null) {
throw new NoMetadataInformationException();
@@ -201,7 +207,7 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
spSSODescriptor.getAttributeConsumingServices().size() > 0) {
attributeConsumer = spSSODescriptor.getAttributeConsumingServices().get(attributeIdx);
}
-
+
String oaURL = moaRequest.getEntityMetadata().getEntityID();
String binding = consumerService.getBinding();
// String entityID = moaRequest.getEntityMetadata().getEntityID();
@@ -223,12 +229,33 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
}
}
}
-
- request.getSession().setAttribute(PARAM_OA, oaURL);
+ //validate AuthnRequest
+ try {
+ AuthnRequestValidator.validate((AuthnRequestImpl) samlReq);
+
+ } catch (AuthnRequestValidatorException e) {
+ if (generateErrorMessage(e, request, response, config)) {
+ throw new AuthnRequestValidatorException(e.getMessage(),
+ new Object[] {}, config);
+
+ } else {
+ throw new MOAIDException(e.getMessage(), new Object[] {});
+
+ }
+ }
+
+ //request.getSession().setAttribute(PARAM_OA, oaURL);
+
return config;
- } catch (Exception e) {
- e.printStackTrace();
+
+ } catch (PVP2Exception e) {
+ throw e;
+
+ } catch (Throwable e) {
+ String samlRequest = request.getParameter("SAMLRequest");
+ Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
throw new MOAIDException(e.getMessage(), new Object[] {});
}
}
@@ -253,17 +280,23 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
StatusMessage statusMessage = SAML2Utils.createSAMLObject(StatusMessage.class);
if(e instanceof NoPassivAuthenticationException) {
statusCode.setValue(StatusCode.NO_PASSIVE_URI);
- statusMessage.setMessage(e.getLocalizedMessage());
+ statusMessage.setMessage(StringEscapeUtils.escapeXml(e.getLocalizedMessage()));
+
+ } else if (e instanceof NameIDFormatNotSupportedException) {
+ statusCode.setValue(StatusCode.INVALID_NAMEID_POLICY_URI);
+ statusMessage.setMessage(StringEscapeUtils.escapeXml(e.getLocalizedMessage()));
+
} else if(e instanceof PVP2Exception) {
PVP2Exception ex = (PVP2Exception) e;
statusCode.setValue(ex.getStatusCodeValue());
String statusMessageValue = ex.getStatusMessageValue();
if(statusMessageValue != null) {
- statusMessage.setMessage(statusMessageValue);
+ statusMessage.setMessage(StringEscapeUtils.escapeXml(statusMessageValue));
}
+
} else {
statusCode.setValue(StatusCode.RESPONDER_URI);
- statusMessage.setMessage(e.getLocalizedMessage());
+ statusMessage.setMessage(StringEscapeUtils.escapeXml(e.getLocalizedMessage()));
}
status.setStatusCode(statusCode);
@@ -271,7 +304,9 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
status.setStatusMessage(statusMessage);
}
samlResponse.setStatus(status);
-
+ String remoteSessionID = SAML2Utils.getSecureIdentifier();
+ samlResponse.setID(remoteSessionID);
+
IEncoder encoder = null;
if(pvpRequest.getBinding().equals(SAMLConstants.SAML2_REDIRECT_BINDING_URI)) {
@@ -288,7 +323,12 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
encoder = new RedirectBinding();
}
- encoder.encodeRespone(request, response, samlResponse, pvpRequest.getConsumerURL());
+ String relayState = null;
+ if (pvpRequest.getRequest() != null)
+ relayState = pvpRequest.getRequest().getRelayState();
+
+ encoder.encodeRespone(request, response, samlResponse, pvpRequest.getConsumerURL(),
+ relayState);
return true;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java
index 18d757208..b3887a444 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java
@@ -57,5 +57,4 @@ public class PVPTargetConfiguration extends RequestImpl {
this.consumerURL = consumerURL;
}
-
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/ArtifactBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/ArtifactBinding.java
index a0fba918c..43a17af23 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/ArtifactBinding.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/ArtifactBinding.java
@@ -55,7 +55,7 @@ public class ArtifactBinding implements IDecoder, IEncoder {
}
public void encodeRespone(HttpServletRequest req, HttpServletResponse resp,
- StatusResponseType response, String targetLocation)
+ StatusResponseType response, String targetLocation, String relayState)
throws MessageEncodingException, SecurityException {
try {
Credential credentials = CredentialProvider
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/IEncoder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/IEncoder.java
index 8b888e806..f7dfd055c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/IEncoder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/IEncoder.java
@@ -47,6 +47,6 @@ public interface IEncoder {
* @throws SecurityException
*/
public void encodeRespone(HttpServletRequest req,
- HttpServletResponse resp, StatusResponseType response, String targetLocation)
+ HttpServletResponse resp, StatusResponseType response, String targetLocation, String relayState)
throws MessageEncodingException, SecurityException, PVP2Exception;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/MOARequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/MOARequest.java
index d28c5eeec..11054fd57 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/MOARequest.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/MOARequest.java
@@ -24,27 +24,68 @@ package at.gv.egovernment.moa.id.protocols.pvp2x.binding;
import java.io.Serializable;
+import org.opensaml.Configuration;
import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.saml2.core.impl.RequestAbstractTypeMarshaller;
+import org.opensaml.saml2.core.impl.RequestAbstractTypeUnmarshaller;
import org.opensaml.saml2.metadata.EntityDescriptor;
+import org.opensaml.saml2.metadata.provider.MetadataProviderException;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallerFactory;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.w3c.dom.Element;
+
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.NoMetadataInformationException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.metadata.MOAMetadataProvider;
+import at.gv.egovernment.moa.logging.Logger;
public class MOARequest implements Serializable{
private static final long serialVersionUID = 2395131650841669663L;
- private RequestAbstractType samlRequest;
- private EntityDescriptor entityMetadata;
+ private Element samlRequest;
private boolean verified = false;
-
+ private String entityID = null;
+ private String relayState = null;
+
public MOARequest(RequestAbstractType request) {
- samlRequest = request;
+ samlRequest = request.getDOM();
}
public RequestAbstractType getSamlRequest() {
- return samlRequest;
+ UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
+ Unmarshaller unmashaller = unmarshallerFactory.getUnmarshaller(samlRequest);
+
+ try {
+ return (RequestAbstractType) unmashaller.unmarshall(samlRequest);
+
+ } catch (UnmarshallingException e) {
+ Logger.warn("AuthnRequest Unmarshaller error", e);
+ return null;
+ }
+
+ }
+
+
+
+ /**
+ * @return the relayState
+ */
+ public String getRelayState() {
+ return relayState;
+ }
+
+ /**
+ * @param relayState the relayState to set
+ */
+ public void setRelayState(String relayState) {
+ this.relayState = relayState;
}
public void setSamlRequest(RequestAbstractType request) {
- this.samlRequest = request;
+ this.samlRequest = request.getDOM();
}
public boolean isVerified() {
@@ -55,13 +96,29 @@ public class MOARequest implements Serializable{
this.verified = verified;
}
- public EntityDescriptor getEntityMetadata() {
- return entityMetadata;
+ public EntityDescriptor getEntityMetadata() throws NoMetadataInformationException {
+
+ try {
+ return MOAMetadataProvider.getInstance().getEntityDescriptor(this.entityID);
+
+ } catch (MetadataProviderException e) {
+ Logger.warn("No Metadata for EntitiyID " + entityID);
+ throw new NoMetadataInformationException();
+ }
}
- public void setEntityMetadata(EntityDescriptor entityMetadata) {
- this.entityMetadata = entityMetadata;
+ /**
+ * @return the entitiyID
+ */
+ public String getEntityID() {
+ return entityID;
+ }
+
+ /**
+ * @param entitiyID the entitiyID to set
+ */
+ public void setEntityID(String entitiyID) {
+ this.entityID = entitiyID;
}
-
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java
index af29054e1..6517325b9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java
@@ -26,7 +26,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.RuntimeConstants;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.binding.BasicSAMLMessageContext;
import org.opensaml.common.xml.SAMLConstants;
@@ -45,10 +44,13 @@ import org.opensaml.ws.transport.http.HttpServletResponseAdapter;
import org.opensaml.xml.parse.BasicParserPool;
import org.opensaml.xml.security.SecurityException;
import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.x509.KeyStoreX509CredentialAdapter;
+import org.opensaml.xml.security.x509.X509Credential;
import at.gv.egovernment.moa.id.protocols.pvp2x.metadata.MOAMetadataProvider;
import at.gv.egovernment.moa.id.protocols.pvp2x.signer.CredentialProvider;
import at.gv.egovernment.moa.id.protocols.pvp2x.signer.CredentialsNotAvailableException;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
import at.gv.egovernment.moa.logging.Logger;
public class PostBinding implements IDecoder, IEncoder {
@@ -61,27 +63,16 @@ public class PostBinding implements IDecoder, IEncoder {
}
public void encodeRespone(HttpServletRequest req, HttpServletResponse resp,
- StatusResponseType response, String targetLocation)
+ StatusResponseType response, String targetLocation, String relayState)
throws MessageEncodingException, SecurityException {
try {
- Credential credentials = CredentialProvider
+ X509Credential credentials = CredentialProvider
.getIDPAssertionSigningCredential();
Logger.debug("create SAML POSTBinding response");
- // VelocityEngine engine =
- // VelocityProvider.getClassPathVelocityEngine();
- VelocityEngine engine = new VelocityEngine();
- engine.setProperty(RuntimeConstants.ENCODING_DEFAULT, "UTF-8");
- engine.setProperty(RuntimeConstants.OUTPUT_ENCODING, "UTF-8");
- engine.setProperty(RuntimeConstants.ENCODING_DEFAULT, "UTF-8");
- engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
- engine.setProperty("classpath.resource.loader.class",
- "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
- engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
- "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
- engine.init();
+ VelocityEngine engine = VelocityProvider.getClassPathVelocityEngine();
HTTPPostEncoder encoder = new HTTPPostEncoder(engine,
"resources/templates/pvp_postbinding_template.html");
@@ -97,6 +88,7 @@ public class PostBinding implements IDecoder, IEncoder {
// context.setOutboundMessage(authReq);
context.setOutboundSAMLMessage(response);
context.setOutboundMessageTransport(responseAdapter);
+ context.setRelayState(relayState);
encoder.encode(context);
} catch (CredentialsNotAvailableException e) {
@@ -126,9 +118,12 @@ public class PostBinding implements IDecoder, IEncoder {
RequestAbstractType inboundMessage = (RequestAbstractType) messageContext
.getInboundMessage();
+
+
MOARequest request = new MOARequest(inboundMessage);
request.setVerified(false);
- request.setEntityMetadata(messageContext.getPeerEntityMetadata());
+ request.setEntityID(messageContext.getPeerEntityMetadata().getEntityID());
+ request.setRelayState(messageContext.getRelayState());
return request;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
index 7c9cc6259..dc6a1f637 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
@@ -48,6 +48,7 @@ import org.opensaml.ws.transport.http.HttpServletResponseAdapter;
import org.opensaml.xml.parse.BasicParserPool;
import org.opensaml.xml.security.SecurityException;
import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.x509.X509Credential;
import at.gv.egovernment.moa.id.protocols.pvp2x.PVP2XProtocol;
import at.gv.egovernment.moa.id.protocols.pvp2x.metadata.MOAMetadataProvider;
@@ -66,10 +67,10 @@ public class RedirectBinding implements IDecoder, IEncoder {
}
public void encodeRespone(HttpServletRequest req, HttpServletResponse resp,
- StatusResponseType response, String targetLocation)
+ StatusResponseType response, String targetLocation, String relayState)
throws MessageEncodingException, SecurityException {
try {
- Credential credentials = CredentialProvider
+ X509Credential credentials = CredentialProvider
.getIDPAssertionSigningCredential();
Logger.debug("create SAML RedirectBinding response");
@@ -131,7 +132,7 @@ public class RedirectBinding implements IDecoder, IEncoder {
.getInboundMessage();
MOARequest request = new MOARequest(inboundMessage);
request.setVerified(true);
- request.setEntityMetadata(messageContext.getPeerEntityMetadata());
+ request.setEntityID(messageContext.getPeerEntityMetadata().getEntityID());
return request;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/SoapBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/SoapBinding.java
index 9fe75618d..1d41654eb 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/SoapBinding.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/SoapBinding.java
@@ -83,7 +83,7 @@ public class SoapBinding implements IDecoder, IEncoder {
}
public void encodeRespone(HttpServletRequest req, HttpServletResponse resp,
- StatusResponseType response, String targetLocation)
+ StatusResponseType response, String targetLocation, String relayState)
throws MessageEncodingException, SecurityException, PVP2Exception {
try {
Credential credentials = CredentialProvider
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java
index bc90da8df..9def5d22c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java
@@ -22,6 +22,7 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.pvp2x.builder.assertion;
+import java.security.MessageDigest;
import java.util.Iterator;
import java.util.List;
@@ -43,6 +44,7 @@ import org.opensaml.saml2.core.RequestedAuthnContext;
import org.opensaml.saml2.core.Subject;
import org.opensaml.saml2.core.SubjectConfirmation;
import org.opensaml.saml2.core.SubjectConfirmationData;
+import org.opensaml.saml2.core.impl.AuthnRequestImpl;
import org.opensaml.saml2.metadata.AssertionConsumerService;
import org.opensaml.saml2.metadata.AttributeConsumingService;
import org.opensaml.saml2.metadata.EntityDescriptor;
@@ -51,6 +53,8 @@ import org.opensaml.saml2.metadata.RequestedAttribute;
import org.opensaml.saml2.metadata.SPSSODescriptor;
import org.w3c.dom.Element;
+import edu.emory.mathcs.backport.java.util.Arrays;
+
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.CorporateBodyType;
import at.gv.e_government.reference.namespace.persondata._20020228_.IdentificationType;
@@ -75,12 +79,14 @@ import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.UnprovideableAttribut
import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.id.util.QAALevelVerifier;
+import at.gv.egovernment.moa.id.util.Random;
import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.Constants;
public class PVP2AssertionBuilder implements PVPConstants {
public static Assertion buildAssertion(AuthnRequest authnRequest,
- AuthenticationSession authSession, EntityDescriptor peerEntity, DateTime date)
+ AuthenticationSession authSession, EntityDescriptor peerEntity, DateTime date, AssertionConsumerService assertionConsumerService)
throws MOAIDException {
Assertion assertion = SAML2Utils.createSAMLObject(Assertion.class);
@@ -95,77 +101,56 @@ public class PVP2AssertionBuilder implements PVPConstants {
peerEntity.getEntityID());
if (reqAuthnContext == null) {
- authnContextClassRef.setAuthnContextClassRef(STORK_QAA_1_4);
+ authnContextClassRef.setAuthnContextClassRef(authSession.getQAALevel());
- }
+ } else {
- boolean stork_qaa_1_4_found = false;
+ boolean stork_qaa_1_4_found = false;
- List<AuthnContextClassRef> reqAuthnContextClassRefIt = reqAuthnContext
- .getAuthnContextClassRefs();
+ List<AuthnContextClassRef> reqAuthnContextClassRefIt = reqAuthnContext
+ .getAuthnContextClassRefs();
- if (reqAuthnContextClassRefIt.size() == 0) {
+ if (reqAuthnContextClassRefIt.size() == 0) {
- QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
- STORK_QAA_1_4);
+ QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
+ STORK_QAA_1_4);
- stork_qaa_1_4_found = true;
- authnContextClassRef.setAuthnContextClassRef(STORK_QAA_1_4);
+ stork_qaa_1_4_found = true;
+ authnContextClassRef.setAuthnContextClassRef(STORK_QAA_1_4);
- } else {
- for (AuthnContextClassRef authnClassRef : reqAuthnContextClassRefIt) {
- String qaa_uri = authnClassRef.getAuthnContextClassRef();
- if (qaa_uri.trim().equals(STORK_QAA_1_4)
- || qaa_uri.trim().equals(STORK_QAA_1_3)
- || qaa_uri.trim().equals(STORK_QAA_1_2)
- || qaa_uri.trim().equals(STORK_QAA_1_1)) {
+ } else {
+ for (AuthnContextClassRef authnClassRef : reqAuthnContextClassRefIt) {
+ String qaa_uri = authnClassRef.getAuthnContextClassRef();
+ if (qaa_uri.trim().equals(STORK_QAA_1_4)
+ || qaa_uri.trim().equals(STORK_QAA_1_3)
+ || qaa_uri.trim().equals(STORK_QAA_1_2)
+ || qaa_uri.trim().equals(STORK_QAA_1_1)) {
- if (authSession.isForeigner()) {
- QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
- STORK_QAA_PREFIX + oaParam.getQaaLevel());
-
- stork_qaa_1_4_found = true;
- authnContextClassRef.setAuthnContextClassRef(authSession.getQAALevel());
-
- } else {
-
- QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
- qaa_uri.trim());
-
- stork_qaa_1_4_found = true;
- authnContextClassRef.setAuthnContextClassRef(authSession.getQAALevel());
-
+ if (authSession.isForeigner()) {
+ QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
+ STORK_QAA_PREFIX + oaParam.getQaaLevel());
+
+ stork_qaa_1_4_found = true;
+ authnContextClassRef.setAuthnContextClassRef(authSession.getQAALevel());
+
+ } else {
+
+ QAALevelVerifier.verifyQAALevel(authSession.getQAALevel(),
+ qaa_uri.trim());
+
+ stork_qaa_1_4_found = true;
+ authnContextClassRef.setAuthnContextClassRef(authSession.getQAALevel());
+
+ }
+ break;
}
- break;
}
}
- }
-
- if (!stork_qaa_1_4_found) {
- throw new QAANotSupportedException(STORK_QAA_1_4);
+
+ if (!stork_qaa_1_4_found) {
+ throw new QAANotSupportedException(STORK_QAA_1_4);
+ }
}
-
-// reqAuthnContextClassRefIt = reqAuthnContext.getAuthnContextClassRefs()
-// .iterator();
-//
-// StringBuilder authContextsb = new StringBuilder();
-//
-// while (reqAuthnContextClassRefIt.hasNext()) {
-// AuthnContextClassRef authnClassRef = reqAuthnContextClassRefIt
-// .next();
-// String[] qaa_uris = authnClassRef.getAuthnContextClassRef().split(
-// "\\s+");
-// for (int i = 0; i < qaa_uris.length; i++) {
-// if (qaa_uris[i].trim().equals(STORK_QAA_1_4)
-// || qaa_uris[i].trim().equals(STORK_QAA_1_3)
-// || qaa_uris[i].trim().equals(STORK_QAA_1_2)
-// || qaa_uris[i].trim().equals(STORK_QAA_1_1)) {
-// authContextsb.append(qaa_uris[i].trim());
-// authContextsb.append(" ");
-// }
-// }
-//
-// }
AuthnContext authnContext = SAML2Utils
.createSAMLObject(AuthnContext.class);
@@ -184,78 +169,61 @@ public class PVP2AssertionBuilder implements PVPConstants {
SPSSODescriptor spSSODescriptor = peerEntity
.getSPSSODescriptor(SAMLConstants.SAML20P_NS);
- Integer aIdx = authnRequest.getAttributeConsumingServiceIndex();
- int idx = 0;
-
- if (aIdx != null) {
- idx = aIdx.intValue();
-
- }
-
AttributeStatement attributeStatement = SAML2Utils
.createSAMLObject(AttributeStatement.class);
Subject subject = SAML2Utils.createSAMLObject(Subject.class);
- NameID subjectNameID = SAML2Utils.createSAMLObject(NameID.class);
- boolean foundFormat = false;
-
- // TL: AuthData generation is moved to Assertion generation.
-
- Iterator<NameIDFormat> formatIt = spSSODescriptor.getNameIDFormats()
- .iterator();
- while (formatIt.hasNext()) {
- if (formatIt.next().getFormat().equals(NameID.PERSISTENT)) {
- foundFormat = true;
- break;
- }
- }
- if (!foundFormat) {
- // TODO use correct exception
- throw new NameIDFormatNotSupportedException("");
- }
-
- // TODO: Check if we need to hide source pin
- /*
- * if(authSession.getUseMandate()) { Element mandate =
- * authSession.getMandate(); if(authSession.getBusinessService()) { //
- * Hide Source PIN! ParepUtils.HideStammZahlen(mandate, true, null,
- * authSession.getDomainIdentifier(), true); } else {
- * ParepUtils.HideStammZahlen(mandate, false, authSession.getTarget(),
- * null, true); } }
- */
AuthenticationData authData = AuthenticationServer
.buildAuthenticationData(authSession, oaParam,
oaParam.getTarget());
+ //add Attributes to Assertion
if (spSSODescriptor.getAttributeConsumingServices() != null &&
spSSODescriptor.getAttributeConsumingServices().size() > 0) {
- AttributeConsumingService attributeConsumingService = spSSODescriptor
- .getAttributeConsumingServices().get(idx);
+ Integer aIdx = authnRequest.getAttributeConsumingServiceIndex();
+ int idx = 0;
+
+ AttributeConsumingService attributeConsumingService = null;
- Iterator<RequestedAttribute> it = attributeConsumingService
- .getRequestAttributes().iterator();
- while (it.hasNext()) {
- RequestedAttribute reqAttribut = it.next();
- try {
- Attribute attr = PVPAttributeBuilder.buildAttribute(
- reqAttribut.getName(), authSession, oaParam, authData);
- if (attr == null) {
+ if (aIdx != null) {
+ idx = aIdx.intValue();
+ attributeConsumingService = spSSODescriptor
+ .getAttributeConsumingServices().get(idx);
+
+ } else {
+ List<AttributeConsumingService> attrConsumingServiceList = spSSODescriptor.getAttributeConsumingServices();
+ for (AttributeConsumingService el : attrConsumingServiceList) {
+ if (el.isDefault())
+ attributeConsumingService = el;
+ }
+ }
+
+ if (attributeConsumingService != null) {
+ Iterator<RequestedAttribute> it = attributeConsumingService
+ .getRequestAttributes().iterator();
+ while (it.hasNext()) {
+ RequestedAttribute reqAttribut = it.next();
+ try {
+ Attribute attr = PVPAttributeBuilder.buildAttribute(
+ reqAttribut.getName(), authSession, oaParam, authData);
+ if (attr == null) {
+ if (reqAttribut.isRequired()) {
+ throw new UnprovideableAttributeException(
+ reqAttribut.getName());
+ }
+ } else {
+ attributeStatement.getAttributes().add(attr);
+ }
+ } catch (PVP2Exception e) {
+ Logger.error(
+ "Attribute generation failed! for "
+ + reqAttribut.getFriendlyName(), e);
if (reqAttribut.isRequired()) {
throw new UnprovideableAttributeException(
reqAttribut.getName());
}
- } else {
- attributeStatement.getAttributes().add(attr);
- }
- } catch (PVP2Exception e) {
- Logger.error(
- "Attribute generation failed! for "
- + reqAttribut.getFriendlyName(), e);
- if (reqAttribut.isRequired()) {
- throw new UnprovideableAttributeException(
- reqAttribut.getName());
}
}
}
@@ -263,9 +231,9 @@ public class PVP2AssertionBuilder implements PVPConstants {
if (attributeStatement.getAttributes().size() > 0) {
assertion.getAttributeStatements().add(attributeStatement);
}
-
- subjectNameID.setFormat(NameID.PERSISTENT);
+ NameID subjectNameID = SAML2Utils.createSAMLObject(NameID.class);
+
//TLenz: set correct bPK Type and Value from AuthData
if (authSession.getUseMandate()) {
Element mandate = authSession.getMandate();
@@ -295,6 +263,7 @@ public class PVP2AssertionBuilder implements PVPConstants {
String bpktype = id.getType();
String bpk = id.getValue().getValue();
+
if (bpktype.equals(Constants.URN_PREFIX_BASEID)) {
if (authSession.getBusinessService()) {
subjectNameID.setValue(new BPKBuilder().buildWBPK(bpk, oaParam.getIdentityLinkDomainIdentifier()));
@@ -322,7 +291,52 @@ public class PVP2AssertionBuilder implements PVPConstants {
subjectNameID.setValue(authData.getBPK());
}
-
+ String nameIDFormat = NameID.TRANSIENT;
+
+ //get NameIDFormat from request
+ AuthnRequest authnReq = (AuthnRequestImpl) authnRequest;
+ if (authnReq.getNameIDPolicy() != null) {
+ nameIDFormat = authnReq.getNameIDPolicy().getFormat();
+
+ } else {
+ //get NameIDFormat from metadata
+ List<NameIDFormat> metadataNameIDFormats = spSSODescriptor.getNameIDFormats();
+
+ if (metadataNameIDFormats != null) {
+
+ for (NameIDFormat el : metadataNameIDFormats) {
+ if (NameID.PERSISTENT.equals(el.getFormat())) {
+ nameIDFormat = NameID.PERSISTENT;
+ break;
+
+ } else if (NameID.TRANSIENT.equals(el.getFormat()) ||
+ NameID.UNSPECIFIED.equals(el.getFormat()))
+ break;
+
+ }
+ }
+ }
+
+ if (NameID.TRANSIENT.equals(nameIDFormat) || NameID.UNSPECIFIED.equals(nameIDFormat)) {
+ String random = Random.nextRandom();
+ String nameID = subjectNameID.getValue();
+
+ try {
+ MessageDigest md = MessageDigest.getInstance("SHA-1");
+ byte[] hash = md.digest((nameID + random).getBytes("ISO-8859-1"));
+ subjectNameID.setValue(Base64Utils.encode(hash));
+ subjectNameID.setNameQualifier(null);
+ subjectNameID.setFormat(NameID.TRANSIENT);
+
+ } catch (Exception e) {
+ Logger.warn("PVP2 subjectNameID error", e);
+ throw new MOAIDException("pvp2.13", null, e);
+ }
+
+ } else
+ subjectNameID.setFormat(nameIDFormat);
+
+
subject.setNameID(subjectNameID);
SubjectConfirmation subjectConfirmation = SAML2Utils
@@ -332,16 +346,8 @@ public class PVP2AssertionBuilder implements PVPConstants {
.createSAMLObject(SubjectConfirmationData.class);
subjectConfirmationData.setInResponseTo(authnRequest.getID());
subjectConfirmationData.setNotOnOrAfter(date.plusMinutes(5));
-
- //TL: change from entityID to destination URL
- AssertionConsumerService consumerService = spSSODescriptor
- .getAssertionConsumerServices().get(idx);
-
- if (consumerService == null) {
- throw new InvalidAssertionConsumerServiceException(idx);
- }
-
- subjectConfirmationData.setRecipient(consumerService.getLocation());
+
+ subjectConfirmationData.setRecipient(assertionConsumerService.getLocation());
subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
@@ -357,7 +363,6 @@ public class PVP2AssertionBuilder implements PVPConstants {
conditions.setNotBefore(date);
conditions.setNotOnOrAfter(date.plusMinutes(5));
-// conditions.setNotOnOrAfter(new DateTime());
conditions.getAudienceRestrictions().add(audienceRestriction);
@@ -365,8 +370,6 @@ public class PVP2AssertionBuilder implements PVPConstants {
Issuer issuer = SAML2Utils.createSAMLObject(Issuer.class);
- //TODO: check!
- //change to entity value from entity name to IDP EntityID (URL)
issuer.setValue(PVPConfiguration.getInstance().getIDPPublicPath());
issuer.setFormat(NameID.ENTITY);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/EIDSTORKTOKEN.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/EIDSTORKTOKEN.java
index e3e33d6db..e8fba6af2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/EIDSTORKTOKEN.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/EIDSTORKTOKEN.java
@@ -22,15 +22,12 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes;
-import eu.stork.peps.auth.commons.IPersonalAttributeList;
-import eu.stork.peps.auth.commons.PersonalAttribute;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
-import at.gv.egovernment.moa.id.auth.stork.STORKConstants;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
import at.gv.egovernment.moa.id.data.AuthenticationData;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
-import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.MiscUtil;
public class EIDSTORKTOKEN implements IPVPAttributeBuilder {
@@ -46,27 +43,14 @@ public class EIDSTORKTOKEN implements IPVPAttributeBuilder {
throw new UnavailableAttributeException(EID_STORK_TOKEN_NAME);
} else {
- IPersonalAttributeList storkAttributes = authSession.getStorkAttributes();
-
- if ( storkAttributes == null ) {
+ String storkResponse = authSession.getStorkAuthnResponse();
+
+ if ( MiscUtil.isEmpty(storkResponse) ) {
throw new UnavailableAttributeException(EID_STORK_TOKEN_NAME);
- }
-
- try {
- PersonalAttribute attribut = storkAttributes.get(STORKConstants.EIDENTIFIER_NAME);
- ATT attr;
- if (attribut != null) {
-
- attr = g.buildStringAttribute(EID_STORK_TOKEN_FRIENDLY_NAME, EID_STORK_TOKEN_NAME, attribut.getValue().get(0));
- return attr;
-
- } else
- throw new UnavailableAttributeException(EID_STORK_TOKEN_NAME);
+ } else {
+ return g.buildStringAttribute(EID_STORK_TOKEN_FRIENDLY_NAME, EID_STORK_TOKEN_NAME, storkResponse);
- } catch (Exception e) {
- Logger.warn("Attribut " + EID_STORK_TOKEN_FRIENDLY_NAME + " generation error", e);
- throw new UnavailableAttributeException(EID_STORK_TOKEN_NAME);
}
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/MOADefaultSecurityConfigurationBootstrap.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/MOADefaultSecurityConfigurationBootstrap.java
index 1563ba9be..f878b95d3 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/MOADefaultSecurityConfigurationBootstrap.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/MOADefaultSecurityConfigurationBootstrap.java
@@ -25,6 +25,10 @@ package at.gv.egovernment.moa.id.protocols.pvp2x.config;
import org.opensaml.xml.encryption.EncryptionConstants;
import org.opensaml.xml.security.BasicSecurityConfiguration;
import org.opensaml.xml.security.DefaultSecurityConfigurationBootstrap;
+import org.opensaml.xml.security.credential.BasicKeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.x509.X509KeyInfoGeneratorFactory;
import org.opensaml.xml.signature.SignatureConstants;
/**
@@ -46,6 +50,25 @@ public class MOADefaultSecurityConfigurationBootstrap extends
return config;
}
+ protected static void populateKeyInfoGeneratorManager(
+ BasicSecurityConfiguration config) {
+ NamedKeyInfoGeneratorManager namedManager = new NamedKeyInfoGeneratorManager();
+ config.setKeyInfoGeneratorManager(namedManager);
+
+ namedManager.setUseDefaultManager(true);
+ KeyInfoGeneratorManager defaultManager = namedManager
+ .getDefaultManager();
+
+ BasicKeyInfoGeneratorFactory basicFactory = new BasicKeyInfoGeneratorFactory();
+ basicFactory.setEmitPublicKeyValue(true);
+
+ X509KeyInfoGeneratorFactory x509Factory = new X509KeyInfoGeneratorFactory();
+ x509Factory.setEmitEntityCertificate(true);
+
+ defaultManager.registerFactory(basicFactory);
+ defaultManager.registerFactory(x509Factory);
+ }
+
protected static void populateSignatureParams(
BasicSecurityConfiguration config) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/AuthnRequestValidatorException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/AuthnRequestValidatorException.java
new file mode 100644
index 000000000..7ed438471
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/AuthnRequestValidatorException.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, 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 at.gv.egovernment.moa.id.protocols.pvp2x.exceptions;
+
+import at.gv.egovernment.moa.id.moduls.IRequest;
+
+/**
+ * @author tlenz
+ *
+ */
+public class AuthnRequestValidatorException extends PVP2Exception {
+
+ private IRequest errorRequest = null;
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4939651000658508576L;
+
+ /**
+ * @param messageId
+ * @param parameters
+ */
+ public AuthnRequestValidatorException(String messageId, Object[] parameters) {
+ super(messageId, parameters);
+
+ }
+
+ public AuthnRequestValidatorException(String messageId, Object[] parameters, IRequest errorRequest) {
+ super(messageId, parameters);
+ this.errorRequest = errorRequest;
+
+ }
+
+ /**
+ * @return the errorRequest
+ */
+ public IRequest getErrorRequest() {
+ return errorRequest;
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/NameIDFormatNotSupportedException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/NameIDFormatNotSupportedException.java
index 5a393062f..b5facde34 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/NameIDFormatNotSupportedException.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/exceptions/NameIDFormatNotSupportedException.java
@@ -22,7 +22,7 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.pvp2x.exceptions;
-public class NameIDFormatNotSupportedException extends PVP2Exception {
+public class NameIDFormatNotSupportedException extends AuthnRequestValidatorException {
public NameIDFormatNotSupportedException(String nameIDFormat) {
super("pvp2.12", new Object[] {nameIDFormat});
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/ArtifactResolution.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/ArtifactResolution.java
index f84e6e588..04ef4cdbf 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/ArtifactResolution.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/ArtifactResolution.java
@@ -67,7 +67,7 @@ public class ArtifactResolution implements IRequestHandler {
response.setMessage(assertion.getSamlMessage());
response.setIssueInstant(new DateTime());
SoapBinding encoder = new SoapBinding();
- encoder.encodeRespone(req, resp, response, null);
+ encoder.encodeRespone(req, resp, response, null, null);
} catch (Exception e) {
Logger.error("Failed to resolve artifact", e);
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
index 229158778..fd7ff9885 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
@@ -58,6 +58,7 @@ import org.opensaml.xml.security.x509.X509Credential;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.ArtifactBinding;
import at.gv.egovernment.moa.id.protocols.pvp2x.binding.IEncoder;
@@ -85,32 +86,13 @@ public class AuthnRequestHandler implements IRequestHandler, PVPConstants {
throw new MOAIDException("pvp2.13", null);
}
+ //get basic information
AuthnRequest authnRequest = (AuthnRequest) obj.getSamlRequest();
- EntityDescriptor peerEntity = obj.getEntityMetadata();
-
- DateTime date = new DateTime();
-
- Assertion assertion = PVP2AssertionBuilder.buildAssertion(authnRequest, authSession, peerEntity, date);
-
- Response authResponse = SAML2Utils.createSAMLObject(Response.class);
-
- Issuer nissuer = SAML2Utils.createSAMLObject(Issuer.class);
-
- //change to entity value from entity name to IDP EntityID (URL)
- nissuer.setValue(PVPConfiguration.getInstance().getIDPPublicPath());
- nissuer.setFormat(NameID.ENTITY);
- authResponse.setIssuer(nissuer);
- authResponse.setInResponseTo(authnRequest.getID());
-
-
- //SAML2 response required IssueInstant
- authResponse.setIssueInstant(date);
-
- authResponse.setStatus(SAML2Utils.getSuccessStatus());
-
+ EntityDescriptor peerEntity = obj.getEntityMetadata();
SPSSODescriptor spSSODescriptor = peerEntity
.getSPSSODescriptor(SAMLConstants.SAML20P_NS);
+ //get AssertionConsumingService
Integer aIdx = authnRequest.getAssertionConsumerServiceIndex();
int idx = 0;
@@ -129,6 +111,31 @@ public class AuthnRequestHandler implements IRequestHandler, PVPConstants {
}
+ DateTime date = new DateTime();
+
+ //build Assertion
+ Assertion assertion = PVP2AssertionBuilder.buildAssertion(authnRequest, authSession, peerEntity, date, consumerService);
+
+ Response authResponse = SAML2Utils.createSAMLObject(Response.class);
+
+ Issuer nissuer = SAML2Utils.createSAMLObject(Issuer.class);
+
+ //change to entity value from entity name to IDP EntityID (URL)
+ nissuer.setValue(PVPConfiguration.getInstance().getIDPPublicPath());
+ nissuer.setFormat(NameID.ENTITY);
+ authResponse.setIssuer(nissuer);
+ authResponse.setInResponseTo(authnRequest.getID());
+
+ //set responseID
+ String remoteSessionID = SAML2Utils.getSecureIdentifier();
+ authResponse.setID(remoteSessionID);
+
+
+ //SAML2 response required IssueInstant
+ authResponse.setIssueInstant(date);
+
+ authResponse.setStatus(SAML2Utils.getSuccessStatus());
+
String oaURL = consumerService.getLocation();
//check, if metadata includes an encryption key
@@ -150,7 +157,8 @@ public class AuthnRequestHandler implements IRequestHandler, PVPConstants {
}
- if (encryptionCredentials != null) {
+ boolean isEncryptionActive = AuthConfigurationProvider.getInstance().isPVP2AssertionEncryptionActive();
+ if (encryptionCredentials != null && isEncryptionActive) {
//encrypt SAML2 assertion
try {
@@ -212,7 +220,7 @@ public class AuthnRequestHandler implements IRequestHandler, PVPConstants {
}
try {
- binding.encodeRespone(req, resp, authResponse, oaURL);
+ binding.encodeRespone(req, resp, authResponse, oaURL, obj.getRelayState());
// TODO add remoteSessionID to AuthSession ExternalPVPSessionStore
// Logger logger = new Logger();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
index e3e25b1a9..d95e21a0e 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
@@ -30,9 +30,11 @@ import org.opensaml.xml.security.credential.Credential;
import org.opensaml.xml.security.credential.UsageType;
import org.opensaml.xml.security.x509.BasicX509Credential;
import org.opensaml.xml.security.x509.KeyStoreX509CredentialAdapter;
+import org.opensaml.xml.security.x509.X509Credential;
import org.opensaml.xml.signature.Signature;
import org.opensaml.xml.signature.SignatureConstants;
+import at.gv.egovernment.moa.id.opemsaml.MOAKeyStoreX509CredentialAdapter;
import at.gv.egovernment.moa.id.protocols.pvp2x.config.PVPConfiguration;
import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils;
import at.gv.egovernment.moa.logging.Logger;
@@ -42,7 +44,7 @@ public class CredentialProvider {
private static KeyStore keyStore = null;
- public static Credential getIDPMetaDataSigningCredential()
+ public static X509Credential getIDPMetaDataSigningCredential()
throws CredentialsNotAvailableException {
PVPConfiguration config = PVPConfiguration.getInstance();
try {
@@ -51,7 +53,7 @@ public class CredentialProvider {
keyStore = KeyStoreUtils.loadKeyStore(config.getIDPKeyStoreFilename(),
config.getIDPKeyStorePassword());
- KeyStoreX509CredentialAdapter credentials = new KeyStoreX509CredentialAdapter(
+ MOAKeyStoreX509CredentialAdapter credentials = new MOAKeyStoreX509CredentialAdapter(
keyStore, config.getIDPKeyAliasMetadata(), config
.getIDPKeyPasswordMetadata().toCharArray());
@@ -64,7 +66,7 @@ public class CredentialProvider {
}
}
- public static Credential getIDPAssertionSigningCredential()
+ public static X509Credential getIDPAssertionSigningCredential()
throws CredentialsNotAvailableException {
PVPConfiguration config = PVPConfiguration.getInstance();
try {
@@ -72,12 +74,12 @@ public class CredentialProvider {
keyStore = KeyStoreUtils.loadKeyStore(config.getIDPKeyStoreFilename(),
config.getIDPKeyStorePassword());
- KeyStoreX509CredentialAdapter credentials = new KeyStoreX509CredentialAdapter(
+ MOAKeyStoreX509CredentialAdapter credentials = new MOAKeyStoreX509CredentialAdapter(
keyStore, config.getIDPKeyAliasAssertionSign(), config
.getIDPKeyPasswordAssertionSign().toCharArray());
-
+
credentials.setUsageType(UsageType.SIGNING);
- return credentials;
+ return (X509Credential) credentials;
} catch (Exception e) {
Logger.error("Failed to generate IDP Assertion Signing credentials");
e.printStackTrace();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/validation/AuthnRequestValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/validation/AuthnRequestValidator.java
new file mode 100644
index 000000000..ab8fab5d1
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/validation/AuthnRequestValidator.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, 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 at.gv.egovernment.moa.id.protocols.pvp2x.validation;
+
+import org.opensaml.saml2.core.AuthnRequest;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.saml2.core.NameIDPolicy;
+
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.AuthnRequestValidatorException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.NameIDFormatNotSupportedException;
+
+/**
+ * @author tlenz
+ *
+ */
+public class AuthnRequestValidator {
+
+ public static void validate(AuthnRequest req) throws AuthnRequestValidatorException{
+
+ //validate NameIDPolicy
+ NameIDPolicy nameIDPolicy = req.getNameIDPolicy();
+ if (nameIDPolicy != null) {
+ String nameIDFormat = nameIDPolicy.getFormat();
+
+ if ( !(nameIDFormat != null &&
+ (NameID.TRANSIENT.equals(nameIDFormat) ||
+ NameID.PERSISTENT.equals(nameIDFormat) ||
+ NameID.UNSPECIFIED.equals(nameIDFormat))) ) {
+
+ throw new NameIDFormatNotSupportedException(nameIDFormat);
+
+ }
+ }
+
+
+
+ }
+}
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 3f6495a1a..c337433b6 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
@@ -52,6 +52,13 @@ public class GetArtifactAction implements IAction {
String oaURL = (String) req.getOAURL();
String target = (String) req.getTarget();
+ String sourceID = null;
+ if (req instanceof SAML1RequestImpl) {
+ SAML1RequestImpl saml1req = (SAML1RequestImpl) req;
+ sourceID = saml1req.getSourceID();
+
+ }
+
try {
@@ -78,13 +85,13 @@ public class GetArtifactAction implements IAction {
// add other stork attributes to MOA assertion if available
if(null != session.getStorkAttributes()) {
List<ExtendedSAMLAttribute> moaExtendedSAMLAttibutes = STORKResponseProcessor.addAdditionalSTORKAttributes(session.getStorkAttributes());
- session.setExtendedSAMLAttributesOA(moaExtendedSAMLAttibutes);
+ session.getExtendedSAMLAttributesOA().addAll(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);
+ String samlArtifactBase64 = saml1server.BuildSAMLArtifact(session, oaParam, authData, sourceID);
if (AuthenticationSessionStoreage.isSSOSession(session.getSessionID())) {
String url = "RedirectServlet";
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
index 7c91026bf..6391860ff 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
@@ -165,7 +165,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
public String BuildSAMLArtifact(AuthenticationSession session,
OAAuthParameter oaParam,
- AuthenticationData authData)
+ AuthenticationData authData, String sourceID)
throws ConfigurationException, BuildException, AuthenticationException {
//Load SAML1 Parameter from OA config
@@ -326,7 +326,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
String samlArtifact = new SAMLArtifactBuilder().build(
session.getAuthURL(), Random.nextRandom(),
- saml1parameter.getSourceID());
+ sourceID);
storeAuthenticationData(samlArtifact, authData);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java
index e587ef0e1..b6a2ac0b6 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java
@@ -44,6 +44,7 @@ import at.gv.egovernment.moa.id.moduls.IRequest;
import at.gv.egovernment.moa.id.moduls.RequestImpl;
import at.gv.egovernment.moa.id.util.ParamValidatorUtils;
import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.egovernment.moa.util.URLEncoder;
public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants {
@@ -81,7 +82,7 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants {
public IRequest preProcess(HttpServletRequest request,
HttpServletResponse response, String action) throws MOAIDException {
- RequestImpl config = new RequestImpl();
+ SAML1RequestImpl config = new SAML1RequestImpl();
if (!AuthConfigurationProvider.getInstance().getAllowedProtocols().isSAML1Active()) {
Logger.info("SAML1 is deaktivated!");
@@ -95,19 +96,34 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants {
String target = (String) request.getParameter(PARAM_TARGET);
target = StringEscapeUtils.escapeHtml(target);
+ String sourceID = request.getParameter(PARAM_SOURCEID);
+ sourceID = StringEscapeUtils.escapeHtml(sourceID);
+
//the target parameter is used to define the OA in SAML1 standard
if (target != null && target.startsWith("http")) {
oaURL = target;
target = null;
}
+ if (MiscUtil.isEmpty(oaURL)) {
+ Logger.info("Receive SAML1 request with no OA parameter. Authentication STOPPED!");
+ throw new WrongParametersException("StartAuthentication", PARAM_OA,
+ "auth.12");
+
+ }
+
if (!ParamValidatorUtils.isValidOA(oaURL))
throw new WrongParametersException("StartAuthentication", PARAM_OA,
"auth.12");
+
config.setOAURL(oaURL);
Logger.info("Dispatch SAML1 Request: OAURL=" + oaURL);
+ if (!ParamValidatorUtils.isValidSourceID(sourceID))
+ throw new WrongParametersException("StartAuthentication", PARAM_SOURCEID, "auth.12");
+
+
//load Target only from OA config
OAAuthParameter oaParam = AuthConfigurationProvider.getInstance()
.getOnlineApplicationParameter(oaURL);
@@ -123,10 +139,12 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants {
new Object[] { oaURL });
}
+ config.setSourceID(sourceID);
+
config.setTarget(oaParam.getTarget());
- request.getSession().setAttribute(PARAM_OA, oaURL);
- request.getSession().setAttribute(PARAM_TARGET, oaParam.getTarget());
+// request.getSession().setAttribute(PARAM_OA, oaURL);
+// request.getSession().setAttribute(PARAM_TARGET, oaParam.getTarget());
return config;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
new file mode 100644
index 000000000..1d9e31674
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
@@ -0,0 +1,237 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+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.IAction;
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.id.storage.AssertionStorage;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * the AttributeCollector Action tries to get all requested attributes from a set of {@link AttributeProvider} Plugins.
+ * The class is called whenever the {@link AuthenticationRequest} Action is invoked and checks for missing attributes.
+ * Furthermore, the class can handle direct posts. That is when the class triggers an attribute query which needs user
+ * interaction, redirect to another portal, etc. The redirect will hit here and the class can continue to fetch attributes.
+ *
+ * TODO how do we treat mandatory and optional attributes?
+ */
+public class AttributeCollector implements IAction {
+
+ /**
+ * The Constant ARTIFACT_ID.
+ */
+ private static final String ARTIFACT_ID = "artifactId";
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#processRequest(at.gv.egovernment.moa.id.moduls.IRequest, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.auth.data.AuthenticationSession)
+ */
+ public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
+
+ // - fetch the container
+ String artifactId = (String) httpReq.getParameter(ARTIFACT_ID);
+ DataContainer container;
+ try {
+ container = AssertionStorage.getInstance().get(artifactId, DataContainer.class);
+ } catch (MOADatabaseException e) {
+ Logger.error("Error fetching incomplete Stork response from temporary storage. Most likely a timeout occured.", e);
+ throw new MOAIDException("stork.11", null);
+ }
+
+ // read configuration parameters of OA
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(container.getRequest().getAssertionConsumerServiceURL());
+ if (oaParam == null)
+ throw new AuthenticationException("stork.12", new Object[]{moasession.getPublicOAURLPrefix()});
+
+ // find the attribute provider plugin that can handle the response
+ IPersonalAttributeList newAttributes = null;
+ for (AttributeProvider current : AttributeProviderFactory.getConfiguredPlugins(oaParam.getStorkAPs()))
+ try {
+ newAttributes = current.parse(httpReq);
+
+ // stop as soon as we hit a capable plugin
+ break;
+ } catch (UnsupportedAttributeException e1) {
+ // the current provider cannot find anything familiar within the
+ // provided httpreq. Try the next one.
+ }
+
+ if (null == newAttributes) {
+ // we do not have a provider which is capable of fetching something
+ // from the received httpreq.
+ Logger.error("No attribute could be retrieved from the response the attribute provider gave us.");
+ }
+
+ // - insert the embedded attribute(s) into the container
+ addOrUpdateAll(container.getResponse().getPersonalAttributeList(), newAttributes);
+
+ // see if we need some more attributes
+ return processRequest(container, httpReq, httpResp, moasession, oaParam);
+ }
+
+ /**
+ * Checks if there are missing attributes and tries to fetch them. If there are no more attribute to fetch,
+ * this very method creates and sends the protocol result to the asking S-PEPS.
+ *
+ * @param container the {@link DataContainer} representing the status of the overall query.
+ * @return the string
+ * @throws MOAIDException
+ */
+ public String processRequest(DataContainer container, HttpServletRequest request, HttpServletResponse response, AuthenticationSession moasession, OAAuthParameter oaParam) throws MOAIDException {
+ // check if there are attributes we need to fetch
+
+ IPersonalAttributeList requestAttributeList = container.getRequest().getPersonalAttributeList();
+ IPersonalAttributeList responseAttributeList = container.getResponse().getPersonalAttributeList();
+ List<PersonalAttribute> missingAttributes = new ArrayList<PersonalAttribute>();
+ for (PersonalAttribute current : requestAttributeList)
+ if (!responseAttributeList.containsKey(current.getName()))
+ missingAttributes.add(current);
+
+ Logger.info("collecting attributes...");
+ Logger.debug("found " + missingAttributes.size() + " missing attributes");
+
+ // Try to get all missing attributes
+ try {
+ // for each attribute still missing
+ for (PersonalAttribute currentAttribute : missingAttributes) {
+
+ /*
+ * prefill attributes with "notAvailable". If we get them later, we override the value and status.
+ * This way, there is no error case in which an attribute is left unanswered.
+ */
+ IPersonalAttributeList aquiredAttributes = new PersonalAttributeList();
+ currentAttribute.setStatus("notAvailable");
+ aquiredAttributes.add((PersonalAttribute) currentAttribute.clone());
+ addOrUpdateAll(container.getResponse().getPersonalAttributeList(), aquiredAttributes);
+
+ // - check if we can find a suitable AttributeProvider Plugin
+ for (AttributeProvider currentProvider : AttributeProviderFactory.getConfiguredPlugins(oaParam.getStorkAPs())) {
+ try {
+ // - hand over control to the suitable plugin
+ Logger.info(currentProvider.getClass().getSimpleName() + " called to handle attribute '" + currentAttribute.getName() + "'");
+ aquiredAttributes = currentProvider.acquire(currentAttribute, container.getRequest().getSpCountry(), moasession);
+ Logger.info(currentProvider.getClass().getSimpleName() + " can handle attribute '" + currentAttribute.getName() + "'");
+ break;
+ } catch (UnsupportedAttributeException e) {
+ // ok, try the next attributeprovider
+ Logger.info(currentProvider.getClass().getSimpleName() + " could not handle attribute '" + currentAttribute.getName() + "'");
+ } catch (MOAIDException e) {
+ // the current plugin had an error. Try the next one.
+ Logger.info(currentProvider.getClass().getSimpleName() + " could not handle attribute '" + currentAttribute.getName() + "' due to an error");
+ }
+ }
+
+ // check if we could fetch the attribute
+ if (null == aquiredAttributes) {
+ // if not
+ Logger.error("We have no suitable plugin for obtaining the attribute '" + currentAttribute.getName() + "'");
+ } else
+ // else, update any existing attributes
+ addOrUpdateAll(container.getResponse().getPersonalAttributeList(), aquiredAttributes);
+ }
+ Logger.info("collecting attributes done");
+
+ // ask for consent if necessary
+ if(oaParam.isRequireConsentForStorkAttributes())
+ new ConsentEvaluator().requestConsent(container, response, oaParam);
+ else
+ new ConsentEvaluator().generateSTORKResponse(response, container);
+
+ return "12345"; // AssertionId
+
+ } catch (ExternalAttributeRequestRequiredException e) {
+ // the attribute request is ongoing and requires an external service.
+ try {
+ // memorize the container again
+ Logger.debug("prepare putting the container into temporary storage...");
+
+ // - generate new key
+ String newArtifactId = new SecureRandomIdentifierGenerator()
+ .generateIdentifier();
+ // - put container in temporary store.
+ AssertionStorage.getInstance().put(newArtifactId, container);
+
+ Logger.debug("...successful");
+
+ Logger.info(e.getAp().getClass().getSimpleName() + " is going to ask an external service provider for the requested attributes");
+ // add container-key to redirect embedded within the return URL
+ e.getAp().performRedirect(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/ResumeAuthentication?" + ARTIFACT_ID + "=" + newArtifactId, request, response, oaParam);
+
+ } catch (Exception e1) {
+ // TODO should we return the response as is to the PEPS?
+ Logger.error("Error putting incomplete Stork response into temporary storage", e1);
+ e1.printStackTrace();
+ throw new MOAIDException("stork.11", null);
+ }
+
+ return "12345"; // TODO what to do here?
+ }
+ }
+
+ /**
+ * Adds or updates all {@link PersonalAttribute} objects given in {@code source} to/in {@code target}.
+ *
+ * @param target the target
+ * @param source the source
+ * @throws MOAIDException
+ */
+ private void addOrUpdateAll(IPersonalAttributeList target, IPersonalAttributeList source) throws MOAIDException {
+ Logger.debug("Updating " + source.size() + " attributes...");
+ for (PersonalAttribute current : source) {
+ Logger.trace("treating " + current.getName());
+
+ // check if we need to update the current pa
+ if (target.containsKey(current.getName())) {
+ PersonalAttribute existing = target.get(current.getName());
+ if(!(existing.isEmptyValue() && existing.isEmptyComplexValue()))
+ if(!(existing.getValue().equals(current.getValue()) || existing.getComplexValue().equals(current.getComplexValue()))) {
+ Logger.error("Attribute Value does not match the value from first authentication!");
+ throw new MOAIDException("stork.16", new Object[] {existing.getName()});
+ }
+
+ target.get(current.getName()).setStatus(current.getStatus());
+ target.get(current.getName()).setValue(current.getValue());
+ target.get(current.getName()).setComplexValue(current.getComplexValue());
+ } else
+ target.add(current);
+
+ Logger.trace("...successfully treated " + current.getName());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#needAuthentication(at.gv.egovernment.moa.id.moduls.IRequest, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+ */
+ public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp) {
+ // this action does not need any authentication. The authentication is already done by the preceding AuthenticationRequest-Action.
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#getDefaultActionName()
+ */
+ public String getDefaultActionName() {
+ return STORKProtocol.ATTRIBUTE_COLLECTOR;
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java
new file mode 100644
index 000000000..2914d8f7d
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProvider.java
@@ -0,0 +1,56 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * An {@link AttributeProvider} can fetch a set of stork attributes. It might complete the query within one method call,
+ * but might also need to redirect to another webservice to accomplish its task.
+ */
+public interface AttributeProvider {
+
+ /**
+ * Acquire the specified attribute. Returns {@code null} when attribute retrieval is in progress, but requires for
+ * for redirecting the user to an external service. Use {@link AttributeProvider#parse(HttpServletRequest)} to parse
+ * the response.
+ *
+ * @param attributes the list of attributes to be acquired
+ * @param spCountyCode the sp county code
+ * @param moasession the moasession
+ * @return the personal attribute
+ * @throws UnsupportedAttributeException the unsupported attribute exception
+ * @throws ExternalAttributeRequestRequiredException an attribute request to an external service has to be done
+ * @throws MOAIDException the mOAID exception
+ */
+ public IPersonalAttributeList acquire(PersonalAttribute attributes, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException;
+
+ /**
+ * Perform redirect.
+ *
+ * @param url the return URL ending with ?artifactId=...
+ * @param req the request we got from the S-PEPS and for which we have to ask our APs
+ * @param resp the response to the preceding request
+ * @param oaParam the oa param
+ * @throws MOAIDException the mOAID exception
+ */
+ public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException;
+
+ /**
+ * Parses the response we got from the external attribute provider.
+ *
+ * @param httpReq the http req
+ * @return a list of attributes
+ * @throws UnsupportedAttributeException if the provider cannot find anything familiar in the provided httpReq
+ * @throws MOAIDException if something went wrong
+ */
+ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws UnsupportedAttributeException, MOAIDException;
+
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
new file mode 100644
index 000000000..a339cff23
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
@@ -0,0 +1,73 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
+import at.gv.egovernment.moa.logging.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A factory for creating AttributeProvider objects.
+ */
+public class AttributeProviderFactory {
+
+ /**
+ * Gets the available plugins.
+ *
+ * @return the available plugins
+ */
+ public static List<String> getAvailablePlugins() {
+ List<String> result = new ArrayList<String>();
+ result.add("StorkAttributeRequestProvider");
+ result.add("EHvdAttributeProvider");
+ result.add("SignedDocAttributeRequestProvider");
+ result.add("MandateAttributeRequestProvider");
+
+ return result;
+ }
+
+ /**
+ * Creates an AttributeProvider object for the given shortname. Returns
+ * {@code null} if there is no such provider available.
+ *
+ * @param shortname the simpleName for the providers class
+ * @return the attribute provider
+ */
+ public static AttributeProvider create(String shortname, String url, String attributes) {
+ if (shortname.equals("StorkAttributeRequestProvider")) {
+ return new StorkAttributeRequestProvider(url, attributes);
+ } else if (shortname.equals("EHvdAttributeProvider")) {
+ return new EHvdAttributeProviderPlugin(url, attributes);
+ } else if (shortname.equals("SignedDocAttributeRequestProvider")) {
+ return new SignedDocAttributeRequestProvider(url, attributes);
+ } else if (shortname.equals("MandateAttributeRequestProvider")) {
+ try {
+ return new MandateAttributeRequestProvider(url, attributes);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Gets fresh instances of the configured plugins.
+ *
+ * @param configuredAPs the configured a ps
+ * @return the configured plugins
+ */
+ public static List<AttributeProvider> getConfiguredPlugins(
+ List<AttributeProviderPlugin> configuredAPs) {
+
+ List<AttributeProvider> result = new ArrayList<AttributeProvider>();
+ for (AttributeProviderPlugin current : configuredAPs) {
+
+ result.add(create(current.getName(), current.getUrl(), current.getAttributes()));
+ Logger.debug("Adding configured attribute provider: " + current.getClass().getName() + current.getName() + " at " + current.getUrl());
+ }
+
+ return result;
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java
new file mode 100644
index 000000000..5e49fe413
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java
@@ -0,0 +1,201 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+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.IAction;
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.*;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+import org.joda.time.DateTime;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * Second request step - after authentication of the user is done and moasession obtained,
+ * process request and forward the user further to PEPS and/or other entities
+ *
+ * @author bsuzic
+ */
+
+public class AuthenticationRequest implements IAction {
+
+
+ private VelocityEngine velocityEngine;
+ private AuthenticationSession moaSession = null;
+ private MOASTORKRequest moaStorkRequest = null;
+
+
+ public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
+
+ this.moaSession = moasession;
+
+ if (req instanceof MOASTORKRequest) {
+
+ this.moaStorkRequest = (MOASTORKRequest) req;
+
+ Logger.debug("Entering MOASTORKRequest");
+ httpResp.reset();
+
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix());
+ if (oaParam == null)
+ throw new AuthenticationException("stork.12", new Object[]{moasession.getPublicOAURLPrefix()});
+
+ MOASTORKResponse moaStorkResponse = new MOASTORKResponse();
+
+ // check if it is attribute query
+ if (moaStorkRequest.isAttrRequest()) {
+ Logger.debug("Starting AttrQueryRequest");
+
+ moaStorkResponse.setSTORKAttrResponse(new STORKAttrQueryResponse());
+ }
+ // check if we have authentication request
+ else if (moaStorkRequest.isAuthnRequest()) {
+ Logger.debug("Starting AuthenticationRequest");
+ moaStorkResponse.setSTORKAuthnResponse(new STORKAuthnResponse());
+
+
+ STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP");
+
+ Logger.debug("Starting generation of SAML response");
+ try {
+ moaStorkResponse.setSTORKAuthnResponse(engine.generateSTORKAuthnResponse(moaStorkRequest.getStorkAuthnRequest(), moaStorkResponse.getStorkAuthnResponse(),httpReq.getRemoteAddr(), false));
+ } catch (STORKSAMLEngineException ex) {
+ // TODO
+ }
+
+ // Get personal attributtes from MOA/IdentityLink
+ moaStorkResponse.setPersonalAttributeList(populateAttributes());
+
+
+ }
+
+ //moaStorkResponse.setCountry(moaStorkRequest.getSpCountry());
+
+ // Prepare extended attributes
+ Logger.debug("Preparing data container");
+
+ // create fresh container
+ DataContainer container = new DataContainer();
+
+ // - fill in the request we extracted above
+ container.setRequest(moaStorkRequest);
+
+ // - fill in the partial response created above
+ container.setResponse(moaStorkResponse);
+
+ container.setRemoteAddress(httpReq.getRemoteAddr());
+
+
+ STORKAuthnResponse arep = moaStorkResponse.getStorkAuthnResponse();
+
+
+ arep.setCountry("XX");
+ arep.setInResponseTo("xxxx");
+ arep.setMessage("xxxx");
+ arep.setSamlId("xxxx");
+ arep.setStatusCode("xxxx");
+
+ // arep.setNotBefore(new DateTime().withTimeAtStartOfDay());
+ // arep.setNotOnOrAfter(new DateTime().withTimeAtStartOfDay());
+
+
+ Logger.debug("Data container prepared");
+
+ return (new AttributeCollector()).processRequest(container, httpReq, httpResp, moasession, oaParam);
+ } else {
+ Logger.error("Could not recognize request.");
+ throw new MOAIDException("stork.15", null);
+ }
+ }
+
+ public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp) {
+ return true;
+ }
+
+
+ private void iterate(NamedNodeMap attributesList) {
+ for (int j = 0; j < attributesList.getLength(); j++) {
+ Logger.debug("--Attribute: "
+ + attributesList.item(j).getNodeName() + " = "
+ + attributesList.item(j).getNodeValue());
+ }
+ }
+
+
+ // does nothing
+ public void mandate(AuthenticationSession moasession) {
+
+ if (moasession.getUseMandate()) {
+ try {
+ MISMandate mandate = moasession.getMISMandate();
+ String owbpk = mandate.getOWbPK();
+ byte[] mand = mandate.getMandate();
+ String profprep = mandate.getProfRep();
+ //String textdesc = mandate.getTextualDescriptionOfOID();
+ Element mndt = moasession.getMandate();
+
+ iterate(mndt.getAttributes());
+ Logger.debug("mandate encoded: " + new String(org.bouncycastle.util.encoders.Base64.encode(mand)));
+ } catch (Exception x) {
+ Logger.debug("There is no mandate used in transaction");
+ }
+ }
+
+
+ }
+
+ public PersonalAttributeList populateAttributes() {
+
+ IPersonalAttributeList attrLst = moaStorkRequest.getStorkAuthnRequest().getPersonalAttributeList();
+ Logger.info("Found " + attrLst.size() + " personal attributes in the request.");
+
+ // Define attribute list to be populated
+ PersonalAttributeList attributeList = new PersonalAttributeList();
+ MOAAttributeProvider moaAttributeProvider = new MOAAttributeProvider(moaSession.getIdentityLink(), moaStorkRequest);
+
+ try {
+ for (PersonalAttribute personalAttribute : attrLst) {
+ Logger.debug("Personal attribute found in request: " + personalAttribute.getName() + " isRequired: " + personalAttribute.isRequired());
+ moaAttributeProvider.populateAttribute(attributeList, personalAttribute);
+ }
+ } catch (Exception e) {
+ Logger.error("Exception, attributes: " + e.getMessage());
+ }
+
+ Logger.debug("AUTHBLOCK " + moaSession.getAuthBlock());
+ Logger.debug("TARGET " + moaSession.getTarget() + " " + moaSession.getTargetFriendlyName());
+ Logger.debug("SESSION IDENTIFIER " + moaSession.getCcc() + " " + moaSession.getDomainIdentifier());
+ Logger.debug("AUTHBLOCKTOKKEN" + moaSession.getAuthBlockTokken());
+
+ return attributeList;
+ }
+
+ public String getDefaultActionName() {
+ return STORKProtocol.AUTHENTICATIONREQUEST;
+ }
+
+
+ private void initVelocityEngine() throws Exception {
+ velocityEngine = new VelocityEngine();
+ velocityEngine.setProperty(RuntimeConstants.ENCODING_DEFAULT, "UTF-8");
+ velocityEngine.setProperty(RuntimeConstants.OUTPUT_ENCODING, "UTF-8");
+ velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
+ velocityEngine.setProperty("classpath.resource.loader.class",
+ "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+
+ velocityEngine.init();
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java
new file mode 100644
index 000000000..9a3376e4c
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java
@@ -0,0 +1,208 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+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.IAction;
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.id.storage.AssertionStorage;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.joda.time.DateTime;
+import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * The ConsentEvaluator assists with fetching user consent on the list of attributes to be sent to the asking S-PEPS.
+ */
+public class ConsentEvaluator implements IAction {
+
+ /**
+ * The Constant ARTIFACT_ID.
+ */
+ private static final String ARTIFACT_ID = "artifactId";
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#processRequest(at.gv.egovernment.moa.id.moduls.IRequest, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.auth.data.AuthenticationSession)
+ */
+ public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
+
+ // - fetch the container
+ String artifactId = (String) httpReq.getParameter(ARTIFACT_ID);
+ DataContainer container;
+ try {
+ container = AssertionStorage.getInstance().get(artifactId, DataContainer.class);
+ } catch (MOADatabaseException e) {
+ Logger.error("Error fetching incomplete Stork response from temporary storage. Most likely a timeout occured.", e);
+ throw new MOAIDException("stork.17", null);
+ }
+
+ // evaluate response
+ for(PersonalAttribute current : container.getResponse().getPersonalAttributeList()) {
+ if(null == httpReq.getParameter(current.getName())) {
+ current.setStatus("notAvailable");
+ current.setValue(new ArrayList<String>());
+ current.setComplexValue(new HashMap<String, String>());
+ }
+ }
+
+ // build and send response
+ generateSTORKResponse(httpResp, container);
+
+ return "12345"; // AssertionId
+ }
+
+ /**
+ * Fills the given HttpResponse with the required web page.
+ *
+ * @param container the container
+ * @param response the response
+ * @param oaParam the oa param
+ * @return the string
+ * @throws MOAIDException the mOAID exception
+ */
+ public String requestConsent(DataContainer container, HttpServletResponse response, OAAuthParameter oaParam) throws MOAIDException {
+ // prepare redirect
+ String newArtifactId;
+ try {
+
+ // memorize the container again
+ Logger.debug("prepare putting the container into temporary storage...");
+
+ // - generate new key
+ newArtifactId = new SecureRandomIdentifierGenerator().generateIdentifier();
+
+ // - put container in temporary store.
+ AssertionStorage.getInstance().put(newArtifactId, container);
+
+ Logger.debug("...successful");
+
+ } catch (Exception e1) {
+ // TODO should we return the response as is to the PEPS?
+ e1.printStackTrace();
+ Logger.error("Error putting incomplete Stork response into temporary storage", e1);
+ throw new MOAIDException("stork.17", null);
+ }
+
+ // ask for consent
+ try {
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ Template template = velocityEngine.getTemplate("/resources/templates/stork2_consent.html");
+ VelocityContext context = new VelocityContext();
+
+ context.put("action", AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/CompleteAuthentication?" + ARTIFACT_ID + "=" + newArtifactId);
+
+ // assemble table
+ String table = "";
+ for (PersonalAttribute current : container.getResponse().getPersonalAttributeList())
+ if ("Available".equals(current.getStatus()))
+ table += "<tr><td><input type=\"checkbox\" checked=\"yes\" name=\"" + current.getName() + "\"></td><td>" + current.getName() + "</td></tr>\n";
+
+ context.put("tablecontent", table);
+
+ StringWriter writer = new StringWriter();
+ template.merge(context, writer);
+ response.getOutputStream().write(writer.getBuffer().toString().getBytes());
+
+ } catch (Exception e) {
+ Logger.error("Velocity error: " + e.getMessage());
+ throw new MOAIDException("stork.17", null);
+ }
+
+ return "12345"; // AssertionId
+ }
+
+ /**
+ * generates binary response from given response class and fill the given HttpResponse with a SAML Post Binding template.
+ *
+ * @param httpResp the http resp
+ * @param container the container
+ * @throws MOAIDException the mOAID exception
+ */
+ public void generateSTORKResponse(HttpServletResponse httpResp, DataContainer container) throws MOAIDException {
+ MOASTORKRequest request = container.getRequest();
+ MOASTORKResponse response = container.getResponse();
+
+ Logger.info("generating stork response...");
+
+ try {
+ //Get SAMLEngine instance
+ STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP");
+ Logger.debug("Starting generation of SAML response");
+ if(response.isAuthnResponse())
+ response.setSTORKAuthnResponse(engine.generateSTORKAuthnResponse(request.getStorkAuthnRequest(), response.getStorkAuthnResponse(), container.getRemoteAddress(), false));
+ else
+ response.setSTORKAttrResponse(engine.generateSTORKAttrQueryResponse(request.getStorkAttrQueryRequest(), response.getStorkAttrQueryResponse(), container.getRemoteAddress(), "", false));
+
+
+ //generateSAML Token
+ Logger.info("SAML response succesfully generated!");
+ } catch (STORKSAMLEngineException e) {
+ Logger.error("Failed to generate STORK SAML Response", e);
+ throw new MOAIDException("stork.05", null);
+ }
+
+ // preparing redirection for the client
+ try {
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ Template template = velocityEngine.getTemplate("/resources/templates/stork2_postbinding_template.html");
+ VelocityContext context = new VelocityContext();
+
+ byte[] blob;
+ if(request.isAttrRequest())
+ blob = response.getStorkAttrQueryResponse().getTokenSaml();
+ else
+ blob = response.getStorkAuthnResponse().getTokenSaml();
+
+ context.put("SAMLResponse", PEPSUtil.encodeSAMLToken(blob));
+ Logger.debug("SAMLResponse original: " + new String(blob));
+
+ Logger.debug("Putting assertion consumer url as action: " + request.getAssertionConsumerServiceURL());
+ context.put("action", request.getAssertionConsumerServiceURL());
+ Logger.debug("Starting template merge");
+ StringWriter writer = new StringWriter();
+
+ Logger.debug("Doing template merge");
+ template.merge(context, writer);
+ Logger.debug("Template merge done");
+
+ Logger.debug("Sending html content: " + writer.getBuffer().toString());
+ Logger.debug("Sending html content2 : " + new String(writer.getBuffer()));
+
+ httpResp.getOutputStream().write(writer.getBuffer().toString().getBytes());
+
+ } catch (Exception e) {
+ Logger.error("Velocity error: " + e.getMessage());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#needAuthentication(at.gv.egovernment.moa.id.moduls.IRequest, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+ */
+ public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp) {
+ // this action does not need any authentication. The authentication is already done by the preceding AuthenticationRequest-Action.
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IAction#getDefaultActionName()
+ */
+ public String getDefaultActionName() {
+ return STORKProtocol.CONSENT_EVALUATOR;
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DataContainer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DataContainer.java
new file mode 100644
index 000000000..d13754aff
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/DataContainer.java
@@ -0,0 +1,78 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.Serializable;
+
+/**
+ * Holds info about an ongoing but yet incomplete stork authnrequest process.
+ */
+public class DataContainer implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -8765997480582363012L;
+
+ /** The incoming request. */
+ private MOASTORKRequest request;
+
+ /** The yet incomplete response. */
+ private MOASTORKResponse response;
+
+ /** The target. */
+ private String target;
+
+ /** The remote address. */
+ private String remoteAddress;
+
+ /**
+ * Gets the request.
+ *
+ * @return the request
+ */
+ public MOASTORKRequest getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the request.
+ *
+ * @param moaStorkRequest the new request
+ */
+ public void setRequest(MOASTORKRequest moaStorkRequest) {
+ this.request = moaStorkRequest;
+ }
+
+ /**
+ * Gets the response.
+ *
+ * @return the response
+ */
+ public MOASTORKResponse getResponse() {
+ return response;
+ }
+
+ /**
+ * Sets the response.
+ *
+ * @param moaStorkResponse the new response
+ */
+ public void setResponse(MOASTORKResponse moaStorkResponse) {
+ this.response = moaStorkResponse;
+ }
+
+ /**
+ * Gets the remote address.
+ *
+ * @return the remote address
+ */
+ public String getRemoteAddress() {
+ return remoteAddress;
+ }
+
+ /**
+ * Sets the remote address.
+ *
+ * @param remoteAddress the new remote address
+ */
+ public void setRemoteAddress(String remoteAddress) {
+ this.remoteAddress = remoteAddress;
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java
new file mode 100644
index 000000000..5e9d9404c
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java
@@ -0,0 +1,222 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.complex.attributes.IsHealthCareProfessionalType;
+import eu.stork.peps.complex.attributes.ObjectFactory;
+
+/**
+ * Fetches the attribute IsHealthcareProfessional from the BAGDAD SOAP service
+ */
+public class EHvdAttributeProviderPlugin implements AttributeProvider {
+
+ /** The destination. */
+ private Object destination;
+
+ /** The attributes. */
+ private String attributes;
+
+ /**
+ * Instantiates a new e hvd attribute provider plugin.
+ *
+ * @param url the service url
+ * @param attributes
+ */
+ public EHvdAttributeProviderPlugin(String url, String supportedAttributes) {
+ destination = url;
+ attributes = supportedAttributes;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(eu.stork.peps.auth.commons.PersonalAttribute)
+ */
+ public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountryCode, AuthenticationSession moasession)
+ throws UnsupportedAttributeException,
+ ExternalAttributeRequestRequiredException, MOAIDException {
+
+ // break when we cannot handle the requested attribute
+ if(!attributes.contains(attribute.getName()))
+ throw new UnsupportedAttributeException();
+
+ try {
+ Logger.debug("initializing SOAP connections...");
+ // create SOAP connection
+ SOAPConnection soapConnection = SOAPConnectionFactory.newInstance().createConnection();
+
+ // assemble SOAP request
+ MessageFactory messageFactory = MessageFactory.newInstance();
+ SOAPMessage requestMessage = messageFactory.createMessage();
+ SOAPPart requestPart = requestMessage.getSOAPPart();
+
+ // (soap 1.1 relevant part. could not find a solution to use soap 1.2 in time.
+ requestMessage.getMimeHeaders().setHeader("SOAPAction", "http://gesundheit.gv.at/BAGDAD/DataAccessService/IsHealthcareProfessional");
+
+ /*
+ Construct SOAP Request Message:
+ <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body>
+ <IsHealthcareProfessional xmlns="http://gesundheit.gv.at/BAGDAD/DataAccessService">
+ <bPK>string</bPK>
+ </IsHealthcareProfessional>
+ </soap:Body>
+ </soap:Envelope>
+
+ see https://stork.ehealth.gv.at/GDAService.asmx?op=IsHealthcareProfessional
+ */
+
+ // SOAP Envelope
+ SOAPEnvelope envelope = requestPart.getEnvelope();
+
+ // SOAP Body
+ SOAPBody requestBody = envelope.getBody();
+ SOAPElement requestBodyElem = requestBody.addChildElement("IsHealthcareProfessional");
+ requestBodyElem.addAttribute(envelope.createName("xmlns"), "http://gesundheit.gv.at/BAGDAD/DataAccessService");
+
+ SOAPElement requestBodyElem1 = requestBodyElem.addChildElement("bPK");
+ requestBodyElem1.addTextNode(new BPKBuilder().buildBPK(moasession.getIdentityLink().getIdentificationValue(), "GH"));
+
+ requestMessage.saveChanges();
+
+ // perform SOAP call
+ Logger.debug("call...");
+ SOAPMessage responseMessage = soapConnection.call(requestMessage, destination);
+
+ // parse SOAP response
+
+ /*
+ <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Body>
+ <IsHealthcareProfessionalResponse xmlns="http://gesundheit.gv.at/BAGDAD/DataAccessService">
+ <IsHealthcareProfessionalResult>
+ <RequestOK>boolean</RequestOK>
+ <Message>string</Message>
+ <IsHealthcareProfessional>boolean</IsHealthcareProfessional>
+ <NameOfOrganisation>string</NameOfOrganisation>
+ <Type>string</Type>
+ <Specialization>string</Specialization>
+ </IsHealthcareProfessionalResult>
+ </IsHealthcareProfessionalResponse>
+ </soap:Body>
+ </soap:Envelope>
+
+ see https://stork.ehealth.gv.at/GDAService.asmx?op=IsHealthcareProfessional
+ */
+ Logger.debug("call successful. Parse...");
+ SOAPBody responseBody = responseMessage.getSOAPBody();
+
+ // iterate through tree
+ SOAPElement responseElement = (SOAPElement) responseBody.getChildElements().next();
+ SOAPElement resultElement = (SOAPElement) responseElement.getChildElements().next();
+
+ // collect all info in a map
+ Iterator<?> it = resultElement.getChildElements();
+ Map<String, String> collection = new HashMap<String, String>();
+ while (it.hasNext()) {
+ SOAPElement current = (SOAPElement) it.next();
+
+ collection.put(current.getNodeName(), current.getTextContent());
+ }
+
+ // check if there is anything valid in the map
+ if (collection.isEmpty() || collection.size() != 6) {
+ Logger.warn("eHVD returned an unexpected count of values. Expected 6 got " + collection.size());
+ throw new IndexOutOfBoundsException("response attributes not like specified");
+ }
+
+ // - fetch request validity
+ if (collection.get("RequestOK").equals("false")) {
+ Logger.warn("eHVD reported an invalid request. The error message is: " + collection.get("Message"));
+ throw new Exception("eHVD reported an invalid request");
+ }
+
+ PersonalAttribute acquiredAttribute = null;
+
+ if (collection.get("IsHealthcareProfessional").equals("false")) {
+ // the citizen is no HCP
+ acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, new ArrayList<String>(), "NotAvailable");
+ } else {
+ // go on and parse the data
+ IsHealthCareProfessionalType result = new IsHealthCareProfessionalType();
+ result.setNameOfOrganisation(collection.get("NameOfOrganisation"));
+
+ if (collection.get("Type").equals("Medical doctor"))
+ result.setHCPType("D");
+ else
+ result.setHCPType("?");
+
+ if (collection.get("Specialization").contains("Arzt für Allgemeinmedizin"))
+ result.setSpecialisation("GP");
+ else
+ result.setSpecialisation("??");
+
+ result.setAQAA(4);
+
+ final Marshaller m = JAXBContext.newInstance(IsHealthCareProfessionalType.class).createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+
+ StringWriter stringWriter = new StringWriter();
+ m.marshal(new ObjectFactory().createIsHealthCareProfessional(result), stringWriter);
+
+ ArrayList<String> value = new ArrayList<String>();
+ value.add(stringWriter.toString());
+
+ acquiredAttribute = new PersonalAttribute("isHealthCareProfessional", false, value, "Available");
+ }
+
+ // pack and return the result
+ PersonalAttributeList result = new PersonalAttributeList();
+ result.add(acquiredAttribute);
+
+ // add stork id for verification
+ ArrayList<String> value = new ArrayList<String>();
+ value.add(new BPKBuilder().buildStorkbPK(moasession.getIdentityLink().getIdentificationValue(), spCountryCode));
+ result.add(new PersonalAttribute("eIdentifier", false, value, "Available"));
+
+ return result;
+ } catch (Exception e) {
+ throw new MOAIDException("stork.13", new Object[] { e });
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.config.auth.OAAuthParameter)
+ */
+ public void performRedirect(String url,
+ HttpServletRequest req, HttpServletResponse resp,
+ OAAuthParameter oaParam) throws MOAIDException {
+ // there is no redirect required
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#parse(javax.servlet.http.HttpServletRequest)
+ */
+ public IPersonalAttributeList parse(HttpServletRequest httpReq)
+ throws UnsupportedAttributeException, MOAIDException {
+ // there is no redirect required, so we throw an exception when someone asks us to parse a response
+ throw new UnsupportedAttributeException();
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java
new file mode 100644
index 000000000..67fbd50f8
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java
@@ -0,0 +1,29 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+public class ExternalAttributeRequestRequiredException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 5207631348933518908L;
+
+ /** The ap. */
+ private AttributeProvider ap;
+
+ /**
+ * Instantiates a new external attribute request required exception.
+ *
+ * @param provider the provider
+ */
+ public ExternalAttributeRequestRequiredException(AttributeProvider provider) {
+ ap = provider;
+ }
+
+ /**
+ * Gets the ap that caused the exception.
+ *
+ * @return the ap
+ */
+ public AttributeProvider getAp() {
+ return ap;
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java
new file mode 100644
index 000000000..873ec1e26
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java
@@ -0,0 +1,104 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
+import at.gv.egovernment.moa.id.auth.data.IdentityLink;
+import at.gv.egovernment.moa.id.auth.exception.BuildException;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author bsuzic
+ * Date: 2/19/14, Time: 4:42 PM
+ */
+public class MOAAttributeProvider {
+ private final IdentityLink identityLink;
+ private static final Map<String, String> storkAttributeSimpleMapping;
+ private static final Map<String, String> storkAttributeFunctionMapping;
+ private final MOASTORKRequest moastorkRequest;
+
+ static {
+ Map<String, String> tempSimpleMap = new HashMap<String, String>();
+ tempSimpleMap.put("givenName", "getGivenName");
+ tempSimpleMap.put("surname", "getFamilyName");
+ tempSimpleMap.put("dateOfBirth", "getDateOfBirth");
+ storkAttributeSimpleMapping = Collections.unmodifiableMap(tempSimpleMap);
+ Map<String, String> tempFunctionMap = new HashMap<String, String>();
+ tempFunctionMap.put("eIdentifier", "geteIdentifier");
+ storkAttributeFunctionMapping = Collections.unmodifiableMap(tempFunctionMap);
+ }
+
+ public MOAAttributeProvider(IdentityLink identityLink, MOASTORKRequest moastorkRequest) {
+ this.identityLink = identityLink;
+ this.moastorkRequest = moastorkRequest;
+ Logger.debug("identity " + identityLink.getIdentificationType() + " " + identityLink.getIdentificationValue());
+ }
+
+ public void populateAttribute(PersonalAttributeList attributeList, PersonalAttribute requestedAttribute ) {
+ String storkAttribute = requestedAttribute.getName();
+ if (storkAttributeSimpleMapping.containsKey(storkAttribute)) {
+ Logger.debug("Trying to get value for attribute using simple mapping [" + storkAttribute + "]");
+ try {
+ Method method = identityLink.getClass().getDeclaredMethod(storkAttributeSimpleMapping.get(storkAttribute));
+ populateAttributeWithMethod(method, identityLink, attributeList, storkAttribute, requestedAttribute.isRequired());
+ } catch (NoSuchMethodException e) {
+ Logger.error("Could not found MOA extraction method while getting attribute: " + storkAttribute);
+ e.printStackTrace();
+ }
+
+ } else if (storkAttributeFunctionMapping.containsKey(storkAttribute)) {
+
+ Logger.debug("Trying to get value for attribute using function mapping [" + storkAttribute + "]");
+ try {
+ Method method = this.getClass().getDeclaredMethod(storkAttributeFunctionMapping.get(storkAttribute));
+ populateAttributeWithMethod(method, this, attributeList, storkAttribute, requestedAttribute.isRequired());
+ } catch (NoSuchMethodException e) {
+ Logger.error("Could not found MOA extraction method while getting attribute: " + storkAttribute);
+ e.printStackTrace();
+ }
+ } else {
+ Logger.debug("MOA method for extraction of attribute " + storkAttribute + " not defined.");
+ }
+ }
+
+ private String geteIdentifier() {
+ Logger.debug("Using base urn for identification value: " + identityLink.getIdentificationType() + " and target country: " + moastorkRequest.getStorkAuthnRequest().getSpCountry());
+ try {
+ return new BPKBuilder().buildStorkbPK(identityLink.getIdentificationValue(), moastorkRequest.getStorkAuthnRequest().getSpCountry());
+ } catch (BuildException be) {
+ Logger.error("Stork eid could not be constructed; " + be.getMessage());
+ return null; // TODO error
+ }
+ }
+
+
+ private void populateAttributeWithMethod(Method method, Object object, PersonalAttributeList attributeList, String storkAttribute, Boolean isRequired) {
+ try {
+ String attributeValue = method.invoke(object, new Class[]{}).toString();
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName(storkAttribute);
+
+ newAttribute.setStatus("Available");
+ newAttribute.setIsRequired(isRequired);
+ Logger.info("Got attribute value: " + attributeValue);
+ newAttribute.setValue(new ArrayList<String>(edu.emory.mathcs.backport.java.util.Collections.singletonList(attributeValue)));
+ attributeList.add(newAttribute);
+ } catch (InvocationTargetException e) {
+ Logger.error("Invocation target exception while getting attribute: " + storkAttribute);
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ Logger.error("Illegal access exception while getting attribute: " + storkAttribute);
+ e.printStackTrace();
+ }
+ }
+
+
+}
+
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java
new file mode 100644
index 000000000..9ea33c8ef
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java
@@ -0,0 +1,213 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.Serializable;
+
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+
+/**
+ * Implements MOA request and stores StorkAuthn/Attr-Request related data.
+ *
+ * @author bsuzic
+ */
+public class MOASTORKRequest implements IRequest, Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4581953368724501376L;
+
+ /** The request id. */
+ private String requestID;
+
+ /** The target. */
+ private String target = null;
+
+ /** The module. */
+ String module = null;
+
+ /** The action. */
+ String action = null;
+
+ /** The stork authn request. */
+ private STORKAuthnRequest storkAuthnRequest;
+
+ /** The stork attr query request. */
+ private STORKAttrQueryRequest storkAttrQueryRequest;
+
+ /**
+ * Sets the sTORK authn request.
+ *
+ * @param request the new sTORK authn request
+ */
+ public void setSTORKAuthnRequest(STORKAuthnRequest request) {
+ this.storkAuthnRequest = request;
+ }
+
+ /**
+ * Sets the sTORK attr request.
+ *
+ * @param request the new sTORK attr request
+ */
+ public void setSTORKAttrRequest(STORKAttrQueryRequest request) {
+ this.storkAttrQueryRequest = request;
+ }
+
+ /**
+ * Checks if the container holds an AttrQueryRequest
+ *
+ * @return true, if is attr request
+ */
+ public boolean isAttrRequest() {
+ return null != storkAttrQueryRequest;
+ }
+
+ /**
+ * Checks if the container holds an AuthnRequest
+ *
+ * @return true, if is authn request
+ */
+ public boolean isAuthnRequest() {
+ return null != storkAuthnRequest;
+ }
+
+
+ /**
+ * Gets the stork authn request.
+ *
+ * @return the stork authn request
+ */
+ public STORKAuthnRequest getStorkAuthnRequest() {
+ return this.storkAuthnRequest;
+ }
+
+ /**
+ * Gets the stork attr query request.
+ *
+ * @return the stork attr query request
+ */
+ public STORKAttrQueryRequest getStorkAttrQueryRequest() {
+ return this.storkAttrQueryRequest;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#getOAURL()
+ */
+ public String getOAURL() {
+ if (isAuthnRequest())
+ return storkAuthnRequest.getAssertionConsumerServiceURL();
+ else if (isAttrRequest())
+ return storkAttrQueryRequest.getAssertionConsumerServiceURL();
+ else {
+ Logger.error("There is no authentication or attribute request contained in MOASTORKRequest.");
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#isPassiv()
+ */
+ public boolean isPassiv() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#forceAuth()
+ */
+ public boolean forceAuth() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#isSSOSupported()
+ */
+ public boolean isSSOSupported() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#requestedModule()
+ */
+ public String requestedModule() {
+ return this.module;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#requestedAction()
+ */
+ public String requestedAction() {
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#setModule(java.lang.String)
+ */
+ public void setModule(String module) {
+ this.module = module;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#setAction(java.lang.String)
+ */
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#getTarget()
+ */
+ public String getTarget() {
+ return this.target;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#setRequestID(java.lang.String)
+ */
+ public void setRequestID(String id) {
+ this.requestID = id;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.moduls.IRequest#getRequestID()
+ */
+ public String getRequestID() {
+ return this.requestID;
+ }
+
+ /**
+ * Gets the personal attribute list.
+ *
+ * @return the personal attribute list
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ if(isAttrRequest())
+ return this.storkAttrQueryRequest.getPersonalAttributeList();
+ else
+ return this.storkAuthnRequest.getPersonalAttributeList();
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return the sp country
+ */
+ public String getSpCountry() {
+ if(isAttrRequest())
+ return this.storkAttrQueryRequest.getSpCountry();
+ else
+ return this.storkAuthnRequest.getSpCountry();
+ }
+
+ /**
+ * Gets the assertion consumer service url.
+ *
+ * @return the assertion consumer service url
+ */
+ public String getAssertionConsumerServiceURL() {
+ if(isAttrRequest())
+ return this.storkAttrQueryRequest.getAssertionConsumerServiceURL();
+ else
+ return this.storkAuthnRequest.getAssertionConsumerServiceURL();
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java
new file mode 100644
index 000000000..4e0f57779
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java
@@ -0,0 +1,117 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.Serializable;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+
+/**
+ * Implements MOA request and stores StorkAuthn/Attr-Request related data.
+ *
+ * @author bsuzic
+ */
+public class MOASTORKResponse implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -5798803155055518747L;
+
+ /** The stork authn request. */
+ private STORKAuthnResponse storkAuthnResponse;
+
+ /** The stork attr query request. */
+ private STORKAttrQueryResponse storkAttrQueryResponse;
+
+ /**
+ * Sets the sTORK authn response.
+ *
+ * @param request the new sTORK authn response
+ */
+ public void setSTORKAuthnResponse(STORKAuthnResponse request) {
+ this.storkAuthnResponse = request;
+ }
+
+ /**
+ * Sets the sTORK attr response.
+ *
+ * @param request the new sTORK attr response
+ */
+ public void setSTORKAttrResponse(STORKAttrQueryResponse request) {
+ this.storkAttrQueryResponse = request;
+ }
+
+ /**
+ * Checks if the container holds an AttrQuery
+ *
+ * @return true, if is attr response
+ */
+ public boolean isAttrResponse() {
+ return null != storkAttrQueryResponse;
+ }
+
+ /**
+ * Checks if the container holds an AuthnRequest
+ *
+ * @return true, if is authn response
+ */
+ public boolean isAuthnResponse() {
+ return null != storkAuthnResponse;
+ }
+
+
+ /**
+ * Gets the AuthnResponse.
+ *
+ * @return the stork authn response
+ */
+ public STORKAuthnResponse getStorkAuthnResponse() {
+ return this.storkAuthnResponse;
+ }
+
+ /**
+ * Gets the AttrQueryResponse.
+ *
+ * @return the stork attr query response
+ */
+ public STORKAttrQueryResponse getStorkAttrQueryResponse() {
+ return this.storkAttrQueryResponse;
+ }
+
+ /**
+ * Gets the personal attribute list.
+ *
+ * @return the personal attribute list
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ if(isAttrResponse())
+ return this.storkAttrQueryResponse.getPersonalAttributeList();
+ else
+ return this.storkAuthnResponse.getPersonalAttributeList();
+ }
+
+ /**
+ * Sets the personal attribute list.
+ *
+ * @param populateAttributes the new personal attribute list
+ */
+ public void setPersonalAttributeList(PersonalAttributeList populateAttributes) {
+ if(isAttrResponse())
+ this.storkAttrQueryResponse.setPersonalAttributeList(populateAttributes);
+ else
+ this.storkAuthnResponse.setPersonalAttributeList(populateAttributes);
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param spCountry the new country
+ */
+ public void setCountry(String spCountry) {
+ if(isAttrResponse())
+ this.storkAttrQueryResponse.setCountry(spCountry);
+ else
+ this.storkAuthnResponse.setCountry(spCountry);
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java
new file mode 100644
index 000000000..0e94600db
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java
@@ -0,0 +1,125 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.id.util.HTTPUtils;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
+import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.StringUtils;
+import eu.stork.peps.auth.commons.*;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.StringWriter;
+
+/**
+ * Provides mandate attribute from MIS
+ */
+public class MandateAttributeRequestProvider implements AttributeProvider {
+ /**
+ * The destination.
+ */
+ private String destination;
+
+ /**
+ * The attributes.
+ */
+ private String attributes;
+
+ private String spCountryCode;
+
+ private PersonalAttributeList requestedAttributes;
+
+ public MandateAttributeRequestProvider(String aPurl, String supportedAttributes) throws MOAIDException {
+ destination = aPurl;
+ attributes = supportedAttributes;
+ }
+
+ public String getAttrProviderName() {
+ return "MandateAttributeRequestProvider";
+ }
+
+ public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountryCode, AuthenticationSession moasession) throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException, MOAIDException {
+ Logger.info("Acquiring attribute: " + attribute.getName() + ", by: " + getAttrProviderName());
+ this.spCountryCode = spCountryCode;
+ requestedAttributes = new PersonalAttributeList(1);
+ requestedAttributes.add(attribute);
+
+ // break if we cannot handle the requested attribute
+ if (!attributes.contains(attribute.getName())) {
+ Logger.info("Attribute " + attribute.getName() + " not supported by the provider: " + getAttrProviderName());
+ throw new UnsupportedAttributeException();
+ }
+ PersonalAttributeList result = new PersonalAttributeList();
+ //return result;
+ Logger.info("Thrown external request by: " + getAttrProviderName());
+ throw new ExternalAttributeRequestRequiredException(this);
+ }
+
+ public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException {
+
+ String spSector = "Business";
+ String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName();
+ String spApplication = spInstitution;
+
+ //generate AuthnRquest
+ STORKAttrQueryRequest attributeRequest = new STORKAttrQueryRequest();
+ attributeRequest.setDestination(destination);
+ attributeRequest.setAssertionConsumerServiceURL(url);
+ attributeRequest.setIssuer(HTTPUtils.getBaseURL(req));
+ attributeRequest.setQaa(oaParam.getQaaLevel());
+ attributeRequest.setSpInstitution(spInstitution);
+ attributeRequest.setCountry(spCountryCode);
+ attributeRequest.setSpCountry(spCountryCode);
+ attributeRequest.setSpApplication(spApplication);
+ attributeRequest.setSpSector(spSector);
+ attributeRequest.setPersonalAttributeList(requestedAttributes);
+
+ attributeRequest.setCitizenCountryCode("AT");
+
+
+ Logger.info("STORK AttrRequest successfully assembled.");
+
+ STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("VIDP");
+ try {
+ attributeRequest = samlEngine.generateSTORKAttrQueryRequest(attributeRequest);
+ } catch (STORKSAMLEngineException e) {
+ Logger.error("Could not sign STORK SAML AttrRequest.", e);
+ throw new MOAIDException("stork.00", null);
+ }
+
+ Logger.info("STORK AttrRequest successfully signed!");
+
+ try {
+ Logger.trace("Initialize VelocityEngine...");
+
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ Template template = velocityEngine.getTemplate("/resources/templates/saml2-post-binding-moa.vm");
+ VelocityContext context = new VelocityContext();
+ context.put("SAMLRequest", PEPSUtil.encodeSAMLToken(attributeRequest.getTokenSaml()));
+ context.put("action", destination);
+
+ StringWriter writer = new StringWriter();
+ template.merge(context, writer);
+
+ resp.getOutputStream().write(writer.toString().getBytes());
+ } catch (Exception e) {
+ Logger.error("Error sending STORK SAML AttrRequest.", e);
+ throw new MOAIDException("stork.11", null);
+ }
+ Logger.info("STORK AttrRequest successfully rendered!");
+
+ }
+
+ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws UnsupportedAttributeException, MOAIDException {
+ return null; //
+ }
+
+}
+
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java
new file mode 100644
index 000000000..3bd1686b4
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java
@@ -0,0 +1,28 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.moduls.IAction;
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.logging.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ */
+public class MandateRetrievalRequest implements IAction {
+ public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
+ Logger.info("Entering mandateretrievalrequest");
+ return null; //
+ }
+
+ public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp) {
+ return true; //
+ }
+
+ public String getDefaultActionName() {
+ return STORKProtocol.MANDATERETRIEVALREQUEST;
+ }
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
new file mode 100644
index 000000000..5b844580d
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
@@ -0,0 +1,126 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.moduls.IAction;
+import at.gv.egovernment.moa.id.moduls.IModulInfo;
+import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.*;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+
+/**
+ * Stork 2 Protocol Support
+ *
+ * @author bsuzic
+ */
+public class STORKProtocol implements IModulInfo, MOAIDAuthConstants {
+
+ public static final String NAME = STORKProtocol.class.getName();
+ public static final String PATH = "id_stork2";
+
+ public static final String AUTHENTICATIONREQUEST = "AuthenticationRequest";
+ public static final String ATTRIBUTE_COLLECTOR = "AttributeCollector";
+ public static final String MANDATERETRIEVALREQUEST = "MandateRetrievalRequest";
+ public static final String CONSENT_EVALUATOR = "ConsentEvaluator";
+
+ private static HashMap<String, IAction> actions = new HashMap<String, IAction>();
+
+ static {
+ actions.put(AUTHENTICATIONREQUEST, new AuthenticationRequest());
+ actions.put(ATTRIBUTE_COLLECTOR, new AttributeCollector());
+ actions.put(CONSENT_EVALUATOR, new ConsentEvaluator());
+ actions.put(MANDATERETRIEVALREQUEST, new MandateRetrievalRequest());
+ }
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getPath() {
+ return PATH;
+ }
+
+ public IAction getAction(String action) {
+ return actions.get(action);
+ }
+
+ public STORKProtocol() {
+ super();
+ }
+
+ /*
+ First request step - send it to BKU selection for user authentication. After the user credentials
+ and other info are obtained, in the second step the request will be processed and the user redirected
+ */
+ public IRequest preProcess(HttpServletRequest request, HttpServletResponse response, String action) throws MOAIDException {
+ Logger.info("Starting preprocessing for Stork2 protocol");
+ Logger.debug("Request method: " + request.getMethod());
+ Logger.debug("Request content length: " + request.getContentLength());
+ Logger.debug("Initiating action: " + action);
+
+ MOASTORKRequest STORK2Request = new MOASTORKRequest();
+
+ if (AttributeCollector.class.getSimpleName().equals(action) || ConsentEvaluator.class.getSimpleName().equals(action))
+ return STORK2Request;
+
+ //extract STORK Response from HTTP Request
+ byte[] decSamlToken;
+ try {
+ decSamlToken = PEPSUtil.decodeSAMLToken(request.getParameter("SAMLRequest"));
+ } catch (NullPointerException e) {
+ Logger.error("Unable to retrieve STORK Request", e);
+ throw new MOAIDException("stork.04", null);
+ }
+
+ //Get SAMLEngine instance
+ STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP");
+
+ STORKAuthnRequest authnRequest = null;
+ STORKAttrQueryRequest attrRequest = null;
+
+ // check if valid authn request is contained
+ try {
+ authnRequest = engine.validateSTORKAuthnRequest(decSamlToken);
+ } catch (STORKSAMLEngineException ex) {
+ Logger.error("Unable to validate Stork AuthenticationRequest: " + ex.getMessage());
+ } catch(ClassCastException e) {
+ // we do not have a authnRequest
+ // check if a valid attr request is container
+ try {
+ attrRequest = engine.validateSTORKAttrQueryRequest(decSamlToken);
+ } catch (STORKSAMLEngineException ex) {
+ Logger.error("Unable to validate Stork AuthenticationRequest: " + ex.getMessage());
+ }
+ }
+
+ // if there is no authn or attr request, raise error
+ if ((authnRequest == null) && (attrRequest == null)) {
+ Logger.error("There is no authentication or attribute request contained.");
+ throw new MOAIDException("stork.14", null);
+ }
+
+ STORK2Request.setSTORKAuthnRequest(authnRequest);
+ STORK2Request.setSTORKAttrRequest(attrRequest);
+
+ return STORK2Request;
+ }
+
+ public IAction canHandleRequest(HttpServletRequest request, HttpServletResponse response) {
+ return null;
+ }
+
+ public boolean generateErrorMessage(Throwable e, HttpServletRequest request, HttpServletResponse response, IRequest protocolRequest) throws Throwable {
+ return false;
+ }
+
+ public boolean validate(HttpServletRequest request, HttpServletResponse response, IRequest pending) {
+ return false;
+ }
+}
+
+
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java
new file mode 100644
index 000000000..89eb07815
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java
@@ -0,0 +1,129 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
+import at.gv.egovernment.moa.logging.Logger;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * Forwards a signedDoc attribute request to the oasis-dss service instance
+ */
+public class SignedDocAttributeRequestProvider implements AttributeProvider {
+
+ private PersonalAttribute requestedAttribute;
+
+ /**
+ * The URL of the service listening for the oasis dss webform post request
+ */
+ private String oasisDssWebFormURL;
+
+ /** The attributes. */
+ private String attributes;
+
+ /**
+ * Instantiates a new signed doc attribute request provider.
+ *
+ * @param oasisDssWebFormURL
+ * the AP location
+ * @param attributes
+ */
+ public SignedDocAttributeRequestProvider(String oasisDssWebFormURL, String attributes) {
+ this.oasisDssWebFormURL = oasisDssWebFormURL;
+ this.attributes = attributes;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java
+ * .lang.String)
+ */
+ public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException,
+ ExternalAttributeRequestRequiredException {
+ if(!attributes.contains(attribute.getName())) {
+ throw new UnsupportedAttributeException();
+ }
+
+ requestedAttribute = attribute;
+
+ throw new ExternalAttributeRequestRequiredException(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#parse(javax
+ * .servlet.http.HttpServletRequest)
+ */
+ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws MOAIDException, UnsupportedAttributeException {
+ Logger.debug("Beginning to extract OASIS-DSS response out of HTTP Request");
+
+ try {
+ String signResponse = new String(Base64.decodeBase64(httpReq.getParameter("signresponse")), "UTF8");
+ List<String> values = new ArrayList<String>();
+ values.add(signResponse);
+
+ Logger.debug("Assembling signedDoc attribute");
+ PersonalAttribute signedDocAttribute = new PersonalAttribute("signedDoc", false, values,
+ "Available");
+
+ // pack and return the result
+ PersonalAttributeList result = new PersonalAttributeList();
+ result.add(signedDocAttribute);
+ return result;
+ } catch (UnsupportedEncodingException e) {
+ Logger.error("Failed to assemble signedDoc attribute");
+ throw new MOAIDException("stork.05", null);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect
+ * (java.lang.String)
+ */
+ public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam)
+ throws MOAIDException {
+
+ try {
+ Logger.trace("Initialize VelocityEngine...");
+
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ Template template = velocityEngine.getTemplate("/resources/templates/oasis_dss_webform_binding.vm");
+ VelocityContext context = new VelocityContext();
+ context.put("signrequest", Base64.encodeBase64String(requestedAttribute.getValue().get(0).getBytes("UTF8")));
+ context.put("clienturl", url);
+ context.put("action", oasisDssWebFormURL);
+
+ StringWriter writer = new StringWriter();
+ template.merge(context, writer);
+
+ resp.getOutputStream().write(writer.toString().getBytes());
+ } catch (Exception e) {
+ Logger.error("Error sending DSS signrequest.", e);
+ throw new MOAIDException("stork.11", null);
+ }
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java
new file mode 100644
index 000000000..c0e613b82
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java
@@ -0,0 +1,162 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+import java.io.StringWriter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+
+import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.id.util.HTTPUtils;
+import at.gv.egovernment.moa.id.util.VelocityProvider;
+import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.StringUtils;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * creates a STORK attribute request for a configurable set of attributes
+ */
+public class StorkAttributeRequestProvider implements AttributeProvider {
+
+ private PersonalAttributeList requestedAttributes;
+
+ /** The destination. */
+ private String destination;
+
+ /** The attributes. */
+ private String attributes;
+
+ /** The sp country code. */
+ private String spCountryCode;
+
+ /**
+ * Instantiates a new stork attribute request provider.
+ *
+ * @param apUrl the AP location
+ * @param supportedAttributes the supported attributes as csv
+ */
+ public StorkAttributeRequestProvider(String apUrl, String supportedAttributes) {
+ destination = apUrl;
+ attributes = supportedAttributes;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#acquire(java.lang.String)
+ */
+ public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountyCode, AuthenticationSession moasession)
+ throws UnsupportedAttributeException, ExternalAttributeRequestRequiredException {
+
+ if (!attributes.contains(attribute.getName()))
+ throw new UnsupportedAttributeException();
+
+ this.spCountryCode = spCountyCode;
+
+ requestedAttributes = new PersonalAttributeList(1);
+ requestedAttributes.add(attribute);
+ throw new ExternalAttributeRequestRequiredException(this);
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#parse(javax.servlet.http.HttpServletRequest)
+ */
+ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws MOAIDException, UnsupportedAttributeException {
+
+ Logger.info(this.getClass().getSimpleName() + " tries to extract SAMLResponse out of HTTP Request");
+
+ //extract STORK Response from HTTP Request
+ //Decodes SAML Response
+ byte[] decSamlToken;
+ try {
+ decSamlToken = PEPSUtil.decodeSAMLToken(httpReq.getParameter("SAMLResponse"));
+ } catch(NullPointerException e) {
+ throw new UnsupportedAttributeException();
+ }
+
+ //Get SAMLEngine instance
+ STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP");
+
+ STORKAttrQueryResponse attrResponse = null;
+ try {
+ //validate SAML Token
+ Logger.debug("Starting validation of SAML response");
+ attrResponse = engine.validateSTORKAttrQueryResponse(decSamlToken, (String) httpReq.getRemoteHost());
+ Logger.info("SAML response successfully verified!");
+ }catch(STORKSAMLEngineException e){
+ Logger.error("Failed to verify STORK SAML Response", e);
+ throw new MOAIDException("stork.05", null);
+ }
+
+ return attrResponse.getPersonalAttributeList();
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.protocols.stork2.AttributeProvider#performRedirect(java.lang.String)
+ */
+ public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException {
+
+ String spSector = "Business";
+ String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName();
+ String spApplication = spInstitution;
+
+ //generate AuthnRquest
+ STORKAttrQueryRequest attributeRequest = new STORKAttrQueryRequest();
+ attributeRequest.setDestination(destination);
+ attributeRequest.setAssertionConsumerServiceURL(url);
+ attributeRequest.setIssuer(HTTPUtils.getBaseURL(req));
+ attributeRequest.setQaa(oaParam.getQaaLevel());
+ attributeRequest.setSpInstitution(spInstitution);
+ attributeRequest.setCountry(spCountryCode);
+ attributeRequest.setSpCountry(spCountryCode);
+ attributeRequest.setSpApplication(spApplication);
+ attributeRequest.setSpSector(spSector);
+ attributeRequest.setPersonalAttributeList(requestedAttributes);
+
+ attributeRequest.setCitizenCountryCode("AT");
+
+
+ Logger.debug("STORK AttrRequest successfully assembled.");
+
+ STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("VIDP");
+ try {
+ attributeRequest = samlEngine.generateSTORKAttrQueryRequest(attributeRequest);
+ } catch (STORKSAMLEngineException e) {
+ Logger.error("Could not sign STORK SAML AttrRequest.", e);
+ throw new MOAIDException("stork.00", null);
+ }
+
+ Logger.info("STORK AttrRequest successfully signed!");
+
+ try {
+ Logger.trace("Initialize VelocityEngine...");
+
+ VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
+ Template template = velocityEngine.getTemplate("/resources/templates/saml2-post-binding-moa.vm");
+ VelocityContext context = new VelocityContext();
+ context.put("SAMLRequest", PEPSUtil.encodeSAMLToken(attributeRequest.getTokenSaml()));
+ context.put("action", destination);
+
+ StringWriter writer = new StringWriter();
+ template.merge(context, writer);
+
+ resp.getOutputStream().write(writer.toString().getBytes());
+ } catch (Exception e) {
+ Logger.error("Error sending STORK SAML AttrRequest.", e);
+ throw new MOAIDException("stork.11", null);
+ }
+ Logger.info("STORK AttrRequest successfully rendered!");
+ }
+
+}
+
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/UnsupportedAttributeException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/UnsupportedAttributeException.java
new file mode 100644
index 000000000..9447c079f
--- /dev/null
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/UnsupportedAttributeException.java
@@ -0,0 +1,7 @@
+package at.gv.egovernment.moa.id.protocols.stork2;
+
+public class UnsupportedAttributeException extends Exception {
+
+ private static final long serialVersionUID = -7720066381435378111L;
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
index e1e03bce7..6d8979da3 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
@@ -73,10 +73,10 @@ public class AssertionStorage {
//store AssertionStore element to Database
try {
MOASessionDBUtils.saveOrUpdate(element);
- Logger.info("Assertion with Artifact=" + artifact + " is stored in Database");
+ Logger.info("Sessioninformation with ID=" + artifact + " is stored in Database");
} catch (MOADatabaseException e) {
- Logger.warn("Assertion could not be stored.");
+ Logger.warn("Sessioninformation could not be stored.");
throw new MOADatabaseException(e);
}
@@ -96,8 +96,8 @@ public class AssertionStorage {
return test;
} catch (Exception e) {
- Logger.warn("Assertion Cast-Exception by using Artifact=" + artifact);
- throw new MOADatabaseException("Assertion Cast-Exception");
+ Logger.warn("Sessioninformation Cast-Exception by using Artifact=" + artifact);
+ throw new MOADatabaseException("Sessioninformation Cast-Exception");
}
}
@@ -119,11 +119,11 @@ public class AssertionStorage {
for(AssertionStore result : results) {
try {
MOASessionDBUtils.delete(result);
- Logger.info("Remove Assertion with Artifact=" + result.getArtifact()
- + " after assertion timeout.");
+ Logger.info("Remove sessioninformation with ID=" + result.getArtifact()
+ + " after timeout.");
} catch (HibernateException e){
- Logger.warn("Assertion with Artifact=" + result.getArtifact()
+ Logger.warn("Sessioninformation with ID=" + result.getArtifact()
+ " not removed after timeout! (Error during Database communication)", e);
}
@@ -136,22 +136,22 @@ public class AssertionStorage {
try {
AssertionStore element = searchInDatabase(artifact);
MOASessionDBUtils.delete(element);
- Logger.info("Remove Assertion with Artifact" + artifact);
+ Logger.info("Remove sessioninformation with ID" + artifact);
} catch (MOADatabaseException e) {
- Logger.info("Assertion not removed! (Assertion with Artifact=" + artifact
+ Logger.info("Sessioninformation not removed! (Sessioninformation with ID=" + artifact
+ "not found)");
} catch (HibernateException e) {
- Logger.warn("Assertion not removed! (Error during Database communication)", e);
+ Logger.warn("Sessioninformation not removed! (Error during Database communication)", e);
}
}
@SuppressWarnings("rawtypes")
private AssertionStore searchInDatabase(String artifact) throws MOADatabaseException {
MiscUtil.assertNotNull(artifact, "artifact");
- Logger.trace("Getting Assertion with Artifact " + artifact + " from database.");
+ Logger.trace("Getting sessioninformation with ID " + artifact + " from database.");
Session session = MOASessionDBUtils.getCurrentSession();
List result;
@@ -170,7 +170,7 @@ public class AssertionStorage {
//Assertion requires an unique artifact
if (result.size() != 1) {
Logger.trace("No entries found.");
- throw new MOADatabaseException("No Assertion found with this Artifact");
+ throw new MOADatabaseException("No sessioninformation found with this ID");
}
return (AssertionStore) result.get(0);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
index 9df283965..6efe9b39c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
@@ -508,7 +508,6 @@ public class ParamValidatorUtils implements MOAIDAuthConstants{
String oaURL = req.getParameter(PARAM_OA);
String bkuURL = req.getParameter(PARAM_BKU);
- String templateURL = req.getParameter(PARAM_TEMPLATE);
String useMandate = req.getParameter(PARAM_USEMANDATE);
String ccc = req.getParameter(PARAM_CCC);
@@ -519,8 +518,6 @@ public class ParamValidatorUtils implements MOAIDAuthConstants{
throw new WrongParametersException("StartAuthentication", PARAM_OA, "auth.12");
if (MiscUtil.isEmpty(bkuURL))
throw new WrongParametersException("StartAuthentication", PARAM_BKU, "auth.12");
-// if (MiscUtil.isEmpty(templateURL))
-// throw new WrongParametersException("StartAuthentication", PARAM_TEMPLATE, "auth.12");
if (!ParamValidatorUtils.isValidUseMandate(useMandate))
throw new WrongParametersException("StartAuthentication", PARAM_USEMANDATE, "auth.12");
if (!ParamValidatorUtils.isValidCCC(ccc))
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/VelocityProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/VelocityProvider.java
index b923727f9..231f36fa8 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/VelocityProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/VelocityProvider.java
@@ -48,7 +48,7 @@
/**
*
*/
-package at.gv.egovernment.moa.id.auth.stork;
+package at.gv.egovernment.moa.id.util;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
@@ -103,6 +103,8 @@ public class VelocityProvider {
VelocityEngine velocityEngine = new VelocityEngine();
velocityEngine.setProperty(RuntimeConstants.ENCODING_DEFAULT, "UTF-8");
velocityEngine.setProperty(RuntimeConstants.OUTPUT_ENCODING, "UTF-8");
+ velocityEngine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
+ "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
return velocityEngine;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java
index c0fde8146..b9c4e88b7 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java
@@ -157,7 +157,7 @@ public class MISSimpleClient {
}
}
- public static MISSessionId sendSessionIdRequest(String webServiceURL, byte[] idl, byte[] cert, String oaFriendlyName, String redirectURL, String referenceValue, String mandateIdentifier[], String targetType, SSLSocketFactory sSLSocketFactory) throws MISSimpleClientException {
+ public static MISSessionId sendSessionIdRequest(String webServiceURL, byte[] idl, byte[] cert, String oaFriendlyName, String redirectURL, String referenceValue, List<String> mandateIdentifier, String targetType, SSLSocketFactory sSLSocketFactory) throws MISSimpleClientException {
if (webServiceURL == null) {
throw new NullPointerException("Argument webServiceURL must not be null.");
}
@@ -205,12 +205,12 @@ public class MISSimpleClient {
referenceValueElement.appendChild(doc.createTextNode(referenceValue));
mirElement.appendChild(referenceValueElement);
- if (mandateIdentifier != null && mandateIdentifier.length > 0) {
+ if (mandateIdentifier != null && mandateIdentifier.size() > 0) {
Element filtersElement = doc.createElementNS(MIS_NS, "Filters");
Element mandateIdentifiersElement = doc.createElementNS(MIS_NS, "MandateIdentifiers");
- for (int i=0; i<mandateIdentifier.length; i++) {
+ for (int i=0; i<mandateIdentifier.size(); i++) {
Element mandateIdentifierElement = doc.createElementNS(MIS_NS, "MandateIdentifier");
- mandateIdentifierElement.appendChild(doc.createTextNode(mandateIdentifier[i]));
+ mandateIdentifierElement.appendChild(doc.createTextNode(mandateIdentifier.get(i)));
mandateIdentifiersElement.appendChild(mandateIdentifierElement);
}
filtersElement.appendChild(mandateIdentifiersElement);
@@ -306,15 +306,24 @@ public class MISSimpleClient {
//Element elem = parse(post.getResponseBodyAsStream());
Document doc = DOMUtils.parseDocumentSimple(post.getResponseBodyAsStream());
return unpackFromSOAP(doc.getDocumentElement());
+
} catch(IOException e) {
- throw new MISSimpleClientException(e);
+ throw new MISSimpleClientException(e.getLocalizedMessage(), e);
+
} catch (TransformerException e) {
throw new MISSimpleClientException(e);
+
} catch (SAXException e) {
throw new MISSimpleClientException(e);
+
} catch (ParserConfigurationException e) {
throw new MISSimpleClientException(e);
+
+ } catch (Exception e) {
+ throw new MISSimpleClientException(e.getLocalizedMessage(), e);
+
}
+
}
private static Element packIntoSOAP(Element element) throws MISSimpleClientException {
diff --git a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties
index 2559d3d18..3cd8ee24a 100644
--- a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties
+++ b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties
@@ -192,6 +192,7 @@ validator.67=Der Specialtext ({0}) stimmt nicht mit dem f\u00FCr diese Applikati
validator.68=SigningTime im AUTH-Block konnte nicht eruiert werden.
validator.69=SigningTime im AUTH-Block und Serverzeit weichen zu stark ab ({0}).
validator.70=Das einmale Tokken im signierten AuthBlock ({0}) stimmt nicht mit dem von generierten Tokken ({1}) \u00FCberein.
+validator.71=Das Signaturzertifikat ist nicht qualifiziert.
ssl.01=Validierung des SSL-Server-Endzertifikates hat fehlgeschlagen
@@ -205,6 +206,14 @@ stork.07=Es existiert kein STORK AuthnRequest f\u00FCr diese STORK Response
stork.08=STORK SAML Assertion Validierung fehlgeschlagen
stork.09=Fehler beim \u00FCberpr\u00FCfen der STORK B\u00FCrgerInnen Signatur
stork.10=Fehler in der Verbindung zum SZR-Gateway
+stork.11=Fehler beim Sammeln von StorkAttributen
+stork.12=Konnte keine VIDP Konfiguration finden
+stork.13=Fehler beim Sammeln eines Attributes in einem AttributProviderPlugin
+stork.14=Es wurde weder Authentifizierungs/ noch Attributerequest empfangen
+stork.15=Unbekannte request.
+stork.16=Ein Attribute aus zwei verschiedenen Quellen unterscheidet sich\: {0}
+stork.17=Fehler beim Einholen der Zustimmung für Attribut\u00FCbertragung durch den Benutzer
+stork.18=STORK-SAML Engine konnte nicht initialisiert werden.
pvp2.00={0} ist kein gueltiger consumer service index
pvp2.01=Fehler beim kodieren der PVP2 Antwort
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 9d6ad4085..b9d3eafa7 100644
--- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html
+++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html
@@ -628,6 +628,10 @@
document.getElementById("localBKU").style.display="block";
return;
}
+ function bkuLocalClicked() {
+ setMandateSelection();
+ }
+
function bkuOnlineClicked() {
if (isMetro())
document.getElementById("metroDetected").style.display="block";
@@ -796,9 +800,11 @@
type="hidden" name="CCC" id="ccc"> <input type="hidden"
name="MODUL" value="#MODUL#"> <input type="hidden"
name="ACTION" value="#ACTION#"> <input type="hidden"
- name="MOASessionID" value="#SESSIONID#"> <input
- type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
- role="button" class="hell">
+ name="MOASessionID" value="#SESSIONID#">
+ <input type="submit" value=">lokale Bürgerkartenumgebung" tabindex="4"
+ role="button" class="hell"
+ onclick="setMandateSelection();"
+ >
<!--p>
<small>Alternativ können Sie eine lokal installierte BKU verwenden.</small>
</p-->
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/oasis_dss_webform_binding.vm b/id/server/idserverlib/src/main/resources/resources/templates/oasis_dss_webform_binding.vm
new file mode 100644
index 000000000..7fcc1bb36
--- /dev/null
+++ b/id/server/idserverlib/src/main/resources/resources/templates/oasis_dss_webform_binding.vm
@@ -0,0 +1,36 @@
+##
+## Velocity Template for OASIS WEBFORM BINDING
+##
+## Velocity context may contain the following properties
+## action - String - the action URL for the form
+## signresponse - String - the Base64 encoded SAML Request
+## verifyresponse - String - the Base64 encoded SAML Response
+## clienturl - String - URL where the USer gets redirected after the signature process
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+
+ <body onload="document.forms[0].submit()">
+ <noscript>
+ <p>
+ <strong>Note:</strong> Since your browser does not support JavaScript,
+ you must press the Continue button once to proceed.
+ </p>
+ </noscript>
+
+ <form action="${action}" method="post">
+ <div>
+ #if($signrequest)<input type="hidden" name="signrequest" value="${signrequest}"/>#end
+
+ #if($verifyrequest)<input type="hidden" name="verifyrequest" value="${verifyrequest}"/>#end
+ #if($clienturl)<input type="hidden" name="clienturl" value="${clienturl}"/>#end
+
+ </div>
+ <noscript>
+ <div>
+ <input type="submit" value="Continue"/>
+ </div>
+ </noscript>
+ </form>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/redirectForm.html b/id/server/idserverlib/src/main/resources/resources/templates/redirectForm.html
index 517f207ff..9bddee931 100644
--- a/id/server/idserverlib/src/main/resources/resources/templates/redirectForm.html
+++ b/id/server/idserverlib/src/main/resources/resources/templates/redirectForm.html
@@ -7,7 +7,7 @@
<body onload="document.getElementById('link').click();">
- <a href="#URL#" target="_parent" id="link">CLICK to perform a
+ <a href="#URL#" target="#TARGET#" id="link">CLICK to perform a
redirect back to Online Application</a>
</body>
</html>
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/stork2_consent.html b/id/server/idserverlib/src/main/resources/resources/templates/stork2_consent.html
new file mode 100644
index 000000000..2ad03e34e
--- /dev/null
+++ b/id/server/idserverlib/src/main/resources/resources/templates/stork2_consent.html
@@ -0,0 +1,444 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+
+ <!-- MOA-ID 2.x BKUSelection Layout CSS -->
+ <style type="text/css">
+ @media screen and (min-width: 650px) {
+
+ body {
+ margin:0;
+ padding:0;
+ color : #000;
+ background-color : #fff;
+ text-align: center;
+ background-color: #6B7B8B;
+ }
+
+ #bku_header h2 {
+ font-size: 0.8em;
+ }
+
+
+ #page {
+ display: block;
+ border: 2px solid rgb(0,0,0);
+ width: 650px;
+ height: 460px;
+ margin: 0 auto;
+ margin-top: 5%;
+ position: relative;
+ border-radius: 25px;
+ background: rgb(255,255,255);
+ }
+
+ #page1 {
+ text-align: center;
+ }
+
+ #main {
+ /* clear:both; */
+ position:relative;
+ margin: 0 auto;
+ width: 250px;
+ text-align: center;
+ }
+
+ .OA_header {
+ /* background-color: white;*/
+ font-size: 20pt;
+ margin-bottom: 25px;
+ margin-top: 25px;
+ }
+
+ #leftcontent {
+ /*float:left; */
+ width:250px;
+ margin-bottom: 25px;
+ text-align: left;
+ border: 1px solid rgb(0,0,0);
+ }
+
+ #selectArea {
+ font-size: 15px;
+ padding-bottom: 65px;
+ }
+
+ #leftcontent {
+ width: 300px;
+ margin-top: 30px;
+ }
+
+ #bku_header {
+ height: 5%;
+ padding-bottom: 3px;
+ padding-top: 3px;
+ }
+
+ #bkulogin {
+ overflow:auto;
+ min-width: 190px;
+ height: 260px;
+ }
+
+ h2#tabheader{
+ font-size: 1.1em;
+ padding-left: 2%;
+ padding-right: 2%;
+ position: relative;
+ }
+
+ .setAssertionButton_full {
+ background: #efefef;
+ cursor: pointer;
+ margin-top: 15px;
+ width: 100px;
+ height: 30px
+ }
+
+ #leftbutton {
+ width: 30%;
+ float:left;
+ margin-left: 40px;
+ }
+
+ #rightbutton {
+ width: 30%;
+ float:right;
+ margin-right: 45px;
+ text-align: right;
+ }
+
+ button {
+ height: 25px;
+ width: 75px;
+ margin-bottom: 10px;
+ }
+
+ #validation {
+ position: absolute;
+ bottom: 0px;
+ margin-left: 270px;
+ padding-bottom: 10px;
+ }
+
+ }
+
+ @media screen and (max-width: 205px) {
+ #bku_header h2 {
+ font-size: 0.8em;
+ margin-top: -0.4em;
+ padding-top: 0.4em;
+ }
+
+ #bkulogin {
+ min-height: 150px;
+ }
+ }
+
+ @media screen and (max-width: 249px) and (min-width: 206px) {
+ #bku_header h2 {
+ font-size: 0.9em;
+ margin-top: -0.45em;
+ padding-top: 0.45em;
+ }
+
+ #bkulogin {
+ height: 180px;
+ }
+ }
+
+ @media screen and (max-width: 299px) and (min-width: 250px) {
+ #bku_header h2 {
+ font-size: 1.1em;
+ margin-top: -0.55em;
+ padding-top: 0.55em;
+ }
+ }
+
+ @media screen and (max-width: 649px) and (min-width: 400px) {
+ #bku_header h2 {
+ font-size: 1.3em;
+ margin-top: -0.65em;
+ padding-top: 0.65em;
+ }
+ }
+
+
+
+ @media screen and (max-width: 649px) {
+
+ body {
+ margin:0;
+ padding:0;
+ color : #000;
+ text-align: center;
+ font-size: 100%;
+ background-color: #MAIN_BACKGOUNDCOLOR#;
+ }
+
+ #page {
+ visibility: hidden;
+ margin-top: 0%;
+ }
+
+ #page1 {
+ visibility: hidden;
+ }
+
+ #main {
+ visibility: hidden;
+ }
+
+ #validation {
+ visibility: hidden;
+ display: none;
+ }
+
+ .OA_header {
+ margin-bottom: 0px;
+ margin-top: 0px;
+ font-size: 0pt;
+ visibility: hidden;
+ }
+
+ #leftcontent {
+ visibility: visible;
+ margin-bottom: 0px;
+ text-align: left;
+ border:none;
+ vertical-align: middle;
+ min-height: 173px;
+ min-width: 204px;
+
+ }
+
+ #bku_header {
+ height: 10%;
+ min-height: 1.2em;
+ margin-top: 1%;
+ }
+
+ h2#tabheader{
+ padding-left: 2%;
+ padding-right: 2%;
+ position: relative;
+ top: 50%;
+ }
+
+ #bkulogin {
+ min-width: 190px;
+ height: 155px;
+ }
+
+ .setAssertionButton_full {
+ background: #efefef;
+ cursor: pointer;
+ margin-top: 15px;
+ width: 70px;
+ height: 25px;
+ }
+
+ input[type=button] {
+/* height: 11%; */
+ width: 70%;
+ }
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ font-family: #FONTTYPE#;
+ }
+
+ #selectArea {
+ padding-top: 10px;
+ padding-bottom: 55px;
+ padding-left: 10px;
+ }
+
+ .setAssertionButton {
+ background: #efefef;
+ cursor: pointer;
+ margin-top: 15px;
+ width: 70px;
+ height: 25px;
+ }
+
+ #leftbutton {
+ width: 35%;
+ float:left;
+ margin-left: 15px;
+ }
+
+ #rightbutton {
+ width: 35%;
+ float:right;
+ margin-right: 25px;
+ text-align: right;
+ }
+
+ .verticalcenter {
+ vertical-align: middle;
+ }
+
+ input {
+ /*border:1px solid #000;*/
+ cursor: pointer;
+ }
+
+
+ #installJava, #BrowserNOK {
+ clear:both;
+ font-size:0.8em;
+ padding:4px;
+ }
+
+ .selectText{
+
+ }
+
+ .selectTextHeader{
+
+ }
+
+ .sendButton {
+ width: 30%;
+ margin-bottom: 1%;
+ }
+
+ #leftcontent a {
+ text-decoration:none;
+ color: #000;
+ /* display:block;*/
+ padding:4px;
+ }
+
+ #leftcontent a:hover, #leftcontent a:focus, #leftcontent a:active {
+ text-decoration:underline;
+ color: #000;
+ }
+
+ .infobutton {
+ background-color: #005a00;
+ color: white;
+ font-family: serif;
+ text-decoration: none;
+ padding-top: 2px;
+ padding-right: 4px;
+ padding-bottom: 2px;
+ padding-left: 4px;
+ font-weight: bold;
+ }
+
+ .hell {
+ background-color : #MAIN_BACKGOUNDCOLOR#;
+ color: #MAIN_COLOR#;
+ }
+
+ .dunkel {
+ background-color: #HEADER_BACKGROUNDCOLOR#;
+ color: #HEADER_COLOR#;
+ }
+
+ .main_header {
+ color: black;
+ font-size: 32pt;
+ position: absolute;
+ right: 10%;
+ top: 40px;
+
+ }
+
+ #controls {
+ text-align: right;
+ }
+
+ </style>
+<!-- MOA-ID 2.x BKUSelection JavaScript fucnctions-->
+<script type="text/javascript">
+ function isIE() {
+ return (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
+ }
+ function isFullscreen() {
+ try {
+ return ((top.innerWidth == screen.width) && (top.innerHeight == screen.height));
+ } catch (e) {
+ return false;
+ }
+ }
+ function isActivexEnabled() {
+ var supported = null;
+ try {
+ supported = !!new ActiveXObject("htmlfile");
+ } catch (e) {
+ supported = false;
+ }
+ return supported;
+ }
+ function generateIFrame(iFrameURL) {
+ var el = document.getElementById("bkulogin");
+ var width = el.clientWidth;
+ var heigth = el.clientHeight - 20;
+ var parent = el.parentNode;
+
+ iFrameURL += "&heigth=" + heigth;
+ iFrameURL += "&width=" + width;
+
+ var iframe = document.createElement("iframe");
+ iframe.setAttribute("src", iFrameURL);
+ iframe.setAttribute("width", el.clientWidth - 1);
+ iframe.setAttribute("height", el.clientHeight - 1);
+ iframe.setAttribute("frameborder", "0");
+ iframe.setAttribute("scrolling", "no");
+ iframe.setAttribute("title", "Login");
+ parent.replaceChild(iframe, el);
+ }
+ function onChangeChecks() {
+ if (top.innerWidth < 650) {
+ document.getElementById("moaidform").setAttribute("target","_parent");
+ } else {
+ document.getElementById("moaidform").removeAttribute("target");
+ }
+
+ }
+ </script>
+<title>#HEADER_TEXT#</title>
+</head>
+<body onload="onChangeChecks();" onresize="onChangeChecks();">
+ <div id="page">
+ <div id="page1" class="case selected-case" role="main">
+ <h2 class="OA_header" role="heading">STORK Informationsfreigabe</h2>
+ <div id="main">
+ <div id="leftcontent" class="hell" role="application">
+ <form method="POST" action="${action}">
+ <div id="bku_header" class="dunkel">
+ <h2 id="tabheader" class="dunkel" role="heading">STORK Informationsfreigabe</h2>
+ </div>
+ <div id="bkulogin" class="hell" role="form">
+ Alle angehakten Daten werden an das fragende Drittland &uuml;bermittelt.
+ <table>
+ ${tablecontent}
+ </table>
+ </div>
+ <div id="controls" class="hell">
+ <input type="submit" value="weiter" />
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ <div id="validation">
+ <a href="http://validator.w3.org/check?uri="> <img
+ style="border: 0; width: 88px; height: 31px"
+ src="#CONTEXTPATH#/img/valid-html5-blue.png" alt="HTML5 ist valide!" />
+ </a> <a href="http://jigsaw.w3.org/css-validator/"> <img
+ style="border: 0; width: 88px; height: 31px"
+ src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
+ alt="CSS ist valide!" />
+ </a>
+ </div>
+ </div>
+</body>
+</html \ No newline at end of file
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/stork2_postbinding_template.html b/id/server/idserverlib/src/main/resources/resources/templates/stork2_postbinding_template.html
new file mode 100644
index 000000000..f655caee0
--- /dev/null
+++ b/id/server/idserverlib/src/main/resources/resources/templates/stork2_postbinding_template.html
@@ -0,0 +1,42 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+
+<body onload="document.forms[0].submit()">
+ <noscript>
+ <p>
+ <strong>Note:</strong> Since your browser does not support
+ JavaScript, you must press the Continue button once to proceed.
+ </p>
+ </noscript>
+
+
+ <div id="alert">Your login is being processed. Thank you for
+ waiting.</div>
+
+ <style type="text/css">
+<!--
+#alert {
+ margin: 100px 250px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ font-weight: normal;
+}
+-->
+</style>
+
+ <form action="${action}" method="post" target="_parent">
+ <div>
+ #if($RelayState)<input type="hidden" name="RelayState"
+ value="${RelayState}" />#end #if($SAMLRequest)<input type="hidden"
+ name="SAMLRequest" value="${SAMLRequest}" />#end #if($SAMLResponse)<input
+ type="hidden" name="SAMLResponse" value="${SAMLResponse}" />#end
+
+ </div>
+ <noscript>
+ <div>
+ <input type="submit" value="Continue" />
+ </div>
+ </noscript>
+ </form>
+
+</body>
+</html>
diff --git a/id/templates/.classpath b/id/server/legacy-backup/mw-messages-api/.classpath
index 45d7a5bb5..c15838fd0 100644
--- a/id/templates/.classpath
+++ b/id/server/legacy-backup/mw-messages-api/.classpath
@@ -20,7 +20,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
diff --git a/id/server/legacy-backup/mw-messages-api/.gitignore b/id/server/legacy-backup/mw-messages-api/.gitignore
new file mode 100644
index 000000000..ea8c4bf7f
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/id/server/legacy-backup/mw-messages-api/.project b/id/server/legacy-backup/mw-messages-api/.project
new file mode 100644
index 000000000..cc4d05bc1
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.project
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>mw-messages-api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.core.resources.prefs b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..839d647ee
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.jdt.core.prefs b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..45a6e0e0d
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.m2e.core.prefs b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.component b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.component
new file mode 100644
index 000000000..ec983b870
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="mw-messages-api">
+ <wb-resource deploy-path="/" source-path="/src/main/java"/>
+ <wb-resource deploy-path="/" source-path="/src/main/resources"/>
+ </wb-module>
+</project-modules>
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.project.facet.core.xml b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 000000000..a1f6907b8
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="java" version="1.5"/>
+ <installed facet="jst.utility" version="1.0"/>
+</faceted-project>
diff --git a/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.validation.prefs b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 000000000..04cad8cb7
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1
diff --git a/id/server/legacy-backup/mw-messages-api/mw-messages-api.iml b/id/server/legacy-backup/mw-messages-api/mw-messages-api.iml
new file mode 100644
index 000000000..df1c138c5
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/mw-messages-api.iml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/legacy-backup/mw-messages-api/nb-configuration.xml b/id/server/legacy-backup/mw-messages-api/nb-configuration.xml
new file mode 100644
index 000000000..c51afd41b
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/nb-configuration.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+ <netbeans.hint.jdkPlatform>JDK_1.5</netbeans.hint.jdkPlatform>
+ </properties>
+</project-shared-configuration>
diff --git a/id/server/legacy-backup/mw-messages-api/pom.xml b/id/server/legacy-backup/mw-messages-api/pom.xml
new file mode 100644
index 000000000..0e930ff52
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/pom.xml
@@ -0,0 +1,65 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>MOA.id</groupId>
+ <artifactId>mw-messages-api</artifactId>
+ <packaging>jar</packaging>
+ <version>2.0</version>
+ <name>mw-messages-api</name>
+ <url>http://maven.apache.org</url>
+ <ciManagement>
+ <system>hudson</system>
+ <url>https://vidp.openlimit.com:8120/hudson/job/mw-messages-api/</url>
+ </ciManagement>
+ <distributionManagement>
+ <repository>
+ <id>central</id>
+ <name>STORK-releases</name>
+ <url>https://vidp.openlimit.com:8120/artifactory/libs-release-local</url>
+ </repository>
+</distributionManagement>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>config/sun_checks.xml</configLocation>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+</project>
+
+
+
diff --git a/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/GetAuthDataRequest.java b/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/GetAuthDataRequest.java
new file mode 100644
index 000000000..fab637408
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/GetAuthDataRequest.java
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package eu.stork.vidp.api.messages;
+
+/**
+ * Encapsulates the necessary data for a GetAuthDataRequest to a SPWare
+ *
+ * @author bzwattendorfer
+ *
+ */
+public class GetAuthDataRequest {
+
+ public GetAuthDataRequest() {
+ }
+ String sessionID;
+
+ /**
+ * Constructs a GetAuthDataRequest object
+ * @param sessionID SessionID
+ */
+ public GetAuthDataRequest(String sessionID) {
+ super();
+ this.sessionID = sessionID;
+ }
+
+ /**
+ * Gets the sessionID
+ * @return sessionID
+ */
+ public String getSessionID() {
+ return sessionID;
+ }
+
+ /**
+ * Sets the session ID
+ * @param sessionID sessionID
+ */
+ public void setSessionID(String sessionID) {
+ this.sessionID = sessionID;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("GetAuthDataRequest [");
+ builder.append("sessionID=");
+ builder.append(sessionID);
+ builder.append("]");
+ return builder.toString();
+ }
+}
diff --git a/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/StartAuthResponse.java b/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/StartAuthResponse.java
new file mode 100644
index 000000000..df63afa0e
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/src/main/java/eu/stork/vidp/api/messages/StartAuthResponse.java
@@ -0,0 +1,129 @@
+/**
+ *
+ */
+package eu.stork.vidp.api.messages;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Arrays;
+
+/**
+ * Class encapsulating the HTML content to be returned to the user's browser
+ *
+ * @author bzwattendorfer
+ *
+ */
+public class StartAuthResponse implements Serializable {
+
+ private int httpStatusCode;
+ private byte[] content;
+ private Map<String, String> httpHeaders;
+
+ /**
+ * Creates a new StartAuthenticationResponse object
+ * @param httpStatusCode HTTP Status code to be returned to the user's browser
+ * @param content HTML content to be returned to the user's browser
+ * @param httpHeaders HTTP headers to be returned to the user's browser
+ */
+ public StartAuthResponse() {
+ super();
+ }
+
+ public StartAuthResponse(int httpStatusCode, byte[] content,
+ Map<String, String> httpHeaders) {
+ super();
+ this.httpStatusCode = httpStatusCode;
+ this.content = content;
+ this.httpHeaders = httpHeaders;
+ }
+
+ /**
+ * Creates a new StartAuthenticationResponse object
+ * @param httpStatusCode HTTP Status code to be returned to the user's browser
+ * @param content HTML content to be returned to the user's browser
+ */
+ public StartAuthResponse(int httpStatusCode, byte[] content) {
+ super();
+ this.httpStatusCode = httpStatusCode;
+ this.content = content;
+ this.httpHeaders = new HashMap<String, String>();
+ }
+
+ /**
+ * Gets the HTTP status code
+ * @return HTTP status code
+ */
+ public int getHttpStatusCode() {
+ return httpStatusCode;
+ }
+
+ /**
+ * Sets the HTTP status code
+ * @param httpStatusCode HTTP status code
+ */
+ public void setHttpStatusCode(int httpStatusCode) {
+ this.httpStatusCode = httpStatusCode;
+ }
+
+ /**
+ * Gets the HTML content
+ * @return HTML content
+ */
+ public byte[] getContent() {
+ return content;
+ }
+
+ /**
+ * Sets the HTML content
+ * @param content HTML content
+ */
+ public void setContent(byte[] content) {
+ this.content = content;
+ }
+
+ /**
+ * Gets the Map containing the HTTP headers
+ * @return HTTP header map
+ */
+ public Map<String, String> getHttpHeaders() {
+ return httpHeaders;
+ }
+
+ /**
+ * Sets the Map with HTTP Headers
+ * @param httpHeaders HTTP Headers Map
+ */
+ public void setHttpHeaders(Map<String, String> httpHeaders) {
+ this.httpHeaders = httpHeaders;
+ }
+
+ /**
+ * Adds a HTTP Header to the Map
+ * @param key HTTP Header name
+ * @param value HTTP Header value
+ */
+ public void addHeader(String key, String value) {
+ }
+
+ /**
+ * Removes a HTTP Header
+ * @param key HTTP Header name
+ */
+ public void removeHeader(String key) {
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("StartAuthResponse [");
+ builder.append("content=");
+ builder.append(Arrays.toString(content));
+ builder.append(", httpHeaders=");
+ builder.append(httpHeaders);
+ builder.append(", httpStatusCode=");
+ builder.append(httpStatusCode);
+ builder.append("]");
+ return builder.toString();
+ }
+}
diff --git a/id/server/legacy-backup/mw-messages-api/src/test/java/eu/stork/mw/core/mwmessagesapi/AppTest.java b/id/server/legacy-backup/mw-messages-api/src/test/java/eu/stork/mw/core/mwmessagesapi/AppTest.java
new file mode 100644
index 000000000..8845aa855
--- /dev/null
+++ b/id/server/legacy-backup/mw-messages-api/src/test/java/eu/stork/mw/core/mwmessagesapi/AppTest.java
@@ -0,0 +1,38 @@
+package eu.stork.mw.core.mwmessagesapi;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/id/server/legacy-backup/stork-saml-engine/pom.xml b/id/server/legacy-backup/stork-saml-engine/pom.xml
new file mode 100644
index 000000000..807991b24
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/pom.xml
@@ -0,0 +1,92 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>moa-id</artifactId>
+ <groupId>MOA.id</groupId>
+ <version>1.9.96-SNAPSHOT</version>
+ </parent>
+ <artifactId>stork-saml-engine</artifactId>
+ <version>1.5.2</version>
+ <name>STORK SAML Engine</name>
+ <description>SAML2 related stuff for STORK</description>
+
+ <build>
+
+<plugins>
+<plugin>
+<groupId>org.apache.maven.plugins</groupId>
+<artifactId>maven-compiler-plugin</artifactId>
+<configuration>
+<source>1.5</source>
+<target>1.5</target>
+</configuration>
+</plugin>
+</plugins>
+</build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>2.5.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ <version>1.3.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>openws</artifactId>
+ <version>1.4.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.4</version>
+ <!-- scope>runtime</scope -->
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork-saml-engine/stork-saml-engine.iml b/id/server/legacy-backup/stork-saml-engine/stork-saml-engine.iml
new file mode 100644
index 000000000..8f1d23626
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/stork-saml-engine.iml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../target/classes" />
+ <output-test url="file://$MODULE_DIR$/../../target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.5.3" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.4.4" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.3.4" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.3" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.4.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: velocity:velocity:1.5" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKAuthnRequest.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKAuthnRequest.class
new file mode 100644
index 000000000..9da222759
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKAuthnRequest.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKResponse.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKResponse.class
new file mode 100644
index 000000000..5acacce54
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/mw/messages/saml/STORKResponse.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/builder/STORKMessagesBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/builder/STORKMessagesBuilder.class
new file mode 100644
index 000000000..5d1405909
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/builder/STORKMessagesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKBootstrap.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKBootstrap.class
new file mode 100644
index 000000000..d70732c97
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKBootstrap.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKConstants.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKConstants.class
new file mode 100644
index 000000000..15b6642c7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/common/STORKConstants.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLException.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLException.class
new file mode 100644
index 000000000..8cc0744a7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLException.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLValidationException.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLValidationException.class
new file mode 100644
index 000000000..9c17ffcab
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/exception/SAMLValidationException.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttribute.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttribute.class
new file mode 100644
index 000000000..69c7b6a31
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttribute.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttributeValue.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttributeValue.class
new file mode 100644
index 000000000..fdba9d899
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKAttributeValue.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKExtensions.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKExtensions.class
new file mode 100644
index 000000000..da41434ba
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKExtensions.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKRequestedAttribute.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKRequestedAttribute.class
new file mode 100644
index 000000000..77dd18b84
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/STORKRequestedAttribute.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.class
new file mode 100644
index 000000000..94416aff9
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.class
new file mode 100644
index 000000000..19b719990
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.class
new file mode 100644
index 000000000..854a1c586
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.class
new file mode 100644
index 000000000..f5c658280
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.class
new file mode 100644
index 000000000..398009931
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.class
new file mode 100644
index 000000000..36839068f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.class
new file mode 100644
index 000000000..7fe176d1a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.class
new file mode 100644
index 000000000..6f83ba3bf
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.class
new file mode 100644
index 000000000..ff457bc70
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.class
new file mode 100644
index 000000000..931bbe347
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.class
new file mode 100644
index 000000000..d556f6c42
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.class
new file mode 100644
index 000000000..d5f4ea438
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.class
new file mode 100644
index 000000000..f44f58bf1
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.class
new file mode 100644
index 000000000..e406380e4
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.class
new file mode 100644
index 000000000..267308c79
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.class
new file mode 100644
index 000000000..69d8ae575
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.class
new file mode 100644
index 000000000..d068906fd
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.class
new file mode 100644
index 000000000..9648874b2
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.class
new file mode 100644
index 000000000..81dd294a3
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/AuthenticationAttributes.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/AuthenticationAttributes.class
new file mode 100644
index 000000000..cde53002e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/AuthenticationAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/CitizenCountryCode.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/CitizenCountryCode.class
new file mode 100644
index 000000000..c731fb19f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/CitizenCountryCode.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossBorderShare.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossBorderShare.class
new file mode 100644
index 000000000..d23b85439
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossBorderShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossSectorShare.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossSectorShare.class
new file mode 100644
index 000000000..bca2137d3
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDCrossSectorShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDSectorShare.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDSectorShare.class
new file mode 100644
index 000000000..efee1c155
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/EIDSectorShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.class
new file mode 100644
index 000000000..fda894367
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/RequestedAttributes.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/RequestedAttributes.class
new file mode 100644
index 000000000..8acef05d1
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/RequestedAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPAuthRequest.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPAuthRequest.class
new file mode 100644
index 000000000..d8b1bf7d4
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPAuthRequest.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertEnc.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertEnc.class
new file mode 100644
index 000000000..1e9b4bd96
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertEnc.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertSig.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertSig.class
new file mode 100644
index 000000000..c562f4951
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertSig.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertType.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertType.class
new file mode 100644
index 000000000..2e2e7ccb9
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPCertType.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPID.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPID.class
new file mode 100644
index 000000000..6031f8e85
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPID.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPInformation.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPInformation.class
new file mode 100644
index 000000000..a542a6bd4
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SPInformation.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpApplication.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpApplication.class
new file mode 100644
index 000000000..917722486
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpApplication.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpCountry.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpCountry.class
new file mode 100644
index 000000000..120f2800e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpCountry.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpInstitution.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpInstitution.class
new file mode 100644
index 000000000..526beebe5
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpInstitution.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpSector.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpSector.class
new file mode 100644
index 000000000..6985e6ca8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/SpSector.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.class
new file mode 100644
index 000000000..0649901ca
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.class
new file mode 100644
index 000000000..e66f8cf15
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.class
new file mode 100644
index 000000000..20bdac735
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.class
new file mode 100644
index 000000000..85615c53f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.class
new file mode 100644
index 000000000..71002f3e2
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.class
new file mode 100644
index 000000000..1a5466e90
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.class
new file mode 100644
index 000000000..e28970ac2
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.class
new file mode 100644
index 000000000..b67275405
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.class
new file mode 100644
index 000000000..ff3777b25
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.class
new file mode 100644
index 000000000..8e8b8709a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.class
new file mode 100644
index 000000000..495fdbf8c
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.class
new file mode 100644
index 000000000..734f92660
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.class
new file mode 100644
index 000000000..ac333c00f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.class
new file mode 100644
index 000000000..9d6ad885d
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.class
new file mode 100644
index 000000000..05a63f48e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.class
new file mode 100644
index 000000000..a89eafd3a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.class
new file mode 100644
index 000000000..f82bca23b
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.class
new file mode 100644
index 000000000..e176bba7f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.class
new file mode 100644
index 000000000..322a5ef4a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.class
new file mode 100644
index 000000000..97361bfee
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.class
new file mode 100644
index 000000000..0319ebe3e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.class
new file mode 100644
index 000000000..4f3a7abe8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.class
new file mode 100644
index 000000000..da9939089
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.class
new file mode 100644
index 000000000..f145f8a05
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.class
new file mode 100644
index 000000000..618ee5267
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.class
new file mode 100644
index 000000000..ff99e4aae
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.class
new file mode 100644
index 000000000..ccd513834
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.class
new file mode 100644
index 000000000..6929c3527
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.class
new file mode 100644
index 000000000..79e1b8f9f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.class
new file mode 100644
index 000000000..65d837a2f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.class
new file mode 100644
index 000000000..6102fb493
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.class
new file mode 100644
index 000000000..55b0e62f8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.class
new file mode 100644
index 000000000..9653bb589
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.class
new file mode 100644
index 000000000..b92ff8a8a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.class
new file mode 100644
index 000000000..12913860b
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.class
new file mode 100644
index 000000000..ec4962d6f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.class
new file mode 100644
index 000000000..07ebbed30
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.class
new file mode 100644
index 000000000..24f09f271
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.class
new file mode 100644
index 000000000..20e0b4fe7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.class
new file mode 100644
index 000000000..1d03a83da
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.class
new file mode 100644
index 000000000..5d057f9fd
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.class
new file mode 100644
index 000000000..de7b2c5b8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.class
new file mode 100644
index 000000000..0d25eb9a4
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.class
new file mode 100644
index 000000000..953634dd8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDBuilder.class
new file mode 100644
index 000000000..170a4eced
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDImpl.class
new file mode 100644
index 000000000..23d9e007f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.class
new file mode 100644
index 000000000..b04bbd283
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.class
new file mode 100644
index 000000000..58e122b17
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.class
new file mode 100644
index 000000000..7146d2b78
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationImpl.class
new file mode 100644
index 000000000..572237008
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.class
new file mode 100644
index 000000000..e80dda7f9
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.class
new file mode 100644
index 000000000..31622983b
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.class
new file mode 100644
index 000000000..f390d99c7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.class
new file mode 100644
index 000000000..38da57999
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.class
new file mode 100644
index 000000000..a895869c4
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.class
new file mode 100644
index 000000000..07de04cac
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.class
new file mode 100644
index 000000000..13a895da0
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryImpl.class
new file mode 100644
index 000000000..e2154b721
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.class
new file mode 100644
index 000000000..d42d6f918
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.class
new file mode 100644
index 000000000..356b05130
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.class
new file mode 100644
index 000000000..6abb47780
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.class
new file mode 100644
index 000000000..d198111ea
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.class
new file mode 100644
index 000000000..37f993108
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.class
new file mode 100644
index 000000000..e43c66d33
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.class
new file mode 100644
index 000000000..3be4832f0
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorImpl.class
new file mode 100644
index 000000000..cff58c471
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.class
new file mode 100644
index 000000000..94ba5e9d0
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.class
new file mode 100644
index 000000000..d78ebf3a6
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.class
new file mode 100644
index 000000000..fdc00be92
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.class
new file mode 100644
index 000000000..37d8f77d3
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.class
new file mode 100644
index 000000000..f1a970278
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.class
new file mode 100644
index 000000000..adeecee93
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/SAMLUtil.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/SAMLUtil.class
new file mode 100644
index 000000000..8b0826288
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/SAMLUtil.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/XMLUtil.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/XMLUtil.class
new file mode 100644
index 000000000..5651fc2e6
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/util/XMLUtil.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAssertionValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAssertionValidator.class
new file mode 100644
index 000000000..75d85acfd
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAssertionValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAttributeValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAttributeValidator.class
new file mode 100644
index 000000000..5b15bf743
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAttributeValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.class
new file mode 100644
index 000000000..423473ef6
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.class
new file mode 100644
index 000000000..02d407565
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.class
new file mode 100644
index 000000000..1f389c85e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.class
new file mode 100644
index 000000000..c37c46c76
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.class
new file mode 100644
index 000000000..0cb22190a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkConditionsValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkConditionsValidator.class
new file mode 100644
index 000000000..a874e5d52
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkConditionsValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.class
new file mode 100644
index 000000000..498e7a186
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.class
new file mode 100644
index 000000000..ee67bbc5f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.class
new file mode 100644
index 000000000..cfc82bdb8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkExtensionsValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkExtensionsValidator.class
new file mode 100644
index 000000000..4206cc8f6
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkExtensionsValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkIssuerValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkIssuerValidator.class
new file mode 100644
index 000000000..cf00c682a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkIssuerValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIDValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIDValidator.class
new file mode 100644
index 000000000..993d83f7c
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIDValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.class
new file mode 100644
index 000000000..cf4557654
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.class
new file mode 100644
index 000000000..3a723b910
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.class
new file mode 100644
index 000000000..aa05d4b0e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.class
new file mode 100644
index 000000000..a616bd87d
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkResponseValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkResponseValidator.class
new file mode 100644
index 000000000..1dd25036d
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkResponseValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPIDValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPIDValidator.class
new file mode 100644
index 000000000..be9793f6f
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPIDValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPInformationValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPInformationValidator.class
new file mode 100644
index 000000000..fa929ea24
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSPInformationValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.class
new file mode 100644
index 000000000..102b544a8
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpCountryValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpCountryValidator.class
new file mode 100644
index 000000000..d69211c06
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpCountryValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.class
new file mode 100644
index 000000000..3b4550dc6
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpSectorValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpSectorValidator.class
new file mode 100644
index 000000000..2940295a7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSpSectorValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.class
new file mode 100644
index 000000000..75356ecad
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusValidator.class
new file mode 100644
index 000000000..eaeeaf1e7
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkStatusValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.class
new file mode 100644
index 000000000..5f6a6349c
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.class
new file mode 100644
index 000000000..e3c1afaad
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectValidator.class
new file mode 100644
index 000000000..5f594af82
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkSubjectValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.class b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.class
new file mode 100644
index 000000000..0eb6d2a57
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-post-binding-moa.vm b/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-post-binding-moa.vm
new file mode 100644
index 000000000..cac0bda76
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-post-binding-moa.vm
@@ -0,0 +1,38 @@
+##
+## 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
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+
+ <body onload="document.forms[0].submit()">
+ <noscript>
+ <p>
+ <strong>Note:</strong> Since your browser does not support JavaScript,
+ you must press the Continue button once to proceed.
+ </p>
+ </noscript>
+
+ <form action="${action}" method="post" target="_parent">
+ <div>
+ #if($RelayState)<input type="hidden" name="RelayState" value="${RelayState}"/>#end
+
+ #if($SAMLRequest)<input type="hidden" name="SAMLRequest" value="${SAMLRequest}"/>#end
+
+ #if($SAMLResponse)<input type="hidden" name="SAMLResponse" value="${SAMLResponse}"/>#end
+
+ </div>
+ <noscript>
+ <div>
+ <input type="submit" value="Continue"/>
+ </div>
+ </noscript>
+ </form>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-stork-config.xml b/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-stork-config.xml
new file mode 100644
index 000000000..f83c7337e
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/classes/saml2-stork-config.xml
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMLTooling xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.opensaml.org/xmltooling-config ../../src/schema/xmltooling-config.xsd"
+ xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion"
+ xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
+ xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#"
+ xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
+ xmlns="http://www.opensaml.org/xmltooling-config">
+
+ <!-- SAML 2.0 Protocol Object providers -->
+ <ObjectProviders>
+
+
+ <!-- AuthnRequest provider -->
+ <ObjectProvider qualifiedName="saml2p:AuthnRequest">
+ <BuilderClass className="eu.stork.vidp.messages.saml.impl.STORKAuthnRequestBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKAuthnRequestMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKAuthnRequestUnmarshaller" />
+ </ObjectProvider>
+
+ <!-- Response provider -->
+ <ObjectProvider qualifiedName="saml2p:Response">
+ <BuilderClass className="eu.stork.vidp.messages.saml.impl.STORKResponseBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKResponseMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKResponseUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="saml2p:Extensions">
+ <BuilderClass className="eu.stork.vidp.messages.saml.impl.STORKExtensionsBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKExtensionsMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKExtensionsUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:AuthenticationAttributes">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.AuthenticationAttributesBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.AuthenticationAttributesMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.AuthenticationAttributesUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:CitizenCountryCode">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.CitizenCountryCodeBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.CitizenCountryCodeMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.CitizenCountryCodeUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:SPAuthRequest">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SPAuthRequestBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SPAuthRequestMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SPAuthRequestUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:SPCertEnc">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SPCertEncBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SPCertEncMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SPCertEncUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:SPCertSig">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SPCertSigBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SPCertSigMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SPCertSigUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:SPID">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SPIDBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SPIDMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SPIDUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:SPInformation">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SPInformationBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SPInformationMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SPInformationUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:VIDPAuthenticationAttributes">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.VIDPAuthenticationAttributesBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.VIDPAuthenticationAttributesMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.VIDPAuthenticationAttributesUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:QualityAuthenticationAssuranceLevel">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.QualityAuthenticationAssuranceLevelBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.QualityAuthenticationAssuranceLevelMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.QualityAuthenticationAssuranceLevelUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:RequestedAttributes">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.RequestedAttributesBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.RequestedAttributesMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.RequestedAttributesUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:RequestedAttribute">
+ <BuilderClass className="eu.stork.vidp.messages.saml.impl.STORKRequestedAttributeBuilder" />
+ <MarshallingClass className="org.opensaml.saml2.metadata.impl.RequestedAttributeMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.saml.impl.STORKRequestedAttributeUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:eIDSectorShare">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.EIDSectorShareBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDSectorShareMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDSectorShareUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:eIDCrossSectorShare">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.EIDCrossSectorShareBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDCrossSectorShareMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDCrossSectorShareUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="storkp:eIDCrossBorderShare">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.EIDCrossBorderShareBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDCrossBorderShareMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.EIDCrossBorderShareUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:spSector">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SpSectorBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SpSectorMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SpSectorUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:spApplication">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SpApplicationBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SpApplicationMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SpApplicationUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:spCountry">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SpCountryBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SpCountryMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SpCountryUnmarshaller" />
+ </ObjectProvider>
+
+ <ObjectProvider qualifiedName="stork:spInstitution">
+ <BuilderClass className="eu.stork.vidp.messages.stork.impl.SpInstitutionBuilder" />
+ <MarshallingClass className="eu.stork.vidp.messages.stork.impl.SpInstitutionMarshaller" />
+ <UnmarshallingClass className="eu.stork.vidp.messages.stork.impl.SpInstitutionUnmarshaller" />
+ </ObjectProvider>
+
+ </ObjectProviders>
+
+ <!-- Validation rules for SAML 2.0 SAMLObjects -->
+ <ValidatorSuites>
+
+ <!-- SAML 2.0 Schema Validation Rules -->
+ <ValidatorSuite id="saml2-core-schema-and-stork-validator">
+ <Validator qualifiedName="saml2:Action" className="org.opensaml.saml2.core.validator.ActionSchemaValidator" />
+ <Validator qualifiedName="saml2p:Artifact" className="org.opensaml.saml2.core.validator.ArtifactSchemaValidator" />
+ <Validator qualifiedName="saml2p:ArtifactResolve" className="org.opensaml.saml2.core.validator.ArtifactResolveSchemaValidator" />
+ <Validator qualifiedName="saml2p:ArtifactResponse" className="org.opensaml.saml2.core.validator.ArtifactResponseSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:Assertion" className="org.opensaml.saml2.core.validator.AssertionSchemaValidator" /-->
+ <Validator qualifiedName="saml2:AssertionIDRef" className="org.opensaml.saml2.core.validator.AssertionIDRefSchemaValidator" />
+ <Validator qualifiedName="saml2:AssertionIDRequest" className="org.opensaml.saml2.core.validator.AssertionIDRequestSchemaValidator" />
+ <Validator qualifiedName="saml2:AssertionURIRef" className="org.opensaml.saml2.core.validator.AssertionURIRefSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:Attribute" className="org.opensaml.saml2.core.validator.AttributeSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:AttributeQuery" className="org.opensaml.saml2.core.validator.AttributeQuerySchemaValidator" />
+ <Validator qualifiedName="saml2:AttributeStatement" className="org.opensaml.saml2.core.validator.AttributeStatementSchemaValidator" />
+ <Validator qualifiedName="saml2:Audience" className="org.opensaml.saml2.core.validator.AudienceSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:AudienceRestriction" className="org.opensaml.saml2.core.validator.AudienceRestrictionSchemaValidator" /-->
+ <Validator qualifiedName="saml2:AuthenticatingAuthority" className="org.opensaml.saml2.core.validator.AuthenticatingAuthoritySchemaValidator" />
+ <Validator qualifiedName="saml2:AuthnContextClassRef" className="org.opensaml.saml2.core.validator.AuthnContextClassRefSchemaValidator" />
+ <Validator qualifiedName="saml2:AuthnContextDeclRef" className="org.opensaml.saml2.core.validator.AuthnContextDeclRefSchemaValidator" />
+ <Validator qualifiedName="saml2:AuthnContextDecl" className="org.opensaml.saml2.core.validator.AuthnContextDeclSchemaValidator" />
+ <Validator qualifiedName="saml2p:AuthnQuery" className="org.opensaml.saml2.core.validator.AuthnQuerySchemaValidator" />
+ <!-- Validator qualifiedName="saml2p:AuthnRequest" className="org.opensaml.saml2.core.validator.AuthnRequestSchemaValidator" /-->
+ <!-- Validator qualifiedName="saml2:AuthnStatement" className="org.opensaml.saml2.core.validator.AuthnStatementSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:AuthzDecisionQuery" className="org.opensaml.saml2.core.validator.AuthzDecisionQuerySchemaValidator" />
+ <Validator qualifiedName="saml2:AuthzDecisionStatement" className="org.opensaml.saml2.core.validator.AuthzDecisionStatementSchemaValidator" />
+ <Validator qualifiedName="saml2:AuthnContextClassRef" className="org.opensaml.saml2.core.validator.AuthnContextClassRefSchemaValidator" />
+ <Validator qualifiedName="saml2:Evidence" className="org.opensaml.saml2.core.validator.EvidenceSchemaValidator" />
+ <Validator qualifiedName="saml2p:GetComplete" className="org.opensaml.saml2.core.validator.GetCompleteSchemaValidator" />
+ <Validator qualifiedName="saml2p:IDPEntry" className="org.opensaml.saml2.core.validator.IDPEntrySchemaValidator" />
+ <Validator qualifiedName="saml2p:IDPList" className="org.opensaml.saml2.core.validator.IDPListSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:Issuer" className="org.opensaml.saml2.core.validator.IssuerSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:LogoutRequest" className="org.opensaml.saml2.core.validator.LogoutRequestSchemaValidator" />
+ <Validator qualifiedName="saml2p:LogoutResponse" className="org.opensaml.saml2.core.validator.LogoutResponseSchemaValidator" />
+ <Validator qualifiedName="saml2p:ManageNameIDRequest" className="org.opensaml.saml2.core.validator.ManageNameIDRequestSchemaValidator" />
+ <Validator qualifiedName="saml2p:ManageNameIDResponse" className="org.opensaml.saml2.core.validator.ManageNameIDResponseSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:NameID" className="org.opensaml.saml2.core.validator.NameIDSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:NameIDMappingRequest" className="org.opensaml.saml2.core.validator.NameIDMappingRequestSchemaValidator" />
+ <Validator qualifiedName="saml2p:NameIDMappingResponse" className="org.opensaml.saml2.core.validator.NameIDMappingResponseSchemaValidator" />
+ <Validator qualifiedName="saml2p:NewID" className="org.opensaml.saml2.core.validator.NewIDSchemaValidator" />
+ <Validator qualifiedName="saml2p:RequestedAuthnContext" className="org.opensaml.saml2.core.validator.RequestedAuthnContextSchemaValidator" />
+ <Validator qualifiedName="saml2p:RequesterID" className="org.opensaml.saml2.core.validator.RequesterIDSchemaValidator" />
+ <!-- Validator qualifiedName="saml2p:Response" className="org.opensaml.saml2.core.validator.ResponseSchemaValidator" /-->
+ <Validator qualifiedName="saml2:SessionIndex" className="org.opensaml.saml2.core.validator.SessionIndexSchemaValidator" />
+ <!-- Validator qualifiedName="saml2p:Status" className="org.opensaml.saml2.core.validator.StatusSchemaValidator" /-->
+ <!-- Validator qualifiedName="saml2p:StatusCode" className="org.opensaml.saml2.core.validator.StatusCodeSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:StatusMessage" className="org.opensaml.saml2.core.validator.StatusMessageSchemaValidator" />
+ <!-- Validator qualifiedName="saml2:Subject" className="org.opensaml.saml2.core.validator.SubjectSchemaValidator" /-->
+ <!-- Validator qualifiedName="saml2:SubjectConfirmation" className="org.opensaml.saml2.core.validator.SubjectConfirmationSchemaValidator" /-->
+ <Validator qualifiedName="saml2p:Response" className="eu.stork.vidp.messages.validation.StorkResponseValidator" />
+ <Validator qualifiedName="saml2:Issuer" className="eu.stork.vidp.messages.validation.StorkIssuerValidator" />
+ <Validator qualifiedName="saml2p:Status" className="eu.stork.vidp.messages.validation.StorkStatusValidator" />
+ <Validator qualifiedName="saml2p:StatusCode" className="eu.stork.vidp.messages.validation.StorkStatusCodeValidator" />
+ <Validator qualifiedName="saml2:Assertion" className="eu.stork.vidp.messages.validation.StorkAssertionValidator" />
+ <Validator qualifiedName="saml2:Subject" className="eu.stork.vidp.messages.validation.StorkSubjectValidator" />
+ <Validator qualifiedName="saml2:NameID" className="eu.stork.vidp.messages.validation.StorkNameIDValidator" />
+ <Validator qualifiedName="saml2:EncryptedID" className="eu.stork.vidp.messages.validation.StorkEncryptedIdValidator" />
+ <Validator qualifiedName="saml2:SubjectConfirmation" className="eu.stork.vidp.messages.validation.StorkSubjectConfirmationValidator" />
+ <Validator qualifiedName="saml2:AudienceRestriction" className="eu.stork.vidp.messages.validation.StorkAudienceRestrictionValidator" />
+ <Validator qualifiedName="saml2:Conditions" className="eu.stork.vidp.messages.validation.StorkConditionsValidator" />
+ <Validator qualifiedName="saml2:AuthnStatement" className="eu.stork.vidp.messages.validation.StorkAuthnStatementValidator" />
+ <Validator qualifiedName="saml2:SubjectLocality" className="eu.stork.vidp.messages.validation.StorkSubjectLocalityValidator" />
+ <Validator qualifiedName="saml2:Attribute" className="eu.stork.vidp.messages.validation.StorkAttributeValidator" />
+ <Validator qualifiedName="saml2:EncryptedAttribute" className="eu.stork.vidp.messages.validation.StorkEncryptedAttributeValidator" />
+ <Validator qualifiedName="saml2p:AuthnRequest" className="eu.stork.vidp.messages.validation.StorkAuthnRequestValidator" />
+ <Validator qualifiedName="storkp:AuthenticationAttributes" className="eu.stork.vidp.messages.validation.StorkAuthenticationAttributesValidator" />
+ <Validator qualifiedName="storkp:SPID" className="eu.stork.vidp.messages.validation.StorkSPIDValidator" />
+ <Validator qualifiedName="storkp:SPInformation" className="eu.stork.vidp.messages.validation.StorkSPInformationValidator" />
+ <!-- Validator qualifiedName="stork:FinalRedirectURL" className="eu.stork.vidp.messages.validation.StorkFinalRedirectURLValidator" /-->
+ <Validator qualifiedName="storkp:CitizenCountryCode" className="eu.stork.vidp.messages.validation.StorkCitizenCountryCodeValidator" />
+ <Validator qualifiedName="storkp:VIDPAuthenticationAttributes" className="eu.stork.vidp.messages.validation.StorkVIDPAuthenticationAttributesValidator" />
+ <Validator qualifiedName="stork:RequestedAttribute" className="eu.stork.vidp.messages.validation.StorkRequestedAttributeValidator" />
+ <Validator qualifiedName="storkp:RequestedAttributes" className="eu.stork.vidp.messages.validation.StorkRequestedAttributesValidator" />
+ <Validator qualifiedName="stork:QualityAuthenticationAssuranceLevel" className="eu.stork.vidp.messages.validation.StorkQualityAuthenticationAssuranceLevelValidator" />
+ <Validator qualifiedName="saml2p:Extensions" className="eu.stork.vidp.messages.validation.StorkExtensionsValidator" />
+ <Validator qualifiedName="saml2:NameIdPolicy" className="eu.stork.vidp.messages.validation.StorkNameIdPolicyValidator" />
+ <Validator qualifiedName="ds:Signature" className="org.opensaml.xml.signature.validator.SignatureSchemaValidator" />
+ <Validator qualifiedName="stork:spSector" className="eu.stork.vidp.messages.validation.StorkSpSectorValidator" />
+ <Validator qualifiedName="stork:spApplication" className="eu.stork.vidp.messages.validation.StorkSpApplicationValidator" />
+ <Validator qualifiedName="stork:spCountry" className="eu.stork.vidp.messages.validation.StorkSpCountryValidator" />
+ <Validator qualifiedName="stork:Institution" className="eu.stork.vidp.messages.validation.StorkSpInstitutionValidator" />
+
+
+ </ValidatorSuite>
+
+ <!-- SAML 2.0 Specification Validation Rules -->
+ <ValidatorSuite id="saml2-core-spec-validator">
+ <Validator qualifiedName="saml2:Assertion" className="org.opensaml.saml2.core.validator.AssertionSpecValidator" />
+ <Validator qualifiedName="saml2:Conditions" className="org.opensaml.saml2.core.validator.ConditionsSpecValidator" />
+ </ValidatorSuite>
+
+ </ValidatorSuites>
+
+
+ </XMLTooling> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork-saml-engine/target/maven-archiver/pom.properties b/id/server/legacy-backup/stork-saml-engine/target/maven-archiver/pom.properties
new file mode 100644
index 000000000..5a1b017ed
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/maven-archiver/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Wed Jan 22 11:26:40 CET 2014
+version=1.5.2
+groupId=MOA.id
+artifactId=stork-saml-engine
diff --git a/id/server/legacy-backup/stork-saml-engine/target/stork-saml-engine-1.5.2.jar b/id/server/legacy-backup/stork-saml-engine/target/stork-saml-engine-1.5.2.jar
new file mode 100644
index 000000000..310f5fb0a
--- /dev/null
+++ b/id/server/legacy-backup/stork-saml-engine/target/stork-saml-engine-1.5.2.jar
Binary files differ
diff --git a/id/server/legacy-backup/stork2-commons/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/.svn/all-wcprops
new file mode 100644
index 000000000..256ae0266
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/CITnet/svn/STORK2/!svn/ver/493/trunk/Commons
+END
+Releases
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/493/trunk/Commons/Releases
+END
+pom.xml
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/CITnet/svn/STORK2/!svn/ver/493/trunk/Commons/pom.xml
+END
diff --git a/id/server/legacy-backup/stork2-commons/.svn/dir-prop-base b/id/server/legacy-backup/stork2-commons/.svn/dir-prop-base
new file mode 100644
index 000000000..9dc541cfd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/.svn/dir-prop-base
@@ -0,0 +1,10 @@
+K 10
+svn:ignore
+V 44
+.classpath
+.project
+.settings
+report
+target
+
+END
diff --git a/id/server/legacy-backup/stork2-commons/.svn/entries b/id/server/legacy-backup/stork2-commons/.svn/entries
new file mode 100644
index 000000000..148e40ca3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/.svn/entries
@@ -0,0 +1,99 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T19:49:15.801345Z
+493
+emferreri
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+Releases
+file
+
+
+
+
+2014-01-21T08:38:55.424702Z
+5baf63f5379c354181f211dc4da29a64
+2014-01-15T19:49:15.801345Z
+493
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2402
+
+src
+dir
+
+pom.xml
+file
+
+
+
+
+2014-01-21T08:38:55.428702Z
+dc8551a0a1e6a9a3a63052bd0dd3de55
+2014-01-15T19:49:15.801345Z
+493
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5777
+
diff --git a/id/server/legacy-backup/stork2-commons/.svn/text-base/Releases.svn-base b/id/server/legacy-backup/stork2-commons/.svn/text-base/Releases.svn-base
new file mode 100644
index 000000000..54aeb9313
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/.svn/text-base/Releases.svn-base
@@ -0,0 +1,62 @@
+Created 06-04-2011
+
+Branch : STORKCommons_0_5_UPDATE_06042011
+Date : 06-04-2011
+Changes: No changes.
+
+Branch : STORKCommons_0_5_UPDATE_07072011
+Date : 07-07-2011
+Changes: Inserted constants to HttpOnly HTTP Header.
+
+Branch : STORKCommons_0_6
+Date : 07-11-2011
+Changes: Improved error exception handling (few changes on the exception classes).
+ Improved Constansts (unused removed, others added).
+ Unit Tests include (almost all the code is cover).
+ Fix some minor bugs found on unit tests.
+ New Copyright License added.
+ PEPUtils refactored.
+ Improved error code message (three kind of messages: to citizen, admin and saml token).
+
+Branch : STORKCommons_0_6_1
+Date : 28-11-2011
+Changes: Removed unnecessary javadoc package file.
+ Updated pepsUtils.properties file (check attribute value had old error message)
+
+Branch : STORKCommons_0_9
+Date : 02-12-2011
+Changes: Updated Version to 0.9
+
+Branch : STORKCommons_1_0
+Date : 02-12-2011
+Changes: Updated Version to 1.0
+
+Branch : STORKCommons_1_1_0
+Date : 01-11-2013
+Changes: Updated Version to 1.1.0
+ Dependencies updated
+ Business Logic Part I changes
+ SAML Engine Changes merged (from SamlEngine/1.1.0/Commons branch to be easier to merge this branch with trunk)
+ Fixed some errors on Test Case
+
+Branch : STORKCommons_1_1_1
+Date : 02-12-2013
+Changes: Updated Version to 1.1.1
+ Added mandate error code
+ PMD quality code changes (some final identifier missing)
+ Added new methods to personal attribute list to get Mandatory/Optional and/or Simple/Complex attributes
+ Added new unit tests
+
+Branch : Commons (Trunk)
+Date : 15-01-2014
+Version: 1.2.0
+Release: 2
+Changes: Updated Version to 1.2.0
+ dded request flow of PV (incomplete)
+ Added AP mandatory attribute to get data for business attributes
+ *) based on configuration file it adds the missing attributes (eIdentifier, givenName, surname and dateOfBirth) or change isRequired to true.
+ changes original isRequired state in response
+ Added new Interface (IAttributeListProcessor) to make some operations on attribute lists
+ Power Validation is complete now
+ Business Logic I and II integration (Request Complete!)
+ Added new method to Personal attribute List to check if there is at least one attribute with no value.
diff --git a/repository/eu/stork/Commons/1.2.0/Commons-1.2.0.pom b/id/server/legacy-backup/stork2-commons/.svn/text-base/pom.xml.svn-base
index b658a8e12..a71ee1628 100644
--- a/repository/eu/stork/Commons/1.2.0/Commons-1.2.0.pom
+++ b/id/server/legacy-backup/stork2-commons/.svn/text-base/pom.xml.svn-base
@@ -15,15 +15,6 @@
The STORKCommons library provides beans, Java Interfaces and utility classes to integrate PEPS and SAML Engine.
</description>
-
- <repositories>
- <repository>
- <id>shibboleth.internet2.edu</id>
- <name>Internet2</name>
- <url>https://build.shibboleth.net/nexus/content/groups/public/</url>
- </repository>
- </repositories>
-
<dependencies>
<!-- Joda -->
diff --git a/id/server/legacy-backup/stork2-commons/Releases b/id/server/legacy-backup/stork2-commons/Releases
new file mode 100644
index 000000000..54aeb9313
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/Releases
@@ -0,0 +1,62 @@
+Created 06-04-2011
+
+Branch : STORKCommons_0_5_UPDATE_06042011
+Date : 06-04-2011
+Changes: No changes.
+
+Branch : STORKCommons_0_5_UPDATE_07072011
+Date : 07-07-2011
+Changes: Inserted constants to HttpOnly HTTP Header.
+
+Branch : STORKCommons_0_6
+Date : 07-11-2011
+Changes: Improved error exception handling (few changes on the exception classes).
+ Improved Constansts (unused removed, others added).
+ Unit Tests include (almost all the code is cover).
+ Fix some minor bugs found on unit tests.
+ New Copyright License added.
+ PEPUtils refactored.
+ Improved error code message (three kind of messages: to citizen, admin and saml token).
+
+Branch : STORKCommons_0_6_1
+Date : 28-11-2011
+Changes: Removed unnecessary javadoc package file.
+ Updated pepsUtils.properties file (check attribute value had old error message)
+
+Branch : STORKCommons_0_9
+Date : 02-12-2011
+Changes: Updated Version to 0.9
+
+Branch : STORKCommons_1_0
+Date : 02-12-2011
+Changes: Updated Version to 1.0
+
+Branch : STORKCommons_1_1_0
+Date : 01-11-2013
+Changes: Updated Version to 1.1.0
+ Dependencies updated
+ Business Logic Part I changes
+ SAML Engine Changes merged (from SamlEngine/1.1.0/Commons branch to be easier to merge this branch with trunk)
+ Fixed some errors on Test Case
+
+Branch : STORKCommons_1_1_1
+Date : 02-12-2013
+Changes: Updated Version to 1.1.1
+ Added mandate error code
+ PMD quality code changes (some final identifier missing)
+ Added new methods to personal attribute list to get Mandatory/Optional and/or Simple/Complex attributes
+ Added new unit tests
+
+Branch : Commons (Trunk)
+Date : 15-01-2014
+Version: 1.2.0
+Release: 2
+Changes: Updated Version to 1.2.0
+ dded request flow of PV (incomplete)
+ Added AP mandatory attribute to get data for business attributes
+ *) based on configuration file it adds the missing attributes (eIdentifier, givenName, surname and dateOfBirth) or change isRequired to true.
+ changes original isRequired state in response
+ Added new Interface (IAttributeListProcessor) to make some operations on attribute lists
+ Power Validation is complete now
+ Business Logic I and II integration (Request Complete!)
+ Added new method to Personal attribute List to check if there is at least one attribute with no value.
diff --git a/id/server/legacy-backup/stork2-commons/pom.xml b/id/server/legacy-backup/stork2-commons/pom.xml
new file mode 100644
index 000000000..a71ee1628
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/pom.xml
@@ -0,0 +1,213 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eu.stork</groupId>
+ <artifactId>Commons</artifactId>
+ <packaging>jar</packaging>
+ <name>Stork Commons</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <stork.version>1.2.0</stork.version>
+ <opensaml.version>2.6.0</opensaml.version>
+ </properties>
+ <version>${stork.version}</version>
+ <description>
+ The STORKCommons library provides beans, Java Interfaces and utility classes to integrate PEPS and SAML Engine.
+ </description>
+
+ <dependencies>
+
+ <!-- Joda -->
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.3</version>
+ </dependency>
+
+ <!-- Log4J -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jdmk</groupId>
+ <artifactId>jmxtools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>mail</artifactId>
+ <groupId>javax.mail</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>${opensaml.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Bouncy Castle -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ <version>1.46</version>
+ </dependency>
+
+ <!-- Servlet API -->
+ <!-- provided by Application Server -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>commons</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <runOrder>reversealphabetical</runOrder>
+ <skip>false</skip>
+ <includes>
+ <runOrder>reversealphabetical</runOrder>
+ <include>**/PEPSUtilTest.java</include>
+ <include>**/PersonalAttributeTestCase.java</include>
+ <include>**/PersonalAttributeListTestCase.java</include>
+ <include>**/DateUtilTestCase.java</include>
+ <include>**/AttributeUtilTest.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <configuration>
+ <links>
+ <link>http://commons.apache.org/lang/api/</link>
+ <link>http://java.sun.com/j2se/1.6.0/docs/api/</link>
+ <link>http://www.bouncycastle.org/docs/docs1.6/</link>
+ <link>http://docs.oracle.com/javase/6/docs/api/</link>
+ </links>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>log4j.xml</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+ <profiles>
+ <profile>
+ <id>embedded</id>
+ <build>
+ <resources>
+ <resource>
+ <directory> ${project.basedir}/src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory> ${project.basedir}/src/main/config/embedded</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ <profile>
+ <id>metrics</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/id/server/legacy-backup/stork2-commons/src/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/.svn/all-wcprops
new file mode 100644
index 000000000..1be1e9546
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/.svn/entries b/id/server/legacy-backup/stork2-commons/src/.svn/entries
new file mode 100644
index 000000000..b55ef35ad
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+main
+dir
+
+test
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/.svn/all-wcprops
new file mode 100644
index 000000000..2d001ac89
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/.svn/entries
new file mode 100644
index 000000000..ca600a0d3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/.svn/entries
@@ -0,0 +1,37 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+java
+dir
+
+config
+dir
+
+resources
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/config/.svn/all-wcprops
new file mode 100644
index 000000000..73665ee91
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/config
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/config/.svn/entries
new file mode 100644
index 000000000..74e41e9ee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/config
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+embedded
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/all-wcprops
new file mode 100644
index 000000000..e1cf2515e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/config/embedded
+END
+pepsUtil.properties
+K 25
+svn:wc:ra_dav:version-url
+V 90
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/config/embedded/pepsUtil.properties
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/entries
new file mode 100644
index 000000000..b574aab75
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/config/embedded
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+pepsUtil.properties
+file
+
+
+
+
+2014-01-21T08:38:55.392702Z
+b61bbaa8e966441dba56ad954124ee38
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7822
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base
new file mode 100644
index 000000000..1e92f390d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base
@@ -0,0 +1,267 @@
+#Max allowed params size
+validation.active=true
+max.spUrl.size=150
+max.attrList.size=20000
+max.invalidAttributeList.size=20000
+max.attrName.size=100
+max.callback.size=300
+max.idp.url.size=300
+max.atp.url.size=300
+max.cpepsURL.size=300
+max.attrValue.size=20000
+max.attrType.size=25
+max.spId.size=40
+max.providerName.size=128
+max.spName.size=25
+max.country.size=150
+max.qaaLevel.size=1
+max.spQaaLevel.size=1
+max.errorCode.size=5
+max.errorMessage.size=300
+max.username.size=30
+max.spepsRedirectUrl.size=300
+max.speps.redirectUrl.size=300
+max.cpeps.redirectUrl.size=300
+max.cpepsRedirectUrl.size=300
+max.spepsAssertionUrl.size=300
+max.SAMLRequest.size=131072
+max.SAMLResponse.size=131072
+max.RelayState.size=80
+max.remoteAddr.size=300
+max.remoteHost.size=300
+max.localAddr.size=300
+max.localName.size=300
+max.apepsUrl.size=300
+max.apeps.callbackUrl.size=300
+
+#ERROR codes/messages (accordingly to specification)
+
+#CountrySelector Interface errors
+spCountrySelector.invalidSPQAA.code=0000001
+spCountrySelector.invalidSPQAA.message=invalid.spQAA.parameter
+
+spCountrySelector.invalidQaaSPid.code=0000001
+spCountrySelector.invalidQaaSPid.message=invalid.spQAAId.parameter
+
+spCountrySelector.invalidSpId.code=000002
+spCountrySelector.invalidSpId.message=invalid.spId.parameter
+
+spCountrySelector.invalidSpURL.code=000003
+spCountrySelector.invalidSpURL.message=invalid.spUrl.parameter
+
+domain.CountrySelectorAction.code=000003
+domain.CountrySelectorAction.message=invalid.cs.domain
+
+requests.CountrySelectorAction.code=000004
+requests.CountrySelectorAction.message=reached.max.requests.cs
+
+spCountrySelector.spNotAllowed.code=000006
+spCountrySelector.spNotAllowed.message=attr.access.deny
+
+spCountrySelector.invalidAttr.code=000007
+spCountrySelector.invalidAttr.message=invalid.spAttr.parameter
+
+spCountrySelector.invalidProviderName.code=000008
+spCountrySelector.invalidProviderName.message=invalid.spProvidername.parameter
+
+spCountrySelector.errorCreatingSAML.code=203001
+spCountrySelector.errorCreatingSAML.message=error.create.sp.saml
+
+spepsSAMLRequest.code=203001
+spepsSAMLRequest.message=error.create.saml.speps
+
+#ServiceProvider Interface errors
+sProviderAction.invalidSPQAA.code=200001
+sProviderAction.invalidSPQAA.message=invalid.sp.qaa
+
+sProviderAction.invalidSPQAAId.code=200001
+sProviderAction.invalidSPQAAId.message=invalid.sp.qaaid
+
+sProviderAction.invalidSPId.code=200002
+sProviderAction.invalidSPId.message=invalid.sp.id
+
+domain.ServiceProviderAction.code=200003
+domain.ServiceProviderAction.message=invalid.sp.domain
+
+sProviderAction.invalidSPDomain.code=200003
+sProviderAction.invalidSPDomain.message=invalid.sp.domain
+
+sProviderAction.invalidCountry.code=200004
+sProviderAction.invalidCountry.message=invalid.sp.country
+
+sProviderAction.spNotAllowed.code=200005
+sProviderAction.spNotAllowed.message=sp.not.allowed
+
+sProviderAction.invalidSaml.code=200006
+sProviderAction.invalidSaml.message=invalid.sp.samlrequest
+
+sProviderAction.invalidSPProviderName.code=200007
+sProviderAction.invalidSPProviderName.message=sp.not.identified
+
+sProviderAction.invalidSPRedirect.code=200008
+sProviderAction.invalidSPRedirect.message=invalid.sp.redirectUrl
+
+sProviderAction.invalidRelayState.code=200009
+sProviderAction.invalidRelayState.message=invalid.sp.relaystate
+
+sProviderAction.invalidAttr.code=200011
+sProviderAction.invalidAttr.message=invalid.sp.attr
+
+requests.ServiceProviderAction.code=200012
+requests.ServiceProviderAction.message=reached.max.requests.sp
+
+sPPowerValidationAction.invalidSPPVAttrList.code=200013
+sPPowerValidationAction.invalidSPPVAttrList.message=invalid.sp.pv.attrlist
+
+invalid.sp.pv.attrlist.code=200013
+invalid.sp.pv.attrlist.message=invalid.sp.pv.attrlist
+
+sProviderAction.invalidSPAlias.code=203003
+sProviderAction.invalidSPAlias.message=invalid.sp.alias
+
+sProviderAction.errorCreatingSAML.code=203001
+sProviderAction.errorCreatingSAML.message=error.create.saml.speps
+
+#Internal Error
+internalError.code=203001
+internalError.message=internalError
+
+attrList.code=202005
+attrList.message=invalid.attrList.parameter
+
+missing.sessionId.code=203010
+missing.sessionId.message=missing.session.id
+
+sessionError.code=203011
+sessionError.message=invalid.session.id
+
+invalid.sessionId.code=203011
+invalid.sessionId.message=invalid.session.id
+
+missing.mandate.code=203013
+missing.mandate.message=missing.mandate
+
+invalid.session.code=203012
+invalid.session.message=invalid.session
+
+callback.code=203006
+callback.message=invalid.callback.url
+
+idp.url.code=203006
+idp.url.message=invalid.idp.url
+
+IdPSAMLResponse.code=002001
+IdPSAMLResponse.message=invalid.idp.response
+
+authenticationFailed.code=003002
+authenticationFailed.message=authentication.failed
+
+username.code=003002
+username.message=authentication.failed
+
+invalidAttributeList.code=203001
+invalidAttributeList.message=invalid.attrlist
+
+invalidAttributeValue.code=203001
+invalidAttributeValue.message=invalid.attr.value
+
+attVerification.mandatory.code=202010
+attVerification.mandatory.message=missing.mandatory.attr
+
+attrValue.verification.code=203008
+attrValue.verification.message=invalid.stork.attrValue
+
+cpepsSAMLResponse.code=202012
+cpepsSAMLResponse.message=error.gen.cpeps.saml
+
+AtPSAMLResponse.code=202009
+AtPSAMLResponse.message=error.gen.atp.saml
+
+atp.url.code=203006
+atp.url.message=invalid.atp.url
+
+hash.error.code=203001
+hash.error.message=error.hash
+
+qaaLevel.code=203006
+qaaLevel.message=invalid.cpeps.qaalevel
+
+SAMLRequest.code=203001
+SAMLRequest.message=invalid.SAMLRequest
+
+atp.response.error.code=202011
+atp.response.error.message=atp.response.error
+
+#Colleague Request Interface errors
+
+colleagueRequest.invalidSAML.code=201002
+colleagueRequest.invalidSAML.message=invalid.speps.samlrequest
+
+colleagueRequest.invalidCountryCode.code=002001
+colleagueRequest.invalidCountryCode.message=country.cpeps.nomatch
+
+colleagueRequest.errorCreatingSAML.code=203001
+colleagueRequest.errorCreatingSAML.message=error.create.saml.cpeps
+
+colleagueRequest.invalidQaa.code=202004
+colleagueRequest.invalidQaa.message=invalid.requested.cpeps.qaalevel
+
+colleagueRequest.attrNull.code=202005
+colleagueRequest.attrNull.message=invalid.requested.attrlist.cpeps
+
+colleaguePVRequest.invalidPVAttrList.code=202013
+colleaguePVRequest.invalidPVAttrList.message=invalid.speps.pv.attrlist
+
+colleagueRequest.invalidRedirect.code=202001
+colleagueRequest.invalidRedirect.message=invalid.redirecturl.cpeps
+
+colleagueRequest.invalidDestUrl.code=203006
+colleagueRequest.invalidDestUrl.message=invalid.cpeps.destUrl
+
+cpepsRedirectUrl.code=203006
+cpepsRedirectUrl.message=invalid.cpeps.redirectUrl
+
+#Citizen Consent Interfaces errors
+
+citizenResponse.mandatory.code=202007
+citizenResponse.mandatory.message=no.consent.mand.attr
+
+cPeps.attrNull.code=202005
+cPeps.attrNull.message=invalid.attrList.cpeps
+
+citizenNoConsent.mandatory.code=202012
+citizenNoConsent.mandatory.message=no.consent.val.mand.attr
+
+#Colleague Response Interface errors
+
+colleagueResponse.invalidSAML.code=202002
+colleagueResponse.invalidSAML.message=invalid.cpeps.samlresp
+
+auRequestIdError.code=201005
+auRequestIdError.message=invalid.speps.saml.id
+
+audienceRestrictionError.code=201004
+audienceRestrictionError.message=speps.saml.condition.notmet
+
+spepsSAMLResponse.code=200010
+spepsSAMLResponse.message=error.gen.speps.saml
+
+
+invalid.apepsRedirectUrl.code=001001
+invalid.apepsRedirectUrl.message=invalid.apeps.redirectUrl
+
+apepsSAMLRequest.code=001002
+apepsSAMLRequest.message=invalid.apeps.saml.request
+
+apepsSAMLResponse.code=001003
+apepsSAMLResponse.message=invalid.apeps.saml.response
+
+invalid.apepsCallbackUrl.code=001004
+invalid.apepsCallbackUrl.message=invalid.apeps.callback.url
+
+colleagueAttributeRequest.invalidSAML.code=001005
+colleagueAttributeRequest.invalidSAML.message=invalid.attr.request.saml
+
+
+#Hash Digests
+hashDigest.className=org.bouncycastle.crypto.digests.SHA512Digest
diff --git a/id/server/legacy-backup/stork2-commons/src/main/config/embedded/pepsUtil.properties b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/pepsUtil.properties
new file mode 100644
index 000000000..1e92f390d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/config/embedded/pepsUtil.properties
@@ -0,0 +1,267 @@
+#Max allowed params size
+validation.active=true
+max.spUrl.size=150
+max.attrList.size=20000
+max.invalidAttributeList.size=20000
+max.attrName.size=100
+max.callback.size=300
+max.idp.url.size=300
+max.atp.url.size=300
+max.cpepsURL.size=300
+max.attrValue.size=20000
+max.attrType.size=25
+max.spId.size=40
+max.providerName.size=128
+max.spName.size=25
+max.country.size=150
+max.qaaLevel.size=1
+max.spQaaLevel.size=1
+max.errorCode.size=5
+max.errorMessage.size=300
+max.username.size=30
+max.spepsRedirectUrl.size=300
+max.speps.redirectUrl.size=300
+max.cpeps.redirectUrl.size=300
+max.cpepsRedirectUrl.size=300
+max.spepsAssertionUrl.size=300
+max.SAMLRequest.size=131072
+max.SAMLResponse.size=131072
+max.RelayState.size=80
+max.remoteAddr.size=300
+max.remoteHost.size=300
+max.localAddr.size=300
+max.localName.size=300
+max.apepsUrl.size=300
+max.apeps.callbackUrl.size=300
+
+#ERROR codes/messages (accordingly to specification)
+
+#CountrySelector Interface errors
+spCountrySelector.invalidSPQAA.code=0000001
+spCountrySelector.invalidSPQAA.message=invalid.spQAA.parameter
+
+spCountrySelector.invalidQaaSPid.code=0000001
+spCountrySelector.invalidQaaSPid.message=invalid.spQAAId.parameter
+
+spCountrySelector.invalidSpId.code=000002
+spCountrySelector.invalidSpId.message=invalid.spId.parameter
+
+spCountrySelector.invalidSpURL.code=000003
+spCountrySelector.invalidSpURL.message=invalid.spUrl.parameter
+
+domain.CountrySelectorAction.code=000003
+domain.CountrySelectorAction.message=invalid.cs.domain
+
+requests.CountrySelectorAction.code=000004
+requests.CountrySelectorAction.message=reached.max.requests.cs
+
+spCountrySelector.spNotAllowed.code=000006
+spCountrySelector.spNotAllowed.message=attr.access.deny
+
+spCountrySelector.invalidAttr.code=000007
+spCountrySelector.invalidAttr.message=invalid.spAttr.parameter
+
+spCountrySelector.invalidProviderName.code=000008
+spCountrySelector.invalidProviderName.message=invalid.spProvidername.parameter
+
+spCountrySelector.errorCreatingSAML.code=203001
+spCountrySelector.errorCreatingSAML.message=error.create.sp.saml
+
+spepsSAMLRequest.code=203001
+spepsSAMLRequest.message=error.create.saml.speps
+
+#ServiceProvider Interface errors
+sProviderAction.invalidSPQAA.code=200001
+sProviderAction.invalidSPQAA.message=invalid.sp.qaa
+
+sProviderAction.invalidSPQAAId.code=200001
+sProviderAction.invalidSPQAAId.message=invalid.sp.qaaid
+
+sProviderAction.invalidSPId.code=200002
+sProviderAction.invalidSPId.message=invalid.sp.id
+
+domain.ServiceProviderAction.code=200003
+domain.ServiceProviderAction.message=invalid.sp.domain
+
+sProviderAction.invalidSPDomain.code=200003
+sProviderAction.invalidSPDomain.message=invalid.sp.domain
+
+sProviderAction.invalidCountry.code=200004
+sProviderAction.invalidCountry.message=invalid.sp.country
+
+sProviderAction.spNotAllowed.code=200005
+sProviderAction.spNotAllowed.message=sp.not.allowed
+
+sProviderAction.invalidSaml.code=200006
+sProviderAction.invalidSaml.message=invalid.sp.samlrequest
+
+sProviderAction.invalidSPProviderName.code=200007
+sProviderAction.invalidSPProviderName.message=sp.not.identified
+
+sProviderAction.invalidSPRedirect.code=200008
+sProviderAction.invalidSPRedirect.message=invalid.sp.redirectUrl
+
+sProviderAction.invalidRelayState.code=200009
+sProviderAction.invalidRelayState.message=invalid.sp.relaystate
+
+sProviderAction.invalidAttr.code=200011
+sProviderAction.invalidAttr.message=invalid.sp.attr
+
+requests.ServiceProviderAction.code=200012
+requests.ServiceProviderAction.message=reached.max.requests.sp
+
+sPPowerValidationAction.invalidSPPVAttrList.code=200013
+sPPowerValidationAction.invalidSPPVAttrList.message=invalid.sp.pv.attrlist
+
+invalid.sp.pv.attrlist.code=200013
+invalid.sp.pv.attrlist.message=invalid.sp.pv.attrlist
+
+sProviderAction.invalidSPAlias.code=203003
+sProviderAction.invalidSPAlias.message=invalid.sp.alias
+
+sProviderAction.errorCreatingSAML.code=203001
+sProviderAction.errorCreatingSAML.message=error.create.saml.speps
+
+#Internal Error
+internalError.code=203001
+internalError.message=internalError
+
+attrList.code=202005
+attrList.message=invalid.attrList.parameter
+
+missing.sessionId.code=203010
+missing.sessionId.message=missing.session.id
+
+sessionError.code=203011
+sessionError.message=invalid.session.id
+
+invalid.sessionId.code=203011
+invalid.sessionId.message=invalid.session.id
+
+missing.mandate.code=203013
+missing.mandate.message=missing.mandate
+
+invalid.session.code=203012
+invalid.session.message=invalid.session
+
+callback.code=203006
+callback.message=invalid.callback.url
+
+idp.url.code=203006
+idp.url.message=invalid.idp.url
+
+IdPSAMLResponse.code=002001
+IdPSAMLResponse.message=invalid.idp.response
+
+authenticationFailed.code=003002
+authenticationFailed.message=authentication.failed
+
+username.code=003002
+username.message=authentication.failed
+
+invalidAttributeList.code=203001
+invalidAttributeList.message=invalid.attrlist
+
+invalidAttributeValue.code=203001
+invalidAttributeValue.message=invalid.attr.value
+
+attVerification.mandatory.code=202010
+attVerification.mandatory.message=missing.mandatory.attr
+
+attrValue.verification.code=203008
+attrValue.verification.message=invalid.stork.attrValue
+
+cpepsSAMLResponse.code=202012
+cpepsSAMLResponse.message=error.gen.cpeps.saml
+
+AtPSAMLResponse.code=202009
+AtPSAMLResponse.message=error.gen.atp.saml
+
+atp.url.code=203006
+atp.url.message=invalid.atp.url
+
+hash.error.code=203001
+hash.error.message=error.hash
+
+qaaLevel.code=203006
+qaaLevel.message=invalid.cpeps.qaalevel
+
+SAMLRequest.code=203001
+SAMLRequest.message=invalid.SAMLRequest
+
+atp.response.error.code=202011
+atp.response.error.message=atp.response.error
+
+#Colleague Request Interface errors
+
+colleagueRequest.invalidSAML.code=201002
+colleagueRequest.invalidSAML.message=invalid.speps.samlrequest
+
+colleagueRequest.invalidCountryCode.code=002001
+colleagueRequest.invalidCountryCode.message=country.cpeps.nomatch
+
+colleagueRequest.errorCreatingSAML.code=203001
+colleagueRequest.errorCreatingSAML.message=error.create.saml.cpeps
+
+colleagueRequest.invalidQaa.code=202004
+colleagueRequest.invalidQaa.message=invalid.requested.cpeps.qaalevel
+
+colleagueRequest.attrNull.code=202005
+colleagueRequest.attrNull.message=invalid.requested.attrlist.cpeps
+
+colleaguePVRequest.invalidPVAttrList.code=202013
+colleaguePVRequest.invalidPVAttrList.message=invalid.speps.pv.attrlist
+
+colleagueRequest.invalidRedirect.code=202001
+colleagueRequest.invalidRedirect.message=invalid.redirecturl.cpeps
+
+colleagueRequest.invalidDestUrl.code=203006
+colleagueRequest.invalidDestUrl.message=invalid.cpeps.destUrl
+
+cpepsRedirectUrl.code=203006
+cpepsRedirectUrl.message=invalid.cpeps.redirectUrl
+
+#Citizen Consent Interfaces errors
+
+citizenResponse.mandatory.code=202007
+citizenResponse.mandatory.message=no.consent.mand.attr
+
+cPeps.attrNull.code=202005
+cPeps.attrNull.message=invalid.attrList.cpeps
+
+citizenNoConsent.mandatory.code=202012
+citizenNoConsent.mandatory.message=no.consent.val.mand.attr
+
+#Colleague Response Interface errors
+
+colleagueResponse.invalidSAML.code=202002
+colleagueResponse.invalidSAML.message=invalid.cpeps.samlresp
+
+auRequestIdError.code=201005
+auRequestIdError.message=invalid.speps.saml.id
+
+audienceRestrictionError.code=201004
+audienceRestrictionError.message=speps.saml.condition.notmet
+
+spepsSAMLResponse.code=200010
+spepsSAMLResponse.message=error.gen.speps.saml
+
+
+invalid.apepsRedirectUrl.code=001001
+invalid.apepsRedirectUrl.message=invalid.apeps.redirectUrl
+
+apepsSAMLRequest.code=001002
+apepsSAMLRequest.message=invalid.apeps.saml.request
+
+apepsSAMLResponse.code=001003
+apepsSAMLResponse.message=invalid.apeps.saml.response
+
+invalid.apepsCallbackUrl.code=001004
+invalid.apepsCallbackUrl.message=invalid.apeps.callback.url
+
+colleagueAttributeRequest.invalidSAML.code=001005
+colleagueAttributeRequest.invalidSAML.message=invalid.attr.request.saml
+
+
+#Hash Digests
+hashDigest.className=org.bouncycastle.crypto.digests.SHA512Digest
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/.svn/all-wcprops
new file mode 100644
index 000000000..a1df0322e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/.svn/entries
new file mode 100644
index 000000000..9ee5924fb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+eu
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/all-wcprops
new file mode 100644
index 000000000..8ee25102a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/entries
new file mode 100644
index 000000000..df52d249b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+stork
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops
new file mode 100644
index 000000000..5a83dbd10
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/entries
new file mode 100644
index 000000000..7af1f8357
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+peps
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops
new file mode 100644
index 000000000..fd64eea7b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/entries
new file mode 100644
index 000000000..39e7255f2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+auth
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops
new file mode 100644
index 000000000..3bab81b06
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 78
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries
new file mode 100644
index 000000000..30659cbb6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+specific
+dir
+
+commons
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops
new file mode 100644
index 000000000..3c42375b6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops
@@ -0,0 +1,191 @@
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons
+END
+AttributeSource.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
+END
+PEPSValues.java
+K 25
+svn:wc:ra_dav:version-url
+V 102
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
+END
+STORKAttrQueryRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
+END
+CitizenConsent.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
+END
+AttributeProvidersMap.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
+END
+STORKAttrQueryResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
+END
+PersonalAttributeList.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
+END
+AttributeName.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
+END
+PEPSUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
+END
+PersonalAttribute.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
+END
+IAttributeListProcessor.java
+K 25
+svn:wc:ra_dav:version-url
+V 115
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
+END
+STORKLogoutResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
+END
+IStorkLogger.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
+END
+DateUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 99
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
+END
+STORKAuthnRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/56/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
+END
+AttributeProvider.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
+END
+IStorkSession.java
+K 25
+svn:wc:ra_dav:version-url
+V 104
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
+END
+Linker.java
+K 25
+svn:wc:ra_dav:version-url
+V 98
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
+END
+PEPSParameters.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
+END
+AttributeConstants.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
+END
+AttributeUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
+END
+STORKStatusCode.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
+END
+Country.java
+K 25
+svn:wc:ra_dav:version-url
+V 98
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/Country.java
+END
+PEPSErrors.java
+K 25
+svn:wc:ra_dav:version-url
+V 102
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
+END
+STORKLogoutRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
+END
+IAttributeProvidersMap.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/31/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
+END
+STORKSubStatusCode.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
+END
+IPersonalAttributeList.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
+END
+STORKAuthnResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
+END
+CountryCodes.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries
new file mode 100644
index 000000000..b18b22565
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries
@@ -0,0 +1,1085 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/commons
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+PersonalAttributeList.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+0036d26679cc31fe7d1bdea1b8b3555a
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12041
+
+AttributeName.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+164e63d1f4e5aeb47d371caff534eaab
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1504
+
+PEPSErrors.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+bfe69afce772675187fdd637453ed12f
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12165
+
+STORKLogoutRequest.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+af445a2013f21ffecd3db7773ae3236e
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4343
+
+PersonalAttribute.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+ce98ef39a754869644b5516cdcfcb40d
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8914
+
+IAttributeListProcessor.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+07efc5b742cc9e4b80a2f8b17fe4b946
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4713
+
+IAttributeProvidersMap.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+225257e8d6d7b9e6bcc4bea2463c33be
+2013-10-10T17:38:31.956327Z
+31
+emlelisst
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2534
+
+STORKLogoutResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+880a05076cf8412311766aa40cf6a63f
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5474
+
+STORKSubStatusCode.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+65e615e0119d4125d5f4f58af8bcd18b
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2181
+
+STORKAuthnRequest.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+3f36e65f0c4f1c7df753784b2e64f00b
+2013-10-24T15:44:04.704923Z
+56
+emgrtargr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11269
+
+IPersonalAttributeList.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+b441a2c6c3eddcf1043c55e55f48faa6
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6598
+
+AttributeProvider.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+39c770ebd2082723b9eeb68bf17ee698
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1687
+
+IStorkSession.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+5a8701b1fd27998d5cf3280a5c99bcb0
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2745
+
+CountryCodes.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+f91b0f8df0b2a68fe1b900d425257c23
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3527
+
+STORKAuthnResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+f2247f9a89e8ad01f9a24ad716f993ca
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8724
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+8d8068e217f10425f76a8d37192ccd80
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+277
+
+PEPSValues.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+ee08f149082a8e4888fb25ca70ae931f
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7592
+
+CitizenConsent.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+39e236d6888f266d9b4967f19726126c
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3445
+
+STORKStatusCode.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+771689c75a8263c7e3966e820d59025e
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1906
+
+AttributeUtil.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+2859d3335dfe719ca04258fae54e69a3
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7927
+
+exceptions
+dir
+
+STORKAttrQueryResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+93fc508be2bc0fd29ae453b0868e1d2b
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9080
+
+Country.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+9cbde5f25b646d02dae7ccf424906b4a
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2208
+
+PEPSUtil.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+1fef4b668542bb572c856053b61aa6af
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11505
+
+DateUtil.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+59f9cd2a3d1169a0f1a797b28719921a
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5702
+
+IStorkLogger.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+f15979b29f52d1674103528aed914ae7
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4766
+
+AttributeSource.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+a0555599193656bc17e02c3ce23043be
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4501
+
+Linker.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+98f46baee16310e3dc59ef224ba5b5ab
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8950
+
+PEPSParameters.java
+file
+
+
+
+
+2014-01-21T08:38:55.332702Z
+95e7dfcbff9c4ca76c2f4aea047f0bfd
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+15289
+
+STORKAttrQueryRequest.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+2d4ac505f71020c482ebbefa10484552
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10617
+
+AttributeProvidersMap.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+b487da35df5353c8b2aba47ab3cdb68d
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2608
+
+AttributeConstants.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+940dcb9e93ede62e221f4b25abd6576b
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1831
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base
new file mode 100644
index 000000000..09769641c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base
@@ -0,0 +1,72 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum AttributeConstants {
+
+ /**
+ * Represents the attribute's name index.
+ */
+ ATTR_NAME_INDEX(0),
+ /**
+ * Represents the attribute's type index.
+ */
+ ATTR_TYPE_INDEX(1),
+ /**
+ * Represents the attribute's value index.
+ */
+ ATTR_VALUE_INDEX(2),
+ /**
+ * Represents the attribute's status index.
+ */
+ ATTR_STATUS_INDEX(3),
+ /**
+ * Represents the number of allowed tuples.
+ */
+ NUMBER_TUPLES(4);
+
+ /**
+ * Represents the constant's value.
+ */
+ private int attribute;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param attr The Attribute Constant value.
+ */
+ AttributeConstants(final int attr) {
+
+ this.attribute = attr;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public int intValue() {
+
+ return attribute;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base
new file mode 100644
index 000000000..32352f563
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base
@@ -0,0 +1,74 @@
+package eu.stork.peps.auth.commons;
+
+/**
+ * This class is a bean used to store information relative to Attribute Names.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-11-26 $
+ */
+public final class AttributeName {
+
+ /**
+ * Attribute Id.
+ */
+ private String attributeId;
+
+ /**
+ * Attribute Name.
+ */
+ private String attributeName;
+
+ /**
+ * Attribute Name Constructor.
+ *
+ * @param aId Id of the Attribute Name.
+ * @param aName Name of the Attribute Name.
+ */
+ public AttributeName(final String aId, final String aName) {
+
+ this.attributeId = aId;
+ this.attributeName = aName;
+ }
+
+ /**
+ * Getter for the attributeId value.
+ *
+ * @return The attributeId value.
+ */
+ public String getAttributeId() {
+
+ return attributeId;
+ }
+
+ /**
+ * Setter for the attributeId value.
+ *
+ * @param aId Id of the Attribute Name.
+ */
+ public void setAttributeId(final String aId) {
+
+ this.attributeId = aId;
+ }
+
+ /**
+ * Getter for the attributeName value.
+ *
+ * @return The attributeName value.
+ */
+ public String getAttributeName() {
+
+ return attributeName;
+ }
+
+ /**
+ * Setter for the attributeName value.
+ *
+ * @param name Name of the Attribute Name.
+ */
+ public void setAttributeName(final String name) {
+
+ this.attributeName = name;
+ }
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base
new file mode 100644
index 000000000..5fb04e331
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base
@@ -0,0 +1,80 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Provider.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-11-28 $
+ */
+public final class AttributeProvider implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7210186241917444559L;
+
+ /**
+ * Provider Id.
+ */
+ private String providerId;
+
+ /**
+ * Provider Name.
+ */
+ private String providerName;
+
+ /**
+ * Attribute Provider Constructor.
+ *
+ * @param pId Id of the Attribute Provider.
+ * @param pName Name of the Attribute Provider.
+ */
+ public AttributeProvider(final String pId, final String pName) {
+
+ this.providerId = pId;
+ this.providerName = pName;
+ }
+
+ /**
+ * Getter for the providerId value.
+ *
+ * @return The providerId value.
+ */
+ public String getProviderId() {
+
+ return providerId;
+ }
+
+ /**
+ * Setter for the providerId value.
+ *
+ * @param pId Id of the Attribute Provider.
+ */
+ public void setProviderId(final String pId) {
+
+ this.providerId = pId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The providerName value.
+ */
+ public String getProviderName() {
+
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param name Name of the Attribute Provider.
+ */
+ public void setProviderName(final String name) {
+
+ this.providerName = name;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base
new file mode 100644
index 000000000..3059caaa3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base
@@ -0,0 +1,96 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of the AttributeProviderMap using a LinkedHashMap.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-09-20 $
+ *
+ * @see LinkedHashMap
+ */
+public class AttributeProvidersMap extends LinkedHashMap<AttributeSource, IPersonalAttributeList>
+ implements IAttributeProvidersMap {
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeProvidersMap.class.getName());
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8949081185106296122L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList get(final AttributeSource key) {
+ return this.get((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList remove(final AttributeSource key) {
+ return this.remove((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean containsKey(final AttributeSource key) {
+ return this.containsKey((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<AttributeSource> keyIterator() {
+ return this.keySet().iterator();
+ }
+
+ public void trace() {
+ Iterator<AttributeSource> iterator;
+ Iterator<PersonalAttribute> iterator2;
+ AttributeSource source;
+ IPersonalAttributeList pal;
+ PersonalAttribute pa;
+
+ iterator = this.keyIterator();
+ LOG.trace("Start dumping of AttributeProvidersMap\n=======================");
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ LOG.trace("Source details: type [" + source.getSourceType() + "], URL [" + source.getProviderURL() + "]");
+
+ if(source.getSourceType() == AttributeSource.SOURCE_LOCAL_APROVIDER) {
+ LOG.trace("-> Attribute Provider: ID [" + source.getProvider().getProviderId() + "], name [" + source.getProvider().getProviderName() + "]");
+ }
+ else {
+ LOG.trace("-> Country: ID [" + source.getCountry().getCountryId() + "], name [" + source.getCountry().getCountryName() + "]");
+ }
+
+ pal = this.get(source);
+ LOG.trace("++++++++=>");
+ iterator2 = pal.iterator();
+ while (iterator2.hasNext()) {
+ pa = iterator2.next();
+
+ LOG.trace("-> Citizen Attribute: name [" + pa.getName() + "], required [" + pa.isRequired() + "]");
+ }
+ LOG.trace("<=++++++++");
+
+ LOG.trace("-----------------------");
+ }
+ LOG.trace("END\n=======================");
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base
new file mode 100644
index 000000000..e1ae0049d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base
@@ -0,0 +1,188 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Source (either AttributeProvider or Country).
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.10 $, $Date: 2013-11-29 $
+ */
+public final class AttributeSource implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 432243595968469014L;
+
+ public static final int SOURCE_LOCAL_APROVIDER = 1;
+ public static final int SOURCE_REMOTE_COUNTRY = 2;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeSource.class.getName());
+
+ /**
+ * Provider source.
+ */
+ private int sourceType;
+
+ /**
+ * Provider URL.
+ */
+ private String providerURL;
+
+ /**
+ * The local Attribute Provider.
+ */
+ private AttributeProvider provider;
+
+ /**
+ * The remote Country.
+ */
+ private Country country;
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param provider The local Attribute Provider.
+ * @param pURL URL of the Attribute Provider.
+ */
+ public AttributeSource(final AttributeProvider provider, final String pURL) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.setProvider(provider);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param country The remote Country.
+ * @param pURL URL of the Country.
+ */
+ public AttributeSource(final Country country, final String pURL) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.setCountry(country);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * @param sourceType the sourceType to set
+ */
+ public void setSourceType(final int sourceType) {
+ this.sourceType = sourceType;
+ }
+
+ /**
+ * @return the sourceType
+ */
+ public int getSourceType() {
+ return sourceType;
+ }
+
+ /**
+ * @param providerURL the providerURL to set
+ */
+ public void setProviderURL(final String providerURL) {
+ this.providerURL = providerURL;
+ }
+
+ /**
+ * @return the providerURL
+ */
+ public String getProviderURL() {
+ return providerURL;
+ }
+
+ /**
+ * @param provider the provider to set
+ */
+ public void setProvider(final AttributeProvider provider) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.provider = provider;
+ }
+
+ /**
+ * @return the provider
+ */
+ public AttributeProvider getProvider() {
+ return provider;
+ }
+
+ /**
+ * @param country the country to set
+ */
+ public void setCountry(final Country country) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.country = country;
+ }
+
+ /**
+ * @return the country
+ */
+ public Country getCountry() {
+ return country;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+ boolean outcome = false;
+
+ LOG.debug("Calling equals with Object.");
+ if ( obj instanceof AttributeSource ) {
+ LOG.debug("Calling equals with AttributeSource.");
+ outcome = this.equals((AttributeSource)obj);
+ }
+
+ LOG.debug("Object equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * Compare the given AttributeSource with the current object in order to determinine
+ * if they are equal.
+ *
+ * @param obj The AttributeSource to compare to
+ *
+ * @return true if the two objects are equal
+ */
+ public boolean equals(AttributeSource obj) {
+ boolean outcome = false;
+
+ if ( this.sourceType==obj.getSourceType() ) {
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( this.provider.getProviderId().equals(obj.getProvider().getProviderId()) )
+ outcome = true;
+ }
+ else if ( this.sourceType==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( this.country.getCountryId().equals(obj.getCountry().getCountryId()) )
+ outcome = true;
+ }
+ }
+
+ LOG.debug("AttributeSource equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hash = 1;
+ hash = hash * 17 + this.sourceType;
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER )
+ hash = hash * 31 + this.provider.getProviderName().hashCode();
+ else
+ hash = hash * 31 + this.country.getCountryName().hashCode();
+ return hash;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base
new file mode 100644
index 000000000..af7ab6cf3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base
@@ -0,0 +1,231 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-12-15 23:19:59 $
+ */
+public final class AttributeUtil {
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private AttributeUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Safe escape any given string.
+ *
+ * @param value The HTTP Value to escaped.
+ *
+ * @return The value escaped value.
+ */
+ public static String escape(final String value) {
+
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(attrSep, escAttrSep)
+ .replace(attrTupleSep, escAttrTupleSep)
+ .replace(attrValueSep, escAttrValueSep);
+ }
+
+ /**
+ * Unescape any given string.
+ *
+ * @param value The HTTP Value to be unescaped.
+ *
+ * @return The value unescaped value.
+ */
+ public static String unescape(final String value) {
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(escAttrSep, attrSep)
+ .replace(escAttrTupleSep, attrTupleSep)
+ .replace(escAttrValueSep, attrValueSep);
+ }
+
+ /**
+ * Appends the string representation of an object to a StringBuilder.
+ *
+ * @param strBuilder The StringBuilder to append to.
+ * @param val The string representation of an object.
+ */
+ public static void appendIfNotNull(final StringBuilder strBuilder,
+ final Object val) {
+
+ if (val != null) {
+ strBuilder.append(val);
+ }
+ }
+
+ /**
+ * Given a separator and a list of strings, joins the list, as a string,
+ * separated by the separator string.
+ *
+ * @param list The list of strings to join.
+ * @param separator The separator string.
+ * @return the list, as a string, separated by the separator string.
+ */
+ public static String listToString(final List<String> list,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ for (final String s : list) {
+ if (!StringUtils.isEmpty(s)) {
+ strBuilder.append(AttributeUtil.escape(s) + separator);
+ }
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Given a separator and a map of strings to strings, joins the map, as a
+ * string, separated by the separator string with the pair key/value
+ * concatenated with a '='.
+ *
+ * @param map The map of strings to join.
+ * @param separator The separator string.
+ *
+ * @return the map of strings, as a string, separated by the separator string
+ * with the pair key/value concatenated with a '='.
+ */
+ public static String mapToString(final Map<String, String> map,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ final Iterator<Entry<String, String>> valuesIt = map.entrySet().iterator();
+ while (valuesIt.hasNext()) {
+ final Entry<String, String> entry = valuesIt.next();
+ strBuilder.append(entry.getKey());
+ strBuilder.append('=');
+ strBuilder.append(AttributeUtil.escape(entry.getValue()));
+ strBuilder.append(separator);
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates the attribute value format.
+ *
+ * @param value The attribute value to validate.
+ *
+ * @return true if value has a valid format.
+ */
+ public static boolean isValidValue(final String value) {
+ boolean retVal = false;
+ if (value != null && value.charAt(0) == '[' && value.endsWith("]")) {
+ final String tmpAttrValue = value.substring(1, value.length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ if (tmpAttrValue.length() >= 0
+ || (vals.length > 0 && vals[0].length() > 0)) {
+ retVal = true;
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the attribute type value. It's case insensitive. E.g. return true
+ * value to: a) "true", "TRUE", "True", ... b) "false", "FALSE", "False", ...
+ *
+ * @param type The attribute type value.
+ *
+ * @return true if type has a true or false (case insensitive) value.
+ */
+ public static boolean isValidType(final String type) {
+ return StringUtils.isNotEmpty(type) && (PEPSValues.TRUE.toString().equalsIgnoreCase(type) || PEPSValues.FALSE.toString().equalsIgnoreCase(type)) ;
+ }
+
+ /**
+ * Validates the Personal attribute tuple. E.g. name:type:[value]:status
+ *
+ * @param tuples The Personal attribute's tuple.
+ *
+ * @return true if the tuples' format is valid.
+ *
+ * @see PEPSUtil#validateParameter(String, String, String)
+ * @see String#equalsIgnoreCase(String)
+ */
+ public static boolean hasValidTuples(final String[] tuples) {
+ boolean retVal = false;
+
+ final int numberTuples = AttributeConstants.NUMBER_TUPLES.intValue();
+ if (tuples != null && tuples.length == numberTuples) {
+ // validate attrName
+ final int attrNameIndex = AttributeConstants.ATTR_NAME_INDEX.intValue();
+ final int attrTypeIndex = AttributeConstants.ATTR_TYPE_INDEX.intValue();
+ final int attrValueIndex = AttributeConstants.ATTR_VALUE_INDEX.intValue();
+
+ retVal =
+ StringUtils.isNotEmpty(tuples[attrNameIndex])
+ && StringUtils.isNotEmpty(tuples[attrTypeIndex])
+ && StringUtils.isNotEmpty(tuples[attrValueIndex])
+ && AttributeUtil.isValidType(tuples[attrTypeIndex])
+ && AttributeUtil.isValidValue(tuples[attrValueIndex]);
+ }
+ return retVal;
+ }
+
+ /**
+ * Check if all mandatory attributes have values.
+ *
+ * @param personalAttrList The Personal Attributes List.
+ *
+ * @return true if all mandatory attributes have values, false if at least one
+ * attribute doesn't have value.
+ */
+ public static boolean checkMandatoryAttributes(
+ final IPersonalAttributeList personalAttrList) {
+
+ final Iterator<PersonalAttribute> itAttributes =
+ personalAttrList.values().iterator();
+ boolean retVal = true;
+ while (itAttributes.hasNext() && retVal) {
+ final PersonalAttribute attr = itAttributes.next();
+ if (attr.isRequired()
+ && !STORKStatusCode.STATUS_AVAILABLE.toString()
+ .equals(attr.getStatus())) {
+ retVal = false;
+ }
+ }
+ return retVal;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base
new file mode 100644
index 000000000..9ebcfbd5a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base
@@ -0,0 +1,123 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Citizen
+ * Consent.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CitizenConsent {
+
+ /**
+ * Mandatory attributes list.
+ */
+ private List<String> mandatoryList;
+
+ /**
+ * Optional attributes list.
+ */
+ private List<String> optionalList;
+
+ /**
+ * Citizen Consent default Constructor.
+ */
+ public CitizenConsent() {
+ this.mandatoryList = new ArrayList<String>();
+ this.optionalList = new ArrayList<String>();
+ }
+
+ /**
+ * Getter for the mandatoryList value.
+ *
+ * @return The mandatoryList value.
+ */
+ public List<String> getMandatoryList() {
+ return this.mandatoryList;
+ }
+
+ /**
+ * Setter for the mandatoryList value.
+ *
+ * @param mandatoryAttrList Mandatory parameters list.
+ */
+ public void setMandatoryList(final List<String> mandatoryAttrList) {
+ this.mandatoryList = mandatoryAttrList;
+ }
+
+ /**
+ * Setter for some mandatoryAttribute. Adds the input parameter to the
+ * mandatoryList.
+ *
+ * @param mandatoryAttr Attribute to add to the mandatoryList.
+ */
+ public void setMandatoryAttribute(final String mandatoryAttr) {
+ this.mandatoryList.add(mandatoryAttr);
+ }
+
+ /**
+ * Getter for the optionalList value.
+ *
+ * @return The optionalList value.
+ */
+ public List<String> getOptionalList() {
+ return optionalList;
+ }
+
+ /**
+ * Setter for the optionalList value.
+ *
+ * @param optAttrList Optional parameters list.
+ */
+ public void setOptionalList(final List<String> optAttrList) {
+ this.optionalList = optAttrList;
+ }
+
+ /**
+ * Setter for some optionalAttr. Adds the input parameter to the optionalList.
+ *
+ * @param optionalAttr Attribute to add to the optionalList.
+ */
+ public void setOptionalAttribute(final String optionalAttr) {
+ this.optionalList.add(optionalAttr);
+ }
+
+ /**
+ * Returns a string in the following format. "Mandatory attributes:
+ * mandatoryAttr1;mandatoryAttr2;mandatoryAttrN Optional attributes:
+ * optionalAttr1;optionalAttr2;optionalAttrN"
+ *
+ * @return {@inheritDoc}
+ */
+ public String toString() {
+ final StringBuilder strbldr = new StringBuilder(46);
+ strbldr.append("Mandatory attributes: ");
+ for (final String str : mandatoryList) {
+ strbldr.append(str).append(';');
+ }
+ strbldr.append(" Optional attributes: ");
+ for (final String str : optionalList) {
+ strbldr.append(str).append(';');
+ }
+ return strbldr.toString();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base
new file mode 100644
index 000000000..001f9317a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base
@@ -0,0 +1,95 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Country.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class Country implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1135994036496370993L;
+
+/**
+ * Country Id.
+ */
+ private String countryId;
+
+ /**
+ * Country Name.
+ */
+ private String countryName;
+
+ /**
+ * Country Constructor.
+ *
+ * @param cId Id of the Country.
+ * @param cName Name of the Country.
+ */
+ public Country(final String cId, final String cName) {
+
+ this.countryId = cId;
+ this.countryName = cName;
+ }
+
+ /**
+ * Getter for the countryId value.
+ *
+ * @return The countryId value.
+ */
+ public String getCountryId() {
+
+ return countryId;
+ }
+
+ /**
+ * Setter for the countryId value.
+ *
+ * @param cId Id of the Country.
+ */
+ public void setCountryId(final String cId) {
+
+ this.countryId = cId;
+ }
+
+ /**
+ * Getter for the countryName value.
+ *
+ * @return The countryName value.
+ */
+ public String getCountryName() {
+
+ return countryName;
+ }
+
+ /**
+ * Setter for the countryName value.
+ *
+ * @param name Name of the Country.
+ */
+ public void setCountryName(final String name) {
+
+ this.countryName = name;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base
new file mode 100644
index 000000000..54345f3ea
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base
@@ -0,0 +1,79 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This class contains all the ISO 3166-1 Alpha 3 Country Codes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2011-04-14 00:24:56 $
+ */
+public final class CountryCodes {
+
+ /**
+ * Private Constructor.
+ */
+ private CountryCodes() {
+
+ }
+
+ /**
+ * ISO 3166-1 Alpha 3 Country Codes.
+ */
+ private static List<String> countrysAlpha3 = Arrays.asList("ABW", "AFG",
+ "AGO", "AIA", "ALA", "ALB", "AND", "ANT", "ARE", "ARG", "ARM", "ASM",
+ "ATA", "ATF", "ATG", "AUS", "AUT", "AZE", "BDI", "BEL", "BEN", "BES",
+ "BFA", "BGD", "BGR", "BHR", "BHS", "BIH", "BLM", "BLR", "BLZ", "BMU",
+ "BOL", "BRA", "BRB", "BRN", "BTN", "BUR", "BVT", "BWA", "BYS", "CAF",
+ "CAN", "CCK", "CHE", "CHL", "CHN", "CIV", "CMR", "COD", "COG", "COK",
+ "COL", "COM", "CPV", "CRI", "CSK", "CUB", "CUW", "CXR", "CYM", "CYP",
+ "CZE", "DEU", "DJI", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "ERI",
+ "ESH", "ESP", "EST", "ETH", "FIN", "FJI", "FLK", "FRA", "FRO", "FSM",
+ "GAB", "GBR", "GEO", "GGY", "GHA", "GIB", "GIN", "GLP", "GMB", "GNB",
+ "GNQ", "GRC", "GRD", "GRL", "GTM", "GUF", "GUM", "GUY", "HKG", "HMD",
+ "HND", "HRV", "HTI", "HUN", "IDN", "IMN", "IND", "IOT", "IRL", "IRN",
+ "IRQ", "ISL", "ISR", "ITA", "JAM", "JEY", "JOR", "JPN", "KAZ", "KEN",
+ "KGZ", "KHM", "KIR", "KNA", "KOR", "KWT", "LAO", "LBN", "LBR", "LBY",
+ "LCA", "LIE", "LKA", "LSO", "LTU", "LUX", "LVA", "MAC", "MAF", "MAR",
+ "MCO", "MDA", "MDG", "MDV", "MEX", "MHL", "MKD", "MLI", "MLT", "MMR",
+ "MNE", "MNG", "MNP", "MOZ", "MRT", "MSR", "MTQ", "MUS", "MWI", "MYS",
+ "MYT", "NAM", "NCL", "NER", "NFK", "NGA", "NIC", "NIU", "NLD", "NOR",
+ "NPL", "NRU", "NZL", "OMN", "PAK", "PAN", "PCN", "PER", "PHL", "PLW",
+ "PNG", "POL", "PRI", "PRK", "PRT", "PRY", "PSE", "PYF", "QAT", "REU",
+ "ROM", "ROU", "RUS", "RWA", "SAU", "SCG", "SDN", "SEN", "SGP", "SGS",
+ "SHN", "SJM", "SLB", "SLE", "SLV", "SMR", "SOM", "SPM", "SRB", "STP",
+ "SUR", "SVK", "SVN", "SXW", "SWE", "SWZ", "SYC", "SYR", "TCA", "TCD",
+ "TGO", "THA", "TJK", "TKL", "TKM", "TLS", "TMP", "TON", "TTO", "TUN",
+ "TUR", "TUV", "TWN", "TZA", "UGA", "UKR", "UMI", "URY", "USA", "UZB",
+ "VAT", "VCT", "VEN", "VGB", "VIR", "VNM", "VUT", "WLF", "WSM", "YEM",
+ "YUG", "ZAF", "ZAR", "ZMB", "ZWE");
+
+ /**
+ * Searches the CountryCode (3166-1 alpha3 format) an return true if it
+ * exists.
+ *
+ * @param countryCode The Country code to search.
+ *
+ * @return true if the CountryCode exists, false otherwise.
+ */
+ public static boolean hasCountryCodeAlpha3(final String countryCode) {
+
+ return CountryCodes.countrysAlpha3.contains(countryCode);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base
new file mode 100644
index 000000000..9c0bd6775
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base
@@ -0,0 +1,169 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.sql.Timestamp;
+import java.util.GregorianCalendar;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.joda.time.Years;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * This class holds static helper methods for Date Operations.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class DateUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(DateUtil.class.getName());
+
+ /**
+ * yyyy Date format size.
+ */
+ private static final int YEAR_DATE_SIZE = 4;
+
+ /**
+ * yyyyMM Date format size.
+ */
+ private static final int MONTH_DATE_SIZE = 6;
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private DateUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Fulfils dateValue with a valid date. The following roles are applied: a) If
+ * the dateValue only contains the year then fulfils with last year's day.
+ * e.g. this method returns 19951231 to the 1995 dateValue. b) If the
+ * dateValue contains the year and the month then fulfils with last month's
+ * day. e.g. this method returns 19950630 to the 199505 dateValue.
+ *
+ * @param dateValue The date to be fulfilled.
+ *
+ * @return The dateValue fulfilled.
+ */
+ private static String fulfilDate(final String dateValue) {
+
+ final StringBuffer strBuf = new StringBuffer();
+ strBuf.append(dateValue);
+ // if the IdP just provides the year then we must fullfil the date.
+ if (dateValue.length() == YEAR_DATE_SIZE) {
+ strBuf.append(PEPSValues.LAST_MONTH.toString());
+ }
+ // if the IdP provides the year and the month then we must fullfil the
+ // date.
+ if (dateValue.length() == MONTH_DATE_SIZE
+ || strBuf.length() == MONTH_DATE_SIZE) {
+ // IdP doesn't provide the day, so we will use DateTime to
+ // calculate it.
+ final String noDayCons = PEPSValues.NO_DAY_DATE_FORMAT.toString();
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(noDayCons);
+ final DateTime dateTime = fmt.parseDateTime(strBuf.toString());
+ // Append the last month's day.
+ strBuf.append(dateTime.dayOfMonth().withMaximumValue().getDayOfMonth());
+ }
+
+ return strBuf.toString();
+ }
+
+ /**
+ * Validates the dateValue format: a) if has a valid size; b) if has a numeric
+ * value; Note: dateValue must have the format yyyyMMdd.
+ *
+ * @param dateValueTmp The date to be validated.
+ * @param pattern The accepted date format.
+ *
+ * @return true if the date has a valid format.
+ */
+ public static boolean isValidFormatDate(final String dateValueTmp,
+ final String pattern) {
+
+ boolean retVal = true;
+ try {
+ final String dateValue = DateUtil.fulfilDate(dateValueTmp);
+
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ fmt.parseDateTime(dateValue);
+ } catch (final Exception e) {
+ // We catch Exception because we only have to return false
+ // value!
+ retVal = false;
+ }
+ return retVal;
+ }
+
+ /**
+ * Calculates the age for a given date string.
+ *
+ * @param dateVal The date to be validated.
+ * @param now The current date.
+ * @param pattern The date pattern.
+ *
+ * @return The age value.
+ */
+ public static int calculateAge(final String dateVal, final DateTime now,
+ final String pattern) {
+
+ if (DateUtil.isValidFormatDate(dateVal, pattern)) {
+ try {
+ final String dateValueTemp = DateUtil.fulfilDate(dateVal);
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ final DateTime dateTime = fmt.parseDateTime(dateValueTemp);
+ // Calculating age
+ final Years age = Years.yearsBetween(dateTime, now);
+
+ return age.getYears();
+ } catch (final IllegalArgumentException e) {
+ LOG.warn("Invalid date format (" + pattern
+ + ") or an invalid dateValue.");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()),
+ e);
+ }
+ } else {
+ LOG.warn("Couldn't calculate Age, invalid date!");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()));
+ }
+
+ }
+
+ /**
+ * Generates the current timestamp.
+ *
+ * @return timestamp The current timestamp
+ */
+ public static Timestamp currentTimeStamp() {
+ final GregorianCalendar cal = new GregorianCalendar();
+ final long millis = cal.getTimeInMillis();
+ return new Timestamp(millis);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base
new file mode 100644
index 000000000..b13c70f04
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base
@@ -0,0 +1,148 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface for {@link AttributeListProcessor}.
+ *
+ * @author ricardo.ferreira@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ *
+ * @see IPersonalAttributeList
+ */
+public interface IAttributeListProcessor {
+
+ /**
+ * Checks if attribute list only contains allowed attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the allowed attributes
+ *
+ * @return true is all the attributes are allowed.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAllowedAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Lookup for business attribute.
+ *
+ * @param attrList the requested attribute list
+ * @param normalAttributes the normal attributes
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList, final List<String> normalAttributes);
+
+ /**
+ * Lookup for business attribute in normal attribute list (loaded by
+ * implementation).
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes to get business
+ * attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to add (eIdentifier, name,
+ * surname, and DateOfBirth).
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes, loaded by
+ * implementation, to get business attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Removes from attribute list the given list of attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to remove.
+ *
+ * @return the requested attribute list and the attributes removed.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Removes from attribute list the given list of attributes and change
+ * attributes status if attribute was optional in the request.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the map of attributes (attribute name, mandatory/optional) to remove.
+ *
+ * @return the requested attribute list and the attributes removed
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(IPersonalAttributeList attrList, Map<String, Boolean> attributes);
+
+ /**
+ * Checks if mandate attribute exist in the requested Attribute List. Power
+ * attribute name to lookup is loaded by implementation.
+ *
+ * @param attrList the requested attribute list.
+ *
+ * @return true if mandate attribute exists or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasPowerAttribute(final IPersonalAttributeList attrList);
+
+ /**
+ * Checks if attribute name was requested and has value.
+ *
+ * @param attrList the requested attribute list.
+ * @param attrName the attribute name to lookup for .
+ *
+ * @return true if attribute was requested and has value or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAttributeValue(final IPersonalAttributeList attrList, final String attrName);
+
+ /**
+ * Checks if attribute has value.
+ *
+ * @param attr the attribute to check.
+ *
+ * @return true if has value;
+ *
+ * @see PersonalAttribute
+ */
+ boolean hasAttributeValue(final PersonalAttribute attr);
+
+ /**
+ * Gets a map (attribute name, attribute isRequired) of attributes added to attribute list.
+ *
+ * @return the Map of attributes added and if is required to attribute list.
+ */
+ Map<String, Boolean> getNormalAttributesAdded();
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base
new file mode 100644
index 000000000..5833f6822
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base
@@ -0,0 +1,82 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+
+/**
+ * Interface for Attributes Providers map.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-09-20 $
+ */
+public interface IAttributeProvidersMap {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ IPersonalAttributeList get(AttributeSource key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(AttributeSource key, IPersonalAttributeList value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ IPersonalAttributeList remove(AttributeSource key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(AttributeSource key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns an Iterator of the keys contained in this map. The implementation must
+ * take care in order for the Iterator to have predictable order of the returned
+ * keys.
+ *
+ * @return an iterator of the keys contained in this map
+ */
+ Iterator<AttributeSource> keyIterator();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base
new file mode 100644
index 000000000..b24c915c0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base
@@ -0,0 +1,194 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Interface for {@link PersonalAttributeList}.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.16 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD.CloneMethodMustImplementCloneable")
+public interface IPersonalAttributeList extends Iterable<PersonalAttribute>,
+ Cloneable {
+
+ /**
+ * Associates the specified value with the specified key in this Personal
+ * Attribute List.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return the previous value associated with key, or null if there was no
+ * mapping for key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute put(String key, PersonalAttribute value);
+
+ /**
+ * Returns the value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @param key whose associated value is to be returned.
+ *
+ * @return The value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute get(Object key);
+
+ /**
+ * Adds to the PersonalAttributeList the given PersonalAttribute. It sets the
+ * attribute name as the key to the attribute value.
+ *
+ * @param value PersonalAttribute to add to the PersonalAttributeList
+ */
+ void add(PersonalAttribute value);
+
+ /**
+ * Get the size of the Personal Attribute List.
+ *
+ * @return size of the Personal Attribute List.
+ */
+ int size();
+
+ /**
+ * Checks if the Personal Attribute List contains the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if the Personal Attribute List contains the given key, false
+ * otherwise.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Getter for the iterator of the Personal Attribute List values.
+ *
+ * @return The iterator for the Personal Attribute List values.
+ *
+ * @see PersonalAttribute
+ */
+ Iterator<PersonalAttribute> iterator();
+
+ /**
+ * Creates a Personal Attribute List from a String representing an Attribute
+ * List.
+ *
+ * @param attrList String Object representing the attribute list.
+ */
+ void populate(String attrList);
+
+ /**
+ * Removes the mapping for this key from this map if present.
+ *
+ * @param key key whose mapping is to be removed from the map.
+ * @return previous value associated with specified key, or <tt>null</tt> if
+ * there was no mapping for key. A <tt>null</tt> return can also
+ * indicate that the map previously associated <tt>null</tt> with the
+ * specified key.
+ */
+ PersonalAttribute remove(Object key);
+
+ /**
+ * Returns a collection view of the values contained in this map. The
+ * collection is backed by the map, so changes to the map are reflected in the
+ * collection, and vice-versa. The collection supports element removal, which
+ * removes the corresponding mapping from this map, via the
+ * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>clear</tt> operations. It does not support the
+ * <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * @return a collection view of the values contained in this map.
+ */
+ Collection<PersonalAttribute> values();
+
+ /**
+ * Returns a {@link Set} view of the keys contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. If the map is modified
+ * while an iteration over the set is in progress (except through
+ * the iterator's own <tt>remove</tt> operation), the results of
+ * the iteration are undefined. The set supports element removal,
+ * which removes the corresponding mapping from the map, via the
+ * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or <tt>addAll</tt>
+ * operations.
+ *
+ * @return a set view of the keys contained in this map
+ */
+ Set<String> keySet();
+
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes.
+ *
+ * @return an IPersonalAttributeList of the complex attributes.
+ */
+ IPersonalAttributeList getComplexAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the simple value attributes.
+ *
+ * @return an IPersonalAttributeList of the simple value attributes.
+ */
+ IPersonalAttributeList getSimpleValueAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ IPersonalAttributeList getMandatoryAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ IPersonalAttributeList getOptionalAttributes();
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ *
+ * @return <tt>true</tt> if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns <tt>true</tt> if this map contains at least one element that doesn't have value.
+ *
+ * @return <tt>true</tt> if this map contains at least one element that doesn't have value.
+ */
+ boolean hasMissingValues();
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ Object clone() throws CloneNotSupportedException;
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base
new file mode 100644
index 000000000..33eb618f0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base
@@ -0,0 +1,239 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork logging.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public interface IStorkLogger {
+
+ /**
+ * Getter for SpApplication.
+ *
+ * @return The SpApplication value.
+ */
+ String getSpApplication();
+
+ /**
+ * Setter for SpApplication.
+ *
+ * @param spApplication The SP Application.
+ */
+ void setSpApplication(String spApplication);
+
+ /**
+ * Getter for ProviderName.
+ *
+ * @return The ProviderName value.
+ */
+ String getProviderName();
+
+ /**
+ * Setter for ProviderName.
+ *
+ * @param providerName The provider name.
+ */
+ void setProviderName(String providerName);
+
+ /**
+ *
+ * Getter for Origin.
+ *
+ * @return The Origin value.
+ *
+ */
+ String getOrigin();
+
+ /**
+ * Setter for Origin.
+ *
+ * @param origin The origin.
+ */
+ void setOrigin(String origin);
+
+ /**
+ *
+ * Getter for QAA Level.
+ *
+ * @return The QAA Level value.
+ *
+ */
+ int getQaaLevel();
+
+ /**
+ * Setter for QAA Level.
+ *
+ * @param qaaLevel The qaa level.
+ */
+ void setQaaLevel(int qaaLevel);
+
+ /**
+ *
+ * Getter for timestamp.
+ *
+ * @return The timestamp value.
+ *
+ */
+ String getTimestamp();
+
+ /**
+ * Setter for timestamp.
+ *
+ * @param timestamp The request's timestamp.
+ */
+ void setTimestamp(String timestamp);
+
+ /**
+ * Getter for InResponseTo.
+ *
+ * @return The InResponseTo value.
+ */
+ String getInResponseTo();
+
+ /**
+ * Setter for InResponseTo.
+ *
+ * @param inResponseTo The Saml's response id.
+ */
+ void setInResponseTo(String inResponseTo);
+
+ /**
+ * Getter for InResponseToSPReq.
+ *
+ * @return The InResponseToSPReq value.
+ */
+ String getInResponseToSPReq();
+
+ /**
+ * Setter for InResponseToSPRequ.
+ *
+ * @param inResponseToSPReq The Saml's response id.
+ */
+ void setInResponseToSPReq(String inResponseToSPReq);
+
+ /**
+ * Getter for opType.
+ *
+ * @return The opType value.
+ */
+ String getOpType();
+
+ /**
+ * Setter for opType.
+ *
+ * @param opType The operation type.
+ */
+ void setOpType(String opType);
+
+ /**
+ * Getter for destination.
+ *
+ * @return The destination value.
+ */
+ String getDestination();
+
+ /**
+ * Setter for destinationIp.
+ *
+ * @param destination The remote IP.
+ */
+ void setDestination(String destination);
+
+ /**
+ * Getter for message or assertion consumer.
+ *
+ * @return The message or assertion consumer.
+ */
+ String getMessage();
+
+ /**
+ * Setter for message or assertion consumer.
+ *
+ * @param message or assertion consumer.
+ */
+ void setMessage(String message);
+
+ /**
+ * Getter for country.
+ *
+ * @return The country value.
+ */
+ String getCountry();
+
+ /**
+ * Setter for country.
+ *
+ * @param country The country.
+ */
+ void setCountry(String country);
+
+ /**
+ * Getter for samlHash.
+ *
+ * @return The samlHash value.
+ */
+ byte[] getSamlHash();
+
+ /**
+ * Setter for samlHash.
+ *
+ * @param samlHash the encrypted SAML token
+ */
+ void setSamlHash(byte[] samlHash);
+
+ /**
+ * Getter for msgId.
+ *
+ * @return the msgId
+ */
+ String getMsgId();
+
+ /**
+ * Setter for msgId.
+ *
+ * @param msgId the ID of the originator of this message
+ */
+ void setMsgId(String msgId);
+
+ /**
+ * Getter for sPMsgId.
+ *
+ * @return the sPMsgId
+ */
+ String getSPMsgId();
+
+ /**
+ * Setter for sPMsgId.
+ *
+ * @param sPMsgId the ID of the originator of this message
+ */
+ void setSPMsgId(String sPMsgId);
+
+ /**
+ * The format of the returned String must be the following:
+ * "requestCounter#ddMMMyyyykk:mm:ss#opType#originIp#originName
+ * #destinationIp#destinationName#samlHash#[originatorName#msgId#]"
+ *
+ * The values enclosed in '[]' only apply when logging responses.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ String toString();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base
new file mode 100644
index 000000000..f38b41838
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base
@@ -0,0 +1,85 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork session.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public interface IStorkSession {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ Object get(Object key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(String key, Object value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object remove(Object key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base
new file mode 100644
index 000000000..bf236258d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base
@@ -0,0 +1,316 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information of Attribute Providers, the Attribute
+ * List to be requested, the Assertions returned by the Attribute Providers and the values
+ * that each Attribute has. This information along with the current status of the Linker (the
+ * attribute providers that were queried and the remaining providers) is used by the PEPS
+ * actions in order to complete the Attribute gathering.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.50 $, $Date: 2013-11-28 $
+ */
+public final class Linker implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -3268006381745987237L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(Linker.class.getName());
+
+ /**
+ * Attributes Providers map.
+ */
+ private IAttributeProvidersMap attributeProvidersMap;
+
+ /**
+ * Assertion map.
+ */
+ private LinkedHashMap<AttributeSource, STORKAttrQueryResponse> assertions;
+
+ /**
+ * The current index of local (domestic) Attribute Providers.
+ */
+ private int localIndex;
+
+ /**
+ * The current index of remote (foreign) Attribute Providers - countries.
+ */
+ private int remoteIndex;
+
+ /**
+ * Constructs an empty Linker object.
+ */
+ public Linker() {
+ localIndex = 0;
+ remoteIndex = 0;
+
+ assertions = new LinkedHashMap<AttributeSource, STORKAttrQueryResponse>();
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next local Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextLocalProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap!=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( curIndex>=localIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next remote Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextRemoteProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( curIndex>=remoteIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * It updates the Linker with the values returned by the Attribute Source. It also advances
+ * to the next index in order to mark this attribute source as completed.
+ *
+ * @param source The Attribute Source that was queried for attribute values.
+ * @param attrResponse The attrResponse returned by the Attribute Source that contains the attribute values.
+ *
+ * @see AttributeSource, STORKAttrQueryResponse
+ */
+ public void setProviderReponse(AttributeSource source, STORKAttrQueryResponse attrResponse) {
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ //Assertion storage
+ this.assertions.put(source, attrResponse);
+
+ this.attributeProvidersMap.put(source, attrResponse.getPersonalAttributeList());
+ //this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
+ }
+
+ /**
+ * Reset the internal state of the local Attribute Source in order to start over.
+ */
+ public void resetLocalIndex() {
+ localIndex = 0;
+ }
+
+ /**
+ * Reset the internal state of the remote Attribute Source in order to start over.
+ */
+ public void resetRemoteIndex() {
+ remoteIndex = 0;
+ }
+
+ /**
+ * Setter for attributeProvidersMap.
+ *
+ * @param attributeProvidersMap The attributeProvidersMap to set.
+ */
+ public void setAttributeProvidersMap(IAttributeProvidersMap attributeProvidersMap) {
+ this.attributeProvidersMap = attributeProvidersMap;
+ }
+
+ /**
+ * Getter for attributeProvidersMap.
+ *
+ * @return attributeProvidersMap
+ */
+ public IAttributeProvidersMap getAttributeProvidersMap() {
+ return attributeProvidersMap;
+ }
+
+ /**
+ * Returns the Personal Attribute list of the provided Attribute Source.
+ *
+ * @param source The attributeSource in reference
+ *
+ * @return The IPersonalAttributeList assosiated with this source or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getProviderAttributes(AttributeSource source) {
+ if ( attributeProvidersMap.containsKey(source) )
+ return attributeProvidersMap.get(source);
+ else
+ return null;
+ }
+
+ /**
+ * Returns the merged Personal Attribute list from all the Attribute Sources.
+ *
+ * @return The IPersonalAttributeList merged Personal Attribute list or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getAllAttributes() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source;
+ IPersonalAttributeList list, merged;
+
+ merged = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+
+ merged = new PersonalAttributeList();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+ list = this.getProviderAttributes(source);
+
+ for (final PersonalAttribute pa : list) {
+ merged.add(pa);
+ }
+ }
+ }
+
+ return merged;
+ }
+
+ /**
+ * Returns a List with all the assertions gathered by the AAS-PEPS module
+ * returned both by local APs or remote A-PEPS.
+ *
+ * @return The assertions returned from the APs and A-PEPS
+ */
+ public List<STORKAttrQueryResponse> getAttrQueryResponseList() {
+ List<STORKAttrQueryResponse> originalAssertions;
+
+ originalAssertions = new ArrayList<STORKAttrQueryResponse>();
+
+ //Gather all assertions
+ for (STORKAttrQueryResponse element : this.assertions.values()) {
+ originalAssertions.add(element);
+ }
+
+ return originalAssertions;
+ }
+
+ /**
+ * Checks the internal state of the Linker and if all Attribute Sources where visited
+ * returns true, otherwise it returns false. So if you go directly from AtPLinkerAction
+ * to MoreAttributesAction the call will have, since the method setProviderReponse
+ * was not executed from every Attribute Source.
+ *
+ * @return true if everything is OK, false otherwise
+ */
+ public boolean isComplete() {
+ boolean outcome = false;
+
+ LOG.debug("Check if linkder is complete: R[" + remoteIndex + "], L[" + localIndex + "], S[" + attributeProvidersMap.size() + "]");
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ if ( (remoteIndex + localIndex)==attributeProvidersMap.size() )
+ outcome = true;
+ }
+ else {
+ outcome = true;
+ }
+
+ return outcome;
+ }
+
+ /**
+ * Merge the two Linker objects.
+ *
+ * @param previous The other Linker object to merge with this one.
+ */
+ public void mergeWith(Linker previous) {
+ //BEFORE
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap from the current object.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ LOG.debug("The attributeProvidersMap from the provided object.");
+ ((AttributeProvidersMap)previous.getAttributeProvidersMap()).trace();
+ }
+
+ IAttributeProvidersMap map = previous.getAttributeProvidersMap();
+ Iterator<AttributeSource> items = map.keyIterator();
+ while( items.hasNext() ) {
+ AttributeSource item = items.next();
+ IPersonalAttributeList pal = map.get(item);
+
+ if ( this.attributeProvidersMap.containsKey(item) ) {
+ IPersonalAttributeList new_pal = this.attributeProvidersMap.get(item);
+
+ for(PersonalAttribute pa : pal)
+ new_pal.add(pa);
+ }
+ else {
+ if ( item.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ this.attributeProvidersMap.put(item, pal);
+ }
+ }
+
+ //AFTER
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap after the merge.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ }
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base
new file mode 100644
index 000000000..5da9ba494
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public enum PEPSErrors {
+
+ /**
+ * Represents the 'authenticationFailed' constant error identifier.
+ */
+ AUTHENTICATION_FAILED_ERROR("authenticationFailed"),
+ /**
+ * Represents the 'spCountrySelector.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_ERROR_CREATE_SAML("spCountrySelector.errorCreatingSAML"),
+ /**
+ * Represents the 'spCountrySelector.destNull' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_DESTNULL("spCountrySelector.destNull"),
+ /**
+ * Represents the 'spCountrySelector.invalidAttr' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_ATTR("spCountrySelector.invalidAttr"),
+ /**
+ * Represents the 'spCountrySelector.invalidProviderName' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_PROVIDER_NAME(
+ "spCountrySelector.invalidProviderName"),
+ /**
+ * Represents the 'spCountrySelector.invalidQaaSPid' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_QAASPID("spCountrySelector.invalidQaaSPid"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpId' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPID("spCountrySelector.invalidSpId"),
+ /**
+ * Represents the 'spCountrySelector.invalidSPQAA' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPQAA("spCountrySelector.invalidSPQAA"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpURL' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPURL("spCountrySelector.invalidSpURL"),
+ /**
+ * Represents the 'spCountrySelector.spNotAllowed' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_SPNOTALLOWED("spCountrySelector.spNotAllowed"),
+
+ /**
+ * Represents the 'sProviderAction.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_ERROR_CREATE_SAML("sProviderAction.errorCreatingSAML"),
+ /**
+ * Represents the 'sProviderAction.attr' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_ATTR("sProviderAction.invalidAttr"),
+ /**
+ * Represents the 'sProviderAction.country' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_COUNTRY("sProviderAction.invalidCountry"),
+ /**
+ * Represents the 'sProviderAction.relayState' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_RELAY_STATE("sProviderAction.invalidRelayState"),
+ /**
+ * Represents the 'sProviderAction.saml' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SAML("sProviderAction.invalidSaml"),
+ /**
+ * Represents the 'sProviderAction.spAlias' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPALIAS("sProviderAction.invalidSPAlias"),
+ /**
+ * Represents the 'sProviderAction.spDomain' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPDOMAIN("sProviderAction.invalidSPDomain"),
+ /**
+ * Represents the 'sProviderAction.spId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPID("sProviderAction.invalidSPId"),
+ /**
+ * Represents the 'sProviderAction.spQAA' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAA("sProviderAction.invalidSPQAA"),
+ /**
+ * Represents the 'sProviderAction.spQAAId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAAID("sProviderAction.invalidSPQAAId"),
+ /**
+ * Represents the 'sProviderAction.spRedirect' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPREDIRECT("sProviderAction.invalidSPRedirect"),
+ /**
+ * Represents the 'sPPowerValidationAction.invalidSPPVAttrList' constant error identifier.
+ */
+ SPPOWERVALIDATION_SELECTOR_INVALID_SP_PV_ATTR_LIST("sPPowerValidationAction.invalidSPPVAttrList"),
+
+ /**
+ * Represents the 'sProviderAction.invalidSPProviderName' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SP_PROVIDERNAME(
+ "sProviderAction.invalidSPProviderName"),
+ /**
+ * Represents the 'sProviderAction.spNotAllowed' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_SPNOTALLOWED("sProviderAction.spNotAllowed"),
+
+
+ /**
+ * Represents the 'internalError' constant error identifier.
+ */
+ INTERNAL_ERROR("internalError"),
+
+ /**
+ * Represents the 'colleagueRequest.attrNull' constant error identifier.
+ */
+ COLLEAGUE_REQ_ATTR_NULL("colleagueRequest.attrNull"),
+ /**
+ * Represents the 'colleagueRequest.errorCreatingSAML' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_ERROR_CREATE_SAML("colleagueRequest.errorCreatingSAML"),
+ /**
+ * Represents the 'colleagueRequest.invalidCountryCode' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_COUNTRYCODE("colleagueRequest.invalidCountryCode"),
+ /**
+ * Represents the 'colleagueRequest.invalidDestUrl' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_DEST_URL("colleagueRequest.invalidDestUrl"),
+ /**
+ * Represents the 'colleagueRequest.invalidQaa' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_QAA("colleagueRequest.invalidQaa"),
+ /**
+ * Represents the 'colleagueRequest.invalidRedirect' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_REDIRECT("colleagueRequest.invalidRedirect"),
+ /**
+ * Represents the 'colleagueRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_SAML("colleagueRequest.invalidSAML"),
+
+ /**
+ * Represents the 'colleaguePVRequest.invalidPVAttrList' constant error identifier.
+ */
+ COLLEAGUE_PV_REQ_INVALID_PV_ATTR_LIST("colleaguePVRequest.invalidPVAttrList"),
+
+
+ /**
+ * Represents the 'cpepsRedirectUrl' constant error identifier.
+ */
+ CPEPS_REDIRECT_URL("cpepsRedirectUrl"),
+ /**
+ * Represents the 'spepsRedirectUrl' constant error identifier.
+ */
+ SPEPS_REDIRECT_URL("spepsRedirectUrl"),
+ /**
+ * Represents the 'sProviderAction.invCountry' constant error identifier.
+ */
+ SP_ACTION_INV_COUNTRY("sProviderAction.invCountry"),
+
+ /**
+ * Represents the 'providernameAlias.invalid' constant error identifier.
+ */
+ PROVIDER_ALIAS_INVALID("providernameAlias.invalid"),
+
+
+ /**
+ * Represents the 'cPeps.attrNull' constant error identifier.
+ */
+ CPEPS_ATTR_NULL("cPeps.attrNull"),
+
+ /**
+ * Represents the 'colleagueResponse.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_RESP_INVALID_SAML("colleagueResponse.invalidSAML"),
+
+ /**
+ * Represents the 'citizenNoConsent.mandatory' constant error identifier.
+ */
+ CITIZEN_NO_CONSENT_MANDATORY("citizenNoConsent.mandatory"),
+ /**
+ * Represents the 'citizenResponse.mandatory' constant error identifier.
+ */
+ CITIZEN_RESPONSE_MANDATORY("citizenResponse.mandatory"),
+ /**
+ * Represents the 'attVerification.mandatory' constant error identifier.
+ */
+ ATT_VERIFICATION_MANDATORY("attVerification.mandatory"),
+ /**
+ * Represents the 'attrValue.verification' constant error identifier.
+ */
+ ATTR_VALUE_VERIFICATION("attrValue.verification"),
+
+ /**
+ * Represents the 'audienceRestrictionError' constant error identifier.
+ */
+ AUDIENCE_RESTRICTION("audienceRestrictionError"),
+ /**
+ * Represents the 'auRequestIdError' constant error identifier.
+ */
+ AU_REQUEST_ID("auRequestIdError"),
+ /**
+ * Represents the 'domain' constant error identifier.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the 'hash.error' constant error identifier.
+ */
+ HASH_ERROR("hash.error"),
+ /**
+ * Represents the 'invalidAttributeList' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_LIST("invalidAttributeList"),
+ /**
+ * Represents the 'invalidAttributeValue' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_VALUE("invalidAttributeValue"),
+ /**
+ * Represents the 'qaaLevel' constant error identifier.
+ */
+ QAALEVEL("qaaLevel"),
+ /**
+ * Represents the 'requests' constant error identifier.
+ */
+ REQUESTS("requests"),
+ /**
+ * Represents the 'SPSAMLRequest' constant error identifier.
+ */
+ SP_SAML_REQUEST("SPSAMLRequest"),
+ /**
+ * Represents the 'spepsSAMLRequest' constant error identifier.
+ */
+ SPEPS_SAML_REQUEST("spepsSAMLRequest"),
+ /**
+ * Represents the 'IdPSAMLResponse' constant error identifier.
+ */
+ IDP_SAML_RESPONSE("IdPSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ CPEPS_SAML_RESPONSE("cpepsSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ SPEPS_SAML_RESPONSE("spepsSAMLResponse"),
+ /**
+ * Represents the 'session' constant error identifier.
+ */
+ SESSION("session"),
+ /**
+ * Represents the 'invalid.session' constant error identifier.
+ */
+ INVALID_SESSION("invalid.session"),
+ /**
+ * Represents the 'invalid.sessionId' constant error identifier.
+ */
+ INVALID_SESSION_ID("invalid.sessionId"),
+ /**
+ * Represents the 'missing.sessionId' constant error identifier.
+ */
+ MISSING_SESSION_ID("sessionError"),
+ /**
+ * Represents the 'missing.mandate' constant error identifier.
+ */
+ MISSING_MANDATE("missing.mandate"),
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_SAML_RESPONSE("AtPSAMLResponse"),
+
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_RESPONSE_ERROR("atp.response.error"),
+
+ /**
+ * Represents the 'apepsSAMLRequest' constant error identifier.
+ */
+ APEPS_SAML_REQUEST("apepsSAMLRequest"),
+
+ /**
+ * Represents the 'apepsSAMLResponse' constant error identifier.
+ */
+ APEPS_SAML_RESPONSE("apepsSAMLResponse"),
+
+ /**
+ * Represents the 'invalid.apepsRedirectUrl' constant error identifier.
+ */
+ INVALID_APEPS_REDIRECT_URL("invalid.apepsRedirectUrl"),
+
+ /**
+ * Represents the 'invalid.apepsCallbackUrl' constant error identifier.
+ */
+ INVALID_APEPS_CALLBACK_URL("invalid.apepsCallbackUrl"),
+
+ /**
+ * Represents the 'colleagueAttributeRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_ATTR_REQ_INVALID_SAML("colleagueAttributeRequest.invalidSAML");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String error;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nError The Constant error value.
+ */
+ PEPSErrors(final String nError) {
+ this.error = nError;
+ }
+
+ /**
+ * Construct the errorCode Constant value.
+ *
+ * @return The errorCode Constant.
+ */
+ public String errorCode() {
+ return error + ".code";
+ }
+
+ /**
+ * Construct the errorCode Constant value with the given code text.
+ *
+ * @param text the code text to append to the constant.
+ *
+ * @return The errorCode Constant for the given code text.
+ */
+ public String errorCode(final String text) {
+ return error + "." + text + ".code";
+ }
+
+ /**
+ * Construct the errorMessage constant value.
+ *
+ * @return The errorMessage constant.
+ */
+ public String errorMessage() {
+ return error + ".message";
+ }
+
+ /**
+ * Construct the errorMessage Constant value with the given message text.
+ *
+ * @param text the message text to append to the constant.
+ *
+ * @return The errorMessage Constant for the given text.
+ */
+ public String errorMessage(final String text) {
+ return error + "." + text + ".message";
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return error;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base
new file mode 100644
index 000000000..146e4c39d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base
@@ -0,0 +1,619 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific Parameters.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSParameters {
+
+ /**
+ * Represents the 'apId' parameter constant.
+ */
+ AP_ID("apId"),
+ /**
+ * Represents the 'apUrl' parameter constant.
+ */
+ AP_URL("apUrl"),
+ /**
+ * Represents the 'ap.number' parameter constant.
+ */
+ AP_NUMBER("ap.number"),
+
+ /**
+ * Represents the 'assertionConsumerServiceURL' parameter constant.
+ */
+ ASSERTION_CONSUMER_S_URL("assertionConsumerServiceURL"),
+
+ /**
+ * Represents the 'auth' parameter constant.
+ */
+ AUTHENTICATION("auth"),
+
+ /**
+ * Represents the 'auth-on-behalf-of' parameter constant.
+ */
+ AUTHENTICATION_ON_BEHALF_OF("auth-on-behalf-of"),
+
+ /**
+ * Represents the 'attr' parameter constant.
+ */
+ ATTRIBUTE("attr"),
+ /**
+ * Represents the 'attrName' parameter constant.
+ */
+ ATTRIBUTE_NAME("attrName"),
+ /**
+ * Represents the 'attrStatus' parameter constant.
+ */
+ ATTRIBUTE_STATUS("attrStatus"),
+ /**
+ * Represents the 'attrType' parameter constant.
+ */
+ ATTRIBUTE_TYPE("attrType"),
+ /**
+ * Represents the 'attrValue' parameter constant.
+ */
+ ATTRIBUTE_VALUE("attrValue"),
+ /**
+ * Represents the 'attrList' parameter constant.
+ */
+ ATTRIBUTE_LIST("attrList"),
+ /**
+ * Represents the 'apMandAttrList' parameter constant.
+ */
+ AP_MANDATORY_ATTRIBUTE_LIST("apMandAttrList"),
+ /**
+ * Represents the 'attrTuple' parameter constant.
+ */
+ ATTRIBUTE_TUPLE("attrTuple"),
+ /**
+ * Represents the 'attribute-missing' parameter constant.
+ */
+ ATTRIBUTE_MISSING("attribute-missing"),
+ /**
+ * Represents the 'attributesNotAllowed' parameter constant.
+ */
+ ATTRIBUTES_NOT_ALLOWED("attributesNotAllowed"),
+ /**
+ * Represents the 'authnRequest' parameter constant.
+ */
+ AUTH_REQUEST("authnRequest"),
+
+ /**
+ * Represents the 'attrValue.number' parameter constant.
+ */
+ ATTR_VALUE_NUMBER("attrValue.number"),
+
+ /**
+ * Represents the 'derivation.date.format' parameter constant.
+ */
+ DERIVATION_DATE_FORMAT("derivation.date.format"),
+ /**
+ * Represents the 'deriveAttr.number' parameter constant.
+ */
+ DERIVE_ATTRIBUTE_NUMBER("deriveAttr.number"),
+
+ /**
+ * Represents the complex attributes parameter constant.
+ */
+ COMPLEX_ADDRESS_VALUE("canonicalResidenceAddress"),
+ COMPLEX_NEWATTRIBUTE_VALUE("newAttribute2"),
+ COMPLEX_HASDEGREE_VALUE("hasDegree"),
+ COMPLEX_MANDATECONTENT_VALUE("mandateContent"),
+ /**
+ * Represents the 'consent-type' parameter constant.
+ */
+ CONSENT_TYPE("consent-type"),
+ /**
+ * Represents the 'consent-value' parameter constant.
+ */
+ CONSENT_VALUE("consent-value"),
+ /**
+ * Represents the 'country' parameter constant.
+ */
+ COUNTRY("country"),
+ /**
+ * Represents the 'countryOrigin' parameter constant.
+ */
+ COUNTRY_ORIGIN("countryOrigin"),
+
+ /**
+ * Represents the 'cpepsURL' parameter constant.
+ */
+ CPEPS_URL("cpepsURL"),
+ /**
+ * Represents the 'callback' parameter constant.
+ */
+ CPEPS_CALLBACK("callback"),
+ /**
+ * Represents the 'peps.specificidpredirect.url' parameter constant.
+ */
+ CPEPS_IDP_CALLBACK_VALUE("peps.specificidpredirect.url"),
+ /**
+ * Represents the 'peps.specificapredirect.url' parameter constant.
+ */
+ CPEPS_AP_CALLBACK_VALUE("peps.specificapredirect.url"),
+
+ /**
+ * Represents the 'errorCode' parameter constant.
+ */
+ ERROR_CODE("errorCode"),
+ /**
+ * Represents the 'subCode' parameter constant.
+ */
+ ERROR_SUBCODE("subCode"),
+ /**
+ * Represents the 'errorMessage' parameter constant.
+ */
+ ERROR_MESSAGE("errorMessage"),
+ /**
+ * Represents the 'errorRedirectUrl' parameter constant.
+ */
+ ERROR_REDIRECT_URL("errorRedirectUrl"),
+
+ /**
+ * errorRedirectUrl Represents the 'external-authentication' parameter
+ * constant.
+ */
+ EXTERNAL_AUTH("external-authentication"),
+ /**
+ * Represents the 'external-ap' parameter constant.
+ */
+ EXTERNAL_AP("external-ap"),
+ /**
+ * Represents the 'external-pv' parameter constant.
+ */
+ EXTERNAL_PV("external-pv"),
+ /**
+ * Represents the 'external-sig-module' parameter constant.
+ */
+ EXT_SIG_CREATOR_MOD("external-sig-module"),
+
+ /**
+ * Represents the 'http-x-forwarded-for' parameter constant.
+ */
+ HTTP_X_FORWARDED_FOR("http-x-forwarded-for"),
+
+ /**
+ * Represents the 'idp.url' parameter constant.
+ */
+ IDP_URL("idp.url"),
+ /**
+ * Represents the 'idpAUB.url' parameter constant.
+ */
+ IDPAUB_URL("idpAUB.url"),
+ /**
+ * Represents the 'internal-authentication' parameter constant.
+ */
+ INTERNAL_AUTH("internal-authentication"),
+ /**
+ * Represents the 'internal-ap' parameter constant.
+ */
+ INTERNAL_AP("internal-ap"),
+ /**
+ * Represents the 'internal-pv' parameter constant.
+ */
+ INTERNAL_PV("internal-pv"),
+
+ /**
+ * Represents the 'samlIssuer' parameter constant.
+ */
+ ISSUER("samlIssuer"),
+ /**
+ * Represents the 'samlIssuer.idp' parameter constant.
+ */
+ ISSUER_IDP("samlIssuer.idp"),
+ /**
+ * Represents the 'samlIssuer.atp' parameter constant.
+ */
+ ISSUER_ATP("samlIssuer.atp"),
+
+ /**
+ * Represents the 'mandatory' parameter constant.
+ */
+ MANDATORY("mandatory"),
+ /**
+ * Represents the 'mandatoryAttributeMissing' parameter constant.
+ */
+ MANDATORY_ATTR_MISSING("mandatoryAttributeMissing"),
+ /**
+ * Represents the 'mandatoryConsentAttrMissing' parameter constant.
+ */
+ MANDATORY_CONSENT_MISSING("mandatoryConsentAttrMissing"),
+ /**
+ * Represents the 'missing-attrs' parameter constant.
+ */
+ MISSING_ATTRS("missing-attrs"),
+ /**
+ * Represents the 'no-more-attrs' parameter constant.
+ */
+ NO_MORE_ATTRS("no-more-attrs"),
+
+ /**
+ * Represents the 'optional' parameter constant.
+ */
+ OPTIONAL("optional"),
+
+ /**
+ * Represents the 'no-consent-type' parameter constant.
+ */
+ NO_CONSENT_TYPE("no-consent-type"),
+ /**
+ * Represents the 'no-consent-value' parameter constant.
+ */
+ NO_CONSENT_VALUE("no-consent-value"),
+
+ /**
+ * Represents the 'provider.name' parameter constant.
+ */
+ PROVIDER_NAME_VALUE("providerName"),
+ /**
+ * Represents the 'cpeps.askconsent' parameter constant.
+ */
+ PEPS_ASK_CONSENT("cpeps.askconsent"),
+ /**
+ * Represents the 'cpeps.askconsentvalue' parameter constant.
+ */
+ PEPS_ASK_CONSENT_VALUE("cpeps.askconsentvalue"),
+ /**
+ * Represents the 'pepsAuth' parameter constant.
+ */
+ PEPS_AUTH_CONSENT("pepsAuth"),
+ /**
+ * Represents the 'validation.bypass' parameter constant.
+ */
+ PEPS_BYPASS("validation.bypass"),
+ /**
+ * Represents the 'cpeps.number' parameter constant.
+ */
+ PEPS_NUMBER("cpeps.number"),
+ /**
+ * Represents the 'cpeps.specificapredirect.url' parameter constant.
+ */
+ PEPS_SPECIFIC_URL("cpeps.specificapredirect.url"),
+ /**
+ * Represents the 'pv.url' parameter constant.
+ */
+ PV_URL("pv.url"),
+
+ /**
+ * Represents the 'qaaLevel' parameter constant.
+ */
+ QAALEVEL("qaaLevel"),
+
+ /**
+ * Represents the 'speps.redirectUrl' parameter constant.
+ */
+ SPEPS_REDIRECT_URL("speps.redirectUrl"),
+
+ /**
+ * Represents the 'sp.redirectUrl' parameter constant.
+ */
+ SP_REDIRECT_URL("sp.redirectUrl"),
+ /**
+ * Represents the 'cpeps.redirectUrl' parameter constant.
+ */
+ CPEPS_REDIRECT_URL("cpeps.redirectUrl"),
+ /**
+ * Represents the 'RelayState' parameter constant.
+ */
+ RELAY_STATE("RelayState"),
+ /**
+ * Represents the 'remoteAddr' parameter constant.
+ */
+ REMOTE_ADDR("remoteAddr"),
+ /**
+ * Represents the 'remoteUser' parameter constant.
+ */
+ REMOTE_USER("remoteUser"),
+
+ /**
+ * Represents the 'SAMLRequest' parameter constant.
+ */
+ SAML_REQUEST("SAMLRequest"),
+ /**
+ * Represents the 'SAMLResponse' parameter constant.
+ */
+ SAML_RESPONSE("SAMLResponse"),
+ /**
+ * Represents the 'SAMLFail' parameter constant.
+ */
+ SAML_TOKEN_FAIL("SAMLFail"),
+ /**
+ * Represents the 'TokenId' parameter constant.
+ */
+ SAML_TOKEN_ID("TokenId"),
+ /**
+ * Represents the 'inResponseTo' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO("inResponseTo"),
+ /**
+ * Represents the 'inResponseTo.idp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_IDP("inResponseTo.idp"),
+ /**
+ * Represents the 'inResponseTo.atp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_ATP("inResponseTo.atp"),
+ /**
+ * Represents the 'SignatureResponse' parameter constant.
+ */
+ SIGNATURE_RESPONSE("SignatureResponse"),
+
+ /**
+ * Represents the 'cPepsSession' parameter constant.
+ */
+ SESSION_ID_URL("cPepsSession"),
+ /**
+ * Represents the 'spId' parameter constant.
+ */
+ SP_ID("spId"),
+ /**
+ * Represents the 'spQaaLevel' parameter constant.
+ */
+ SP_QAALEVEL("spQaaLevel"),
+ /**
+ * Represents the 'spUrl' parameter constant.
+ */
+ SP_URL("spUrl"),
+
+ /**
+ * Represents the 'allow.derivation.all' parameter constant.
+ */
+ SPECIFIC_ALLOW_DERIVATION_ALL("allow.derivation.all"),
+ /**
+ * Represents the ''allow.unknowns parameter constant.
+ */
+ SPECIFIC_ALLOW_UNKNOWNS("allow.unknowns"),
+ /**
+ * Represents the 'derivation.date.separator' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DATE_SEP("derivation.date.separator"),
+ /**
+ * Represents the 'derivation.month.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_MONTH_POS("derivation.month.position"),
+ /**
+ * Represents the 'derivation.day.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DAY_POS("derivation.day.position"),
+ /**
+ * Represents the 'derivation.year.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_YEAR_POS("derivation.year.position"),
+
+ /**
+ * sp.authorized.parameters Represents the '' parameter constant.
+ */
+ SPEPS_AUTHORIZED("sp.authorized.parameters"),
+
+ /**
+ * Represents the 'spSector' constant value.
+ */
+ SPSECTOR("spSector"),
+ /**
+ * Represents the 'spApplication' constant value.
+ */
+ SPAPPLICATION("spApplication"),
+ /**
+ * Represents the 'spCountry' constant value.
+ */
+ SPCOUNTRY("spCountry"),
+ /**
+ * Represents the 'spInstitution' constant value.
+ */
+ SPINSTITUTION("spInstitution"),
+ /**
+ * Represents the 'storkAttribute.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_NUMBER("storkAttribute.number"),
+ /**
+ * Represents the 'storkAttributeValue.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_VALUE_NUMBER("storkAttributeValue.number"),
+
+ /**
+ * Represents the 'username' parameter constant.
+ */
+ USERNAME("username"),
+
+ /**
+ * Represents the 'tooManyParameters' parameter constant.
+ */
+ TOO_MANY_PARAMETERS("tooManyParameters"),
+ /**
+ * Represents the 'validation.active' parameter constant.
+ */
+ VALIDATION_ACTIVE("validation.active"),
+
+ /**
+ * Represents the 'x-forwarded-for' parameter constant.
+ */
+ X_FORWARDED_FOR("x-forwarded-for"),
+ /**
+ * Represents the 'x-forwarded-host' parameter constant.
+ */
+ X_FORWARDED_HOST("x-forwarded-host"),
+ /**
+ * Represents the 'XMLResponse' parameter constant.
+ */
+ XML_RESPONSE("XMLResponse"),
+
+ /**
+ * Represents the 'ap-cpeps.number' parameter constant.
+ */
+ AP_PEPS_NUMBER("ap-cpeps.number"),
+
+ /**
+ * Represents the 'atp.number' parameter constant.
+ */
+ ATTRIBUTE_PROVIDER_NUMBER("atp.number"),
+
+ /**
+ * Represents the 'atn.number' parameter constant.
+ */
+ ATTRIBUTE_NAME_NUMBER("atn.number"),
+
+ /**
+ * Represents the 'apLinker' parameter constant.
+ */
+ AP_LINKER("apLinker"),
+
+ /**
+ * Represents the 'prevApLinker' parameter constant.
+ */
+ PREV_AP_LINKER("prevApLinker"),
+
+ /**
+ * Represents the 'NOSEL' parameter constant (no attribute provider selected).
+ */
+ AP_NO_SELECTION("NOSEL"),
+
+ /**
+ * Represents the 'OCSEL' parameter constant (attribute provider in another country).
+ */
+ AP_OTHER_COUNTRY("OCSEL"),
+
+ /**
+ * Represents the '_provider' suffix parameter constant.
+ */
+ AP_PROVIDER_SELECT_SUFFIX("_provider"),
+
+ /**
+ * Represents the '_country' suffix parameter constant.
+ */
+ AP_COUNTRY_SELECT_SUFFIX("_country"),
+
+ /**
+ * Represents the '_name' suffix parameter constant.
+ */
+ AP_NAME_SELECT_SUFFIX("_name"),
+
+ /**
+ * Represents the 'next-ap' parameter constant.
+ */
+ NEXT_AP("next-ap"),
+
+ /**
+ * Represents the 'next-apeps' parameter constant.
+ */
+ NEXT_APEPS("next-apeps"),
+
+ /**
+ * Represents the 'back-to-apeps' parameter constant.
+ */
+ BACK_TO_APEPS("back-to-apeps"),
+
+ /**
+ * Represents the 'is-remote-apeps' parameter constant.
+ */
+ IS_REMOTE_APEPS("is-remote-apeps"),
+
+ /**
+ * Represents the 'more-attributes' parameter constant.
+ */
+ MORE_ATTRIBUTES("more-attributes"),
+
+ /**
+ * Represents the 'attr-filter.number' parameter constant.
+ */
+ ATTRIBUTES_FILTER_NUMBER("attr-filter.number"),
+
+ /**
+ * Represents the 'atp.url' parameter constant.
+ */
+ ATP_URL("atp.url"),
+ /**
+ * Represents the 'apepsURL' parameter constant.
+ */
+ APEPS_URL("apepsUrl"),
+
+ /**
+ * Represents the 'apepsCountry' parameter constant.
+ */
+ APEPS_COUNTRY("apepsCountry"),
+
+ /**
+ * Represents the 'apepsAuthRequest' parameter constant.
+ */
+ APEPS_ATTR_REQUEST("apepsAttrRequest"),
+
+ /**
+ * Represents the 'isApepsRequest' parameter constant.
+ */
+ APEPS_REQUEST_COMPLETE("apeps-request-complete"),
+
+ /**
+ * Represents the 'apeps.callbackUrl' parameter constant.
+ */
+ APEPS_CALLBACK_URL("apeps.callbackUrl"),
+ /**
+ * Represents the 'attrListMand' parameter constant.
+ */
+ ATTR_LIST_MAND("attrListMand"),
+
+ /**
+ * Represents the 'attrListOpt' parameter constant.
+ */
+ ATTR_LIST_OPT("attrListOpt"),
+
+ /**
+ * Represents the 'simpleAttrListMand' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_MAND("simpleAttrListMand"),
+
+ /**
+ * Represents the 'simpleAttrListOpt' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_OPT("simpleAttrListOpt"),
+
+ /**
+ * Represents the 'complexAttrListMand' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_MAND("complexAttrListMand"),
+
+ /**
+ * Represents the 'complexAttrListOpt' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_OPT("complexAttrListOpt");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nValue The Constant value.
+ */
+ PEPSParameters(final String nValue) {
+ this.value = nValue;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base
new file mode 100644
index 000000000..a16b03edb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base
@@ -0,0 +1,353 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.crypto.Digest;
+import org.bouncycastle.util.encoders.Base64;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.75 $, $Date: 2010-11-23 00:05:35 $
+ */
+public final class PEPSUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PEPSUtil.class.getName());
+
+ /**
+ * Configurations object.
+ */
+ private static Properties configs;
+
+ /**
+ * Max prefix.
+ */
+ private static final String MAX_PARAM_PREFIX = "max.";
+
+ /**
+ * Code prefix to get error code.
+ */
+ private static final String CODE_PARAM_SUFFIX = ".code";
+
+ /**
+ * param's size prefix to get max param size.
+ */
+ private static final String MAX_PARAM_SUFFIX = ".size";
+
+ /**
+ * Message prefix to get error message.
+ */
+ private static final String MSG_PARAM_SUFFIX = ".message";
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private PEPSUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Creates a single instance of this class and sets the properties.
+ *
+ * @param nConfigs The set of available configurations.
+ *
+ * @return The created PEPSUtil's class.
+ */
+ public static PEPSUtil createInstance(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ return new PEPSUtil();
+ }
+
+ /**
+ * Getter for the Properties.
+ *
+ * @return configs The properties value.
+ */
+ public Properties getConfigs() {
+ return configs;
+ }
+
+ /**
+ * Setter for the Properties.
+ *
+ * @param nConfigs The new properties value.
+ */
+ public static void setConfigs(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ }
+
+ /**
+ * Returns the identifier of some configuration given a set of configurations
+ * and the corresponding configuration key.
+ *
+ * @param configKey The key that IDs some configuration.
+ *
+ * @return The configuration String value.
+ */
+ public static String getConfig(final String configKey) {
+ return configs.getProperty(configKey);
+ }
+
+ /**
+ * Validates the input paramValue identified by the paramName.
+ *
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ *
+ * @return true if the parameter is valid.
+ */
+ public static boolean isValidParameter(final String paramName,
+ final String paramValue) {
+
+ final String validationParam =
+ PEPSUtil.getConfig(PEPSParameters.VALIDATION_ACTIVE.toString());
+ boolean retVal = true;
+
+ final String paramConf = MAX_PARAM_PREFIX + paramName + MAX_PARAM_SUFFIX;
+
+ if (PEPSValues.TRUE.toString().equals(validationParam)) {
+ final String paramSizeStr = PEPSUtil.getConfig(paramConf);
+ // Checking if the parameter size exists and if it's numeric
+ if (StringUtils.isNumeric(paramSizeStr)) {
+ final int maxParamSize = Integer.valueOf(paramSizeStr);
+ if (StringUtils.isEmpty(paramValue)
+ || paramValue.length() > maxParamSize) {
+ retVal = false;
+ LOG.warn("Invalid parameter [" + paramName + "] value " + paramValue);
+ }
+ } else {
+ retVal = false;
+ LOG.error("Missing " + paramConf
+ + " configuration in the pepsUtils.properties configuration file");
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the Parameter and throws an exception if an error occurs. Throws
+ * an InvalidParameterPEPSException runtime exception if the parameter is
+ * invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final Object paramValue) {
+
+ if (paramValue == null) {
+ PEPSUtil.validateParameter(className, paramName, "");
+ } else {
+ PEPSUtil.validateParameter(className, paramName, paramValue.toString());
+ }
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getErrorCode(paramName), PEPSUtil.getErrorMessage(paramName));
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param error The PEPSError to get error code and messages from configs.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final PEPSErrors error) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getConfig(error.errorCode()),
+ PEPSUtil.getConfig(error.errorMessage()));
+ }
+
+ /**
+ * Validates the HTTP Parameter and throws an exception if an error occurs.
+ * Throws an InvalidParameterPEPSException runtime exception if the parameter
+ * is invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param errorCode The error code to include on the exception.
+ * @param errorMessage The error message to include on the exception.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final String errorCode,
+ final String errorMessage) {
+
+ if (!isValidParameter(paramName, paramValue)) {
+ LOG.warn("Invalid parameter [" + paramName + "] value found at "
+ + className);
+ throw new InvalidParameterPEPSException(errorCode, errorMessage);
+ }
+ }
+
+ /**
+ * Getter for the error code of some given error related to the input param.
+ *
+ * @param paramName The name of the parameter associated with the error.
+ *
+ * @return The code of the error.
+ */
+ private static String getErrorCode(final String paramName) {
+ return getConfig(paramName + CODE_PARAM_SUFFIX);
+ }
+
+ /**
+ * Getter for the error message of some given error related to the input
+ * parameter.
+ *
+ * @param paramName The name of the parameter associated with the message.
+ *
+ * @return The message for the error.
+ */
+ private static String getErrorMessage(final String paramName) {
+ return getConfig(paramName + MSG_PARAM_SUFFIX);
+ }
+
+ /**
+ * {@link Base64} encodes the input samlToken parameter.
+ *
+ * @param samlToken the SAML Token to be encoded.
+ *
+ * @return The Base64 String representing the samlToken.
+ *
+ * @see Base64#encode
+ */
+ public static String encodeSAMLToken(final byte[] samlToken) {
+ try {
+ return new String(Base64.encode(samlToken), "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Decodes the {@link Base64} String input parameter representing a samlToken.
+ *
+ * @param samlToken the SAML Token to be decoded.
+ *
+ * @return The samlToken decoded bytes.
+ *
+ * @see Base64#decode
+ */
+ public static byte[] decodeSAMLToken(final String samlToken) {
+ return Base64.decode(samlToken);
+ }
+
+ /**
+ * Hashes a SAML token. Throws an InternalErrorPEPSException runtime exception
+ * if the Cryptographic Engine fails.
+ *
+ * @param samlToken the SAML Token to be hashed.
+ *
+ * @return byte[] with the hashed SAML Token.
+ */
+ public static byte[] hashPersonalToken(final byte[] samlToken) {
+ try {
+ final String className =
+ PEPSUtil.getConfig(PEPSValues.HASH_DIGEST_CLASS.toString());
+
+ final Digest digest =
+ (Digest) Class.forName(className).getConstructor()
+ .newInstance((Object[]) null);
+ digest.update(samlToken, 0, samlToken.length);
+
+ final int retLength = digest.getDigestSize();
+ final byte[] ret = new byte[retLength];
+
+ digest.doFinal(ret, 0);
+ return ret;
+
+ } catch (final Exception e) {
+ // For all those exceptions that could be thrown, we always log it and
+ // thrown an InternalErrorPEPSException.
+ LOG.error(PEPSErrors.HASH_ERROR.errorMessage(), e);
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Gets the Stork error code in the error message if exists!
+ *
+ * @param errorMessage The message to get the error code if exists;
+ *
+ * @return the error code if exists. Returns null otherwise.
+ */
+ public static String getStorkErrorCode(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the Stork error message in the saml message if exists!
+ *
+ * @param errorMessage The message to get in the saml message if exists;
+ *
+ * @return the error message if exists. Returns the original message
+ * otherwise.
+ */
+ public static String getStorkErrorMessage(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[1];
+ }
+ }
+ return errorMessage;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base
new file mode 100644
index 000000000..e14c21cb5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base
@@ -0,0 +1,329 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the value constants.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.17 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSValues {
+
+ /**
+ * Represents the 'all' constant value.
+ */
+ ALL("all"),
+ /**
+ * Represents the 'none' constant value.
+ */
+ NONE("none"),
+ /**
+ * Represents the 'true' constant value.
+ */
+ TRUE("true"),
+ /**
+ * Represents the 'false' constant value.
+ */
+ FALSE("false"),
+ /**
+ * Represents the empty string constant value.
+ */
+ EMPTY_STRING(""),
+
+ /**
+ * Represents the ',' separator constant value.
+ */
+ ATTRIBUTE_VALUE_SEP(","),
+ /**
+ * Represents the ';' separator constant value.
+ */
+ ATTRIBUTE_SEP(";"),
+ /**
+ * Represents the ':' separator constant value.
+ */
+ ATTRIBUTE_TUPLE_SEP(":"),
+ /**
+ * Represents the '/' separator constant value.
+ */
+ EID_SEPARATOR("/"),
+ /**
+ * Represents the ' - ' separator constant value.
+ */
+ ERROR_MESSAGE_SEP(" - "),
+ /**
+ * Represents the '#' parameter constant value.
+ */
+ LOGGER_SEP("#"),
+ /**
+ * Represents the 'NOT_AVAILABLE' parameter constant value.
+ */
+ NOT_AVAILABLE("NotAvailable"),
+ /**
+ * Represents the ';' parameter constant value.
+ */
+ SPEPS_AUTHORIZED_SEP(";"),
+
+ /**
+ * Represents the 'ap' constant value.
+ */
+ AP("ap"),
+ /**
+ * Represents the 'C-PEPS' constant value.
+ */
+ CPEPS("C-PEPS"),
+ /**
+ * Represents the 'cpeps' constant value.
+ */
+ CPEPS_PREFIX("cpeps"),
+ /**
+ * Represents the 'peps' constant value.
+ */
+ PEPS("peps"),
+ /**
+ * Represents the '-PEPS' constant value.
+ */
+ PEPS_SUFFIX("-PEPS"),
+ /**
+ * Represents the 'SP' constant value.
+ */
+ SP("SP"),
+ /**
+ * Represents the 'S-PEPS' constant value.
+ */
+ SPEPS("S-PEPS"),
+ /**
+ * Represents the 'speps' constant value.
+ */
+ SPEPS_PREFIX("speps"),
+ /**
+ * Represents the 'sp.default.parameters' constant value.
+ */
+ DEFAULT("sp.default.parameters"),
+ /**
+ * Represents the default saml id constant value.
+ */
+ DEFAULT_SAML_ID("1"),
+ /**
+ * Represents the 'hashDigest.className' constant value.
+ */
+ HASH_DIGEST_CLASS("hashDigest.className"),
+
+ /**
+ * Represents the 'eu.stork.communication.requests' constant value.
+ */
+ STORK_PACKAGE_REQUEST_LOGGER_VALUE("eu.stork.communication.requests"),
+ /**
+ * Represents the 'eu.stork.communication.responses' constant value.
+ */
+ STORK_PACKAGE_RESPONSE_LOGGER_VALUE("eu.stork.communication.responses"),
+
+ /**
+ * Represents the 'S-PEPS receives request from SP' constant value.
+ */
+ SP_REQUEST("S-PEPS receives request from SP"),
+ /**
+ * Represents the 'Get Citizen Consent' constant value.
+ */
+ CITIZEN_CONSENT_LOG("Get Citizen Consent"),
+ /**
+ * Represents the 'C-PEPS receives request from S-PEPS' constant value.
+ */
+ CPEPS_REQUEST("C-PEPS receives request from S-PEPS"),
+ /**
+ * Represents the 'C-PEPS generates response to S-PEPS' constant value.
+ */
+ CPEPS_RESPONSE("C-PEPS generates response to S-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates request to C-PEPS' constant value.
+ */
+ SPEPS_REQUEST("S-PEPS generates request to C-PEPS"),
+ /**
+ * Represents the 'S-PEPS receives response from C-PEPS' constant value.
+ */
+ SPEPS_RESPONSE("S-PEPS receives response from C-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates response to SP' constant value.
+ */
+ SP_RESPONSE("S-PEPS generates response to SP"),
+ /**
+ * Represents the 'Success' constant value.
+ */
+ SUCCESS("Success"),
+ /**
+ * Represents the December's month number constant value.
+ */
+ LAST_MONTH("12"),
+ /**
+ * Represents the yyyyMM constant value.
+ */
+ NO_DAY_DATE_FORMAT("yyyyMM"),
+
+ /**
+ * Represents the 'attrValue' constant value.
+ */
+ ATTRIBUTE("attrValue"),
+ /**
+ * Represents the 'derivedAttr' constant value.
+ */
+ DERIVE_ATTRIBUTE("deriveAttr"),
+ /**
+ * Represents the 'storkAttribute' constant value.
+ */
+ STORK_ATTRIBUTE("storkAttribute"),
+
+ /**
+ * Represents the 'properties' constant value.
+ */
+ PROPERTIES("properties"),
+ /**
+ * Represents the 'referer' constant value.
+ */
+ REFERER("referer"),
+ /**
+ * Represents the 'host' constant value.
+ */
+ HOST("host"),
+ /**
+ * Represents the 'spid' constant value.
+ */
+ SPID("spid"),
+ /**
+ * Represents the 'domain' constant value.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the '.validation' constant value.
+ */
+ VALIDATION_SUFFIX(".validation"),
+ /**
+ * Represents the 'jsessionid' constant value.
+ */
+ EQUAL("="),
+ /**
+ * Represents the 'HttpOnly' constant value.
+ */
+ HTTP_ONLY("HttpOnly"),
+ /**
+ * Represents the 'SET-COOKIE' constant value.
+ */
+ JSSESSION("JSESSIONID"),
+ /**
+ * Represents the '=' constant value.
+ */
+ SETCOOKIE("SET-COOKIE"),
+ /**
+ * Represents the ';' constant value.
+ */
+ SEMICOLON(";"),
+ /**
+ * Represents the ' ' constant value.
+ */
+ SPACE(" "),
+ /**
+ * Represents the 'atp' constant value.
+ */
+ APROVIDER_PREFIX("atp"),
+ /**
+ * Represents the 'atn' constant value.
+ */
+ ANAME_PREFIX("atn"),
+ /**
+ * Represents the 'ap-cpeps' constant value.
+ */
+ AP_CPEPS_PREFIX("ap-cpeps"),
+ /**
+ * Represents the 'attr-filter' constant value.
+ */
+ AP_ATTRFILTER_PREFIX("attr-filter");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ PEPSValues(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".id".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String index(final int index) {
+
+ return value + index + ".id";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".value".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated string value.
+ */
+ public String value(final int index) {
+
+ return value + index + ".value";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".name".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String name(final int index) {
+
+ return value + index + ".name";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".url".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String url(final int index) {
+
+ return value + index + ".url";
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base
new file mode 100644
index 000000000..5d8281445
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base
@@ -0,0 +1,348 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.log4j.Logger;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttribute.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.22 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class PersonalAttribute implements Serializable, Cloneable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2612951678412632174L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PersonalAttribute.class
+ .getName());
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String name;
+
+ /**
+ * Values of the personal attribute.
+ */
+ private List<String> value = new ArrayList<String>();
+
+ /**
+ * Type of the personal attribute.
+ */
+ private String type;
+
+ /**
+ * Complex values of the personal attribute.
+ */
+ private Map<String, String> complexValue = new ConcurrentHashMap<String, String>();
+
+ /**
+ * Is the personal attribute mandatory?
+ */
+ private transient boolean required;
+
+ /**
+ * Returned status of the attribute from the IdP.
+ */
+ private String status;
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String friendlyName;
+
+ /**
+ * Empty Constructor.
+ */
+ public PersonalAttribute() {
+ super();
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final List<String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's complex value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final Map<String, String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setComplexValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public Object clone() {
+
+ try {
+ final PersonalAttribute personalAttr = (PersonalAttribute) super.clone();
+ personalAttr.setIsRequired(this.isRequired());
+ personalAttr.setName(this.getName());
+ personalAttr.setStatus(this.getStatus());
+ if (!isEmptyValue()) {
+ final List<String> val =
+ (List<String>) ((ArrayList<String>) this.getValue()).clone();
+ personalAttr.setValue(val);
+ }
+ if (!isEmptyComplexValue()) {
+ final Map<String, String> complexVal =
+ (Map<String, String>) ((HashMap<String, String>) this
+ .getComplexValue()).clone();
+ personalAttr.setComplexValue(complexVal);
+ }
+ return personalAttr;
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("Nothing to do.");
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Getter for the required value.
+ *
+ * @return The required value.
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * Setter for the required value.
+ *
+ * @param attrIsRequired this attribute?
+ */
+ public void setIsRequired(final boolean attrIsRequired) {
+ this.required = attrIsRequired;
+ }
+
+ /**
+ * Getter for the name value.
+ *
+ * @return The name value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for the name value.
+ *
+ * @param attrName The personal attribute name.
+ */
+ public void setName(final String attrName) {
+ this.name = attrName;
+ }
+
+ /**
+ * Getter for the value.
+ *
+ * @return The list of values.
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Setter for the list of values.
+ *
+ * @param attrValue The personal attribute value.
+ */
+ public void setValue(final List<String> attrValue) {
+ if (attrValue != null) {
+ this.value = attrValue;
+ }
+ }
+
+
+ /**
+ * Getter for the type value.
+ *
+ * @return The name value.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Setter for the type value.
+ *
+ * @param attrName The personal attribute type.
+ */
+ public void setType(final String attrType) {
+ this.type = attrType;
+ }
+
+ /**
+ * Getter for the status.
+ *
+ * @return The status value.
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for the status value.
+ *
+ * @param attrStatus The personal attribute status.
+ */
+ public void setStatus(final String attrStatus) {
+ this.status = attrStatus;
+ }
+
+ /**
+ * Getter for the complex value.
+ *
+ * @return The complex value.
+ */
+ public Map<String, String> getComplexValue() {
+ return complexValue;
+ }
+
+ /**
+ * Setter for the complex value.
+ *
+ * @param complexVal The personal attribute Complex value.
+ */
+ public void setComplexValue(final Map<String, String> complexVal) {
+ if (complexVal != null) {
+ this.complexValue = complexVal;
+ }
+ }
+
+ /**
+ * Getter for the personal's friendly name.
+ *
+ * @return The personal's friendly name value.
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Setter for the personal's friendly name.
+ *
+ * @param fName The personal's friendly name.
+ */
+ public void setFriendlyName(final String fName) {
+ this.friendlyName = fName;
+ }
+
+ /**
+ * Return true the value is empty.
+ *
+ * @return True if the value is empty "[]";
+ */
+ public boolean isEmptyValue() {
+ return value.isEmpty() || (value.size() == 1 && value.get(0).length() == 0);
+ }
+
+ /**
+ * Returns true if the Complex Value is empty.
+ *
+ * @return True if the Complex Value is empty;
+ */
+ public boolean isEmptyComplexValue() {
+ return complexValue.isEmpty();
+ }
+
+ /**
+ * Returns true if the Status is empty.
+ *
+ * @return True if the Status is empty;
+ */
+ public boolean isEmptyStatus() {
+ return (status == null || status.length() == 0);
+ }
+
+ /**
+ * Prints the PersonalAttribute in the following format.
+ * name:required:[v,a,l,u,e,s]|[v=a,l=u,e=s]:status;
+ *
+ * @return The PersonalAttribute as a string.
+ */
+ public String toString() {
+ final StringBuilder strBuild = new StringBuilder();
+
+ AttributeUtil.appendIfNotNull(strBuild, getName());
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, String.valueOf(isRequired()));
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ strBuild.append('[');
+
+ if (isEmptyValue()) {
+ if (!isEmptyComplexValue()) {
+ AttributeUtil.appendIfNotNull(strBuild, AttributeUtil.mapToString(
+ getComplexValue(), PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+ } else {
+ AttributeUtil.appendIfNotNull(
+ strBuild,
+ AttributeUtil.listToString(getValue(),
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+
+ strBuild.append(']');
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, getStatus());
+ strBuild.append(PEPSValues.ATTRIBUTE_SEP.toString());
+
+ return strBuild.toString();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base
new file mode 100644
index 000000000..642b249d4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base
@@ -0,0 +1,396 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.StringTokenizer;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttributeList.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.27 $, $Date: 2010-11-18 22:54:56 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD")
+public final class PersonalAttributeList extends
+ ConcurrentHashMap<String, PersonalAttribute> implements IPersonalAttributeList{
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger
+ .getLogger(PersonalAttributeList.class.getName());
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = 7375127363889975062L;
+
+ /**
+ * Hash with the latest fetched attribute name alias.
+ */
+ private final transient Map<String, Integer> latestAttrAlias =
+ new HashMap<String, Integer>();
+
+ /**
+ * Hash with mapping number of alias or the attribute name.
+ */
+ private final transient Map<String, Integer> attrAliasNumber =
+ new HashMap<String, Integer>();
+
+ /**
+ * Default constructor.
+ */
+ public PersonalAttributeList() {
+ // The best practices recommend to call the super constructor.
+ super();
+ }
+
+ /**
+ * Constructor with initial capacity for the PersonalAttributeList size.
+ *
+ * @param capacity The initial capacity for the PersonalAttributeList.
+ */
+ public PersonalAttributeList(final int capacity) {
+ super(capacity);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Iterator<PersonalAttribute> iterator() {
+ return this.values().iterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute get(final Object key) {
+ String attrName = (String) key;
+
+ if (this.latestAttrAlias.containsKey(key)) {
+ attrName = attrName + this.latestAttrAlias.get(key);
+ } else {
+ if (this.attrAliasNumber.containsKey(key)) {
+ this.latestAttrAlias.put(attrName, this.attrAliasNumber.get(key));
+ }
+ }
+ return super.get(attrName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(final PersonalAttribute value) {
+ if (value != null) {
+ this.put(value.getName(), value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute put(final String key, final PersonalAttribute val) {
+ if (StringUtils.isNotEmpty(key) && val != null) {
+ // Validate if attribute name already exists!
+ String attrAlias = key;
+ if (this.containsKey(attrAlias)) {
+ //TODO isAgeOver should not be hardcoded, a better way of handling multipe isAgeOver requests should be implemented.
+ if (!val.isEmptyValue() && StringUtils.isNumeric(val.getValue().get(0)) && "isAgeOver".equals( val.getName() ) ) {
+ final String attrValue = val.getValue().get(0);
+ attrAlias = key + attrValue;
+ this.attrAliasNumber.put(key, Integer.valueOf(attrValue));
+ } else {
+ final PersonalAttribute attr = super.get(key);
+ if (!attr.isEmptyValue()
+ && StringUtils.isNumeric(attr.getValue().get(0))) {
+ attrAlias = key + attr.getValue().get(0);
+ super.put(key, (PersonalAttribute) attr);
+ this.attrAliasNumber.put(key, null);
+ }
+ }
+ }
+ return super.put(attrAlias, val);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void populate(final String attrList) {
+ final StringTokenizer strToken =
+ new StringTokenizer(attrList, PEPSValues.ATTRIBUTE_SEP.toString());
+
+ while (strToken.hasMoreTokens()) {
+ final PersonalAttribute persAttr = new PersonalAttribute();
+ String[] tuples =
+ strToken.nextToken().split(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString(),
+ AttributeConstants.NUMBER_TUPLES.intValue());
+
+ // Convert to the new format if needed!
+ tuples = convertFormat(tuples);
+
+ if (AttributeUtil.hasValidTuples(tuples)) {
+ final int attrValueIndex =
+ AttributeConstants.ATTR_VALUE_INDEX.intValue();
+ final String tmpAttrValue =
+ tuples[attrValueIndex].substring(1,
+ tuples[attrValueIndex].length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ persAttr.setName(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()]);
+ persAttr.setIsRequired(Boolean
+ .valueOf(tuples[AttributeConstants.ATTR_TYPE_INDEX.intValue()]));
+
+ // check if it is a complex value
+ if (isComplexValue(vals)) {
+ persAttr.setComplexValue(createComplexValue(vals));
+ }
+ else
+ {
+ persAttr.setValue(createValues(vals));
+ }
+
+ if (tuples.length == AttributeConstants.NUMBER_TUPLES.intValue()) {
+ persAttr.setStatus(tuples[AttributeConstants.ATTR_STATUS_INDEX
+ .intValue()]);
+ }
+ this.put(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()],
+ persAttr);
+
+ } else {
+ LOG.warn("Invalid personal attribute list tuples");
+ }
+
+ }
+ }
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ public Object clone() {
+ try {
+ return (PersonalAttributeList) super.clone();
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Creates a string in the following format.
+ *
+ * attrName:attrType:[attrValue1,attrValue2=attrComplexValue]:attrStatus;
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ final Iterator<Entry<String, PersonalAttribute>> itAttrs =
+ this.entrySet().iterator();
+ final StringBuilder strBuilder = new StringBuilder();
+
+ while (itAttrs.hasNext()) {
+ final Entry<String, PersonalAttribute> attrEntry = itAttrs.next();
+ final PersonalAttribute attr = attrEntry.getValue();
+ //strBuilder.append(attr.toString());
+ strBuilder.insert(0, attr.toString());
+ }
+
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates and creates the attribute's complex values.
+ *
+ * @param values The complex values.
+ *
+ * @return The {@link Map} with the complex values.
+ *
+ * @see Map
+ */
+ private Map<String, String> createComplexValue(final String[] values) {
+ final Map<String, String> complexValue = new HashMap<String, String>();
+ for (final String val : values) {
+ final String[] tVal = val.split("=");
+ if (StringUtils.isNotEmpty(val) && tVal.length == 2) {
+ complexValue.put(tVal[0], AttributeUtil.unescape(tVal[1]));
+ }
+ }
+ return complexValue;
+ }
+
+ /**
+ * Checks if value is complex or not
+ * @param values The values to check
+ * @return True if succesful
+ */
+ private boolean isComplexValue(final String[] values) {
+ boolean isComplex = false;
+ if (values.length > 0) {
+ final String[] tVal = values[0].split("=");
+ if (StringUtils.isNotEmpty(values[0]) && tVal.length == 2) {
+ isComplex = true;
+ }
+ }
+ return isComplex;
+ }
+
+ /**
+ * Validates and creates the attribute values.
+ *
+ * @param vals The attribute values.
+ *
+ * @return The {@link List} with the attribute values.
+ *
+ * @see List
+ */
+ private List<String> createValues(final String[] vals) {
+ final List<String> values = new ArrayList<String>();
+ for (final String val : vals) {
+ if (StringUtils.isNotEmpty(val)) {
+ values.add(AttributeUtil.unescape(val));
+ }
+ }
+ return values;
+ }
+
+ /**
+ * Converts the attribute tuple (attrName:attrType...) to the new format.
+ *
+ * @param tuples The attribute tuples to convert.
+ *
+ * @return The attribute tuples in the new format.
+ */
+ private String[] convertFormat(final String[] tuples) {
+ final String[] newFormatTuples =
+ new String[AttributeConstants.NUMBER_TUPLES.intValue()];
+ if (tuples != null) {
+ System.arraycopy(tuples, 0, newFormatTuples, 0, tuples.length);
+
+ for (int i = tuples.length; i < newFormatTuples.length; i++) {
+ if (i == AttributeConstants.ATTR_VALUE_INDEX.intValue()) {
+ newFormatTuples[i] = "[]";
+ } else {
+ newFormatTuples[i] = "";
+ }
+ }
+ }
+ return newFormatTuples;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the complex attributes contained in this map.
+ */
+ public IPersonalAttributeList getComplexAttributes() {
+ LOG.info("get complex attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(!attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding complex attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getSimpleValueAttributes() {
+ LOG.info("get simple attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding simple attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getMandatoryAttributes() {
+ return getAttributesByParam(true);
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the attributes in this map by parameter value.
+ *
+ * @param compareValue The boolean to get mandatory (true) or optional (false) attributes.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map if compareValue is true or optional otherwise.
+ */
+ private IPersonalAttributeList getAttributesByParam(final boolean compareValue) {
+ LOG.info("get attributes by param :"+compareValue);
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.isRequired() == compareValue) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ public IPersonalAttributeList getOptionalAttributes() {
+ return getAttributesByParam(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasMissingValues() {
+ for(PersonalAttribute attr: this) {
+ if(attr.isEmptyValue() && attr.isEmptyComplexValue()) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base
new file mode 100644
index 000000000..07f178ecc
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base
@@ -0,0 +1,447 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+public class STORKAttrQueryRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAttrQueryRequest</tt> instance.
+ *
+ * @return The copy of this STORKAttrQueryRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAttrQueryRequest storkAttrQueryReq = null;
+ storkAttrQueryReq = (STORKAttrQueryRequest) super.clone();
+ storkAttrQueryReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAttrQueryReq.setTokenSaml(getTokenSaml());
+ return storkAttrQueryReq;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base
new file mode 100644
index 000000000..046dec311
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base
@@ -0,0 +1,388 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+public class STORKAttrQueryResponse {
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Request failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** The complete assertion **/
+ private Assertion assertion;
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /** Citizen's personal attribute list. */
+ private transient IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ /** Get the assertion from the response **/
+ public Assertion getAssertion() {
+ return assertion;
+ }
+
+ /** Set the assertion in the response **/
+ public void setAssertion(final Assertion nAssertion) {
+ this.assertion = nAssertion;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base
new file mode 100644
index 000000000..2354d0eb1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base
@@ -0,0 +1,495 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnRequest (SAML Token Request).
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.21 $, $Date: 2011-02-17 22:44:34 $
+ */
+public final class STORKAuthnRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The destination. */
+ private String destination;
+
+ /** The provider name. */
+ private String providerName;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The provider name value.
+ */
+ public String getProviderName() {
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param samlProvider the provider name value.
+ */
+ public void setProviderName(final String samlProvider) {
+ this.providerName = samlProvider;
+ }
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAuthnRequest</tt> instance.
+ *
+ * @return The copy of this STORKAuthnRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAuthnRequest storkAuthnReq = null;
+ try {
+ storkAuthnReq = (STORKAuthnRequest) super.clone();
+ storkAuthnReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAuthnReq.setTokenSaml(getTokenSaml());
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+
+ return storkAuthnReq;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base
new file mode 100644
index 000000000..84fadd023
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base
@@ -0,0 +1,383 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnResponse.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class STORKAuthnResponse {
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Authentication failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** Citizen's personal attribute list. */
+ private transient IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base
new file mode 100644
index 000000000..a02002d93
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base
@@ -0,0 +1,197 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutRequest implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** The ID of principal as known to SP **/
+ private String spProvidedId;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /** Getter for spProvidedId **/
+ public String getSpProvidedId() {
+ return spProvidedId;
+ }
+
+ public void setSpProvidedId(final String nSpProvidedId) {
+ this.spProvidedId = nSpProvidedId;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutRequest storkLogoutRequest = null;
+ storkLogoutRequest = (STORKLogoutRequest) super.clone();
+ storkLogoutRequest.setTokenSaml(getTokenSaml());
+ return storkLogoutRequest;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base
new file mode 100644
index 000000000..2686727db
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base
@@ -0,0 +1,250 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutResponse implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Status message. */
+ private String statusMessage;
+
+ /** Logout failed? */
+ private boolean fail;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Setter for the statusMessage value.
+ *
+ * @param status the new statusMessage value.
+ */
+ public void setStatusMessage(final String status) {
+ this.statusMessage = status;
+ }
+
+ /**
+ * Getter for the statusMessage value.
+ *
+ * @return The statusMessage value.
+ */
+ public String getStatusMessage() {
+ return statusMessage;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutResponse storkLogoutResponse = null;
+ storkLogoutResponse = (STORKLogoutResponse) super.clone();
+ storkLogoutResponse.setTokenSaml(getTokenSaml());
+ return storkLogoutResponse;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base
new file mode 100644
index 000000000..a9c4a156b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base
@@ -0,0 +1,68 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKStatusCode {
+
+ /** URI for Requester status code. */
+ REQUESTER_URI("urn:oasis:names:tc:SAML:2.0:status:Requester"),
+
+ /** URI for Responder status code. */
+ RESPONDER_URI("urn:oasis:names:tc:SAML:2.0:status:Responder"),
+
+ /** URI for Success status code. */
+ SUCCESS_URI("urn:oasis:names:tc:SAML:2.0:status:Success"),
+
+ /** Attribute is Available. */
+ STATUS_AVAILABLE("Available"),
+
+ /** Attribute is NotAvailable. */
+ STATUS_NOT_AVAILABLE("NotAvailable"),
+
+ /** Attribute is Withheld. */
+ STATUS_WITHHELD("Withheld");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base
new file mode 100644
index 000000000..0a711c9b7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base
@@ -0,0 +1,71 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Sub Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.7 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKSubStatusCode {
+
+ /** URI for AuthnFailed status code. */
+ AUTHN_FAILED_URI("urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"),
+
+ /** URI for InvalidAttrNameOrValue status code. */
+ INVALID_ATTR_NAME_VALUE_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"),
+
+ /** URI for InvalidNameIDPolicy status code. */
+ INVALID_NAMEID_POLICY_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"),
+
+ /** URI for VersionMismatch status code. */
+ VERSION_MISMATCH_URI("urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"),
+
+ /** URI for RequestDenied status code. */
+ REQUEST_DENIED_URI("urn:oasis:names:tc:SAML:2.0:status:RequestDenied"),
+
+ /** URI for QaaNotSupported status code. */
+ QAA_NOT_SUPPORTED(
+ "http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKSubStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..58ee7bcac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,9 @@
+/**
+ * Common Authentication Service functionalities to be deployed in every PEPS
+ * is contained in this package.
+ * In particular, it contains the SAML Engine that implements the SAML messages
+ * management
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons;
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
new file mode 100644
index 000000000..09769641c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
@@ -0,0 +1,72 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum AttributeConstants {
+
+ /**
+ * Represents the attribute's name index.
+ */
+ ATTR_NAME_INDEX(0),
+ /**
+ * Represents the attribute's type index.
+ */
+ ATTR_TYPE_INDEX(1),
+ /**
+ * Represents the attribute's value index.
+ */
+ ATTR_VALUE_INDEX(2),
+ /**
+ * Represents the attribute's status index.
+ */
+ ATTR_STATUS_INDEX(3),
+ /**
+ * Represents the number of allowed tuples.
+ */
+ NUMBER_TUPLES(4);
+
+ /**
+ * Represents the constant's value.
+ */
+ private int attribute;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param attr The Attribute Constant value.
+ */
+ AttributeConstants(final int attr) {
+
+ this.attribute = attr;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public int intValue() {
+
+ return attribute;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
new file mode 100644
index 000000000..32352f563
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
@@ -0,0 +1,74 @@
+package eu.stork.peps.auth.commons;
+
+/**
+ * This class is a bean used to store information relative to Attribute Names.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-11-26 $
+ */
+public final class AttributeName {
+
+ /**
+ * Attribute Id.
+ */
+ private String attributeId;
+
+ /**
+ * Attribute Name.
+ */
+ private String attributeName;
+
+ /**
+ * Attribute Name Constructor.
+ *
+ * @param aId Id of the Attribute Name.
+ * @param aName Name of the Attribute Name.
+ */
+ public AttributeName(final String aId, final String aName) {
+
+ this.attributeId = aId;
+ this.attributeName = aName;
+ }
+
+ /**
+ * Getter for the attributeId value.
+ *
+ * @return The attributeId value.
+ */
+ public String getAttributeId() {
+
+ return attributeId;
+ }
+
+ /**
+ * Setter for the attributeId value.
+ *
+ * @param aId Id of the Attribute Name.
+ */
+ public void setAttributeId(final String aId) {
+
+ this.attributeId = aId;
+ }
+
+ /**
+ * Getter for the attributeName value.
+ *
+ * @return The attributeName value.
+ */
+ public String getAttributeName() {
+
+ return attributeName;
+ }
+
+ /**
+ * Setter for the attributeName value.
+ *
+ * @param name Name of the Attribute Name.
+ */
+ public void setAttributeName(final String name) {
+
+ this.attributeName = name;
+ }
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
new file mode 100644
index 000000000..5fb04e331
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
@@ -0,0 +1,80 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Provider.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-11-28 $
+ */
+public final class AttributeProvider implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7210186241917444559L;
+
+ /**
+ * Provider Id.
+ */
+ private String providerId;
+
+ /**
+ * Provider Name.
+ */
+ private String providerName;
+
+ /**
+ * Attribute Provider Constructor.
+ *
+ * @param pId Id of the Attribute Provider.
+ * @param pName Name of the Attribute Provider.
+ */
+ public AttributeProvider(final String pId, final String pName) {
+
+ this.providerId = pId;
+ this.providerName = pName;
+ }
+
+ /**
+ * Getter for the providerId value.
+ *
+ * @return The providerId value.
+ */
+ public String getProviderId() {
+
+ return providerId;
+ }
+
+ /**
+ * Setter for the providerId value.
+ *
+ * @param pId Id of the Attribute Provider.
+ */
+ public void setProviderId(final String pId) {
+
+ this.providerId = pId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The providerName value.
+ */
+ public String getProviderName() {
+
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param name Name of the Attribute Provider.
+ */
+ public void setProviderName(final String name) {
+
+ this.providerName = name;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
new file mode 100644
index 000000000..3059caaa3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
@@ -0,0 +1,96 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of the AttributeProviderMap using a LinkedHashMap.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-09-20 $
+ *
+ * @see LinkedHashMap
+ */
+public class AttributeProvidersMap extends LinkedHashMap<AttributeSource, IPersonalAttributeList>
+ implements IAttributeProvidersMap {
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeProvidersMap.class.getName());
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8949081185106296122L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList get(final AttributeSource key) {
+ return this.get((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList remove(final AttributeSource key) {
+ return this.remove((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean containsKey(final AttributeSource key) {
+ return this.containsKey((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<AttributeSource> keyIterator() {
+ return this.keySet().iterator();
+ }
+
+ public void trace() {
+ Iterator<AttributeSource> iterator;
+ Iterator<PersonalAttribute> iterator2;
+ AttributeSource source;
+ IPersonalAttributeList pal;
+ PersonalAttribute pa;
+
+ iterator = this.keyIterator();
+ LOG.trace("Start dumping of AttributeProvidersMap\n=======================");
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ LOG.trace("Source details: type [" + source.getSourceType() + "], URL [" + source.getProviderURL() + "]");
+
+ if(source.getSourceType() == AttributeSource.SOURCE_LOCAL_APROVIDER) {
+ LOG.trace("-> Attribute Provider: ID [" + source.getProvider().getProviderId() + "], name [" + source.getProvider().getProviderName() + "]");
+ }
+ else {
+ LOG.trace("-> Country: ID [" + source.getCountry().getCountryId() + "], name [" + source.getCountry().getCountryName() + "]");
+ }
+
+ pal = this.get(source);
+ LOG.trace("++++++++=>");
+ iterator2 = pal.iterator();
+ while (iterator2.hasNext()) {
+ pa = iterator2.next();
+
+ LOG.trace("-> Citizen Attribute: name [" + pa.getName() + "], required [" + pa.isRequired() + "]");
+ }
+ LOG.trace("<=++++++++");
+
+ LOG.trace("-----------------------");
+ }
+ LOG.trace("END\n=======================");
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
new file mode 100644
index 000000000..e1ae0049d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
@@ -0,0 +1,188 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Source (either AttributeProvider or Country).
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.10 $, $Date: 2013-11-29 $
+ */
+public final class AttributeSource implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 432243595968469014L;
+
+ public static final int SOURCE_LOCAL_APROVIDER = 1;
+ public static final int SOURCE_REMOTE_COUNTRY = 2;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeSource.class.getName());
+
+ /**
+ * Provider source.
+ */
+ private int sourceType;
+
+ /**
+ * Provider URL.
+ */
+ private String providerURL;
+
+ /**
+ * The local Attribute Provider.
+ */
+ private AttributeProvider provider;
+
+ /**
+ * The remote Country.
+ */
+ private Country country;
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param provider The local Attribute Provider.
+ * @param pURL URL of the Attribute Provider.
+ */
+ public AttributeSource(final AttributeProvider provider, final String pURL) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.setProvider(provider);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param country The remote Country.
+ * @param pURL URL of the Country.
+ */
+ public AttributeSource(final Country country, final String pURL) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.setCountry(country);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * @param sourceType the sourceType to set
+ */
+ public void setSourceType(final int sourceType) {
+ this.sourceType = sourceType;
+ }
+
+ /**
+ * @return the sourceType
+ */
+ public int getSourceType() {
+ return sourceType;
+ }
+
+ /**
+ * @param providerURL the providerURL to set
+ */
+ public void setProviderURL(final String providerURL) {
+ this.providerURL = providerURL;
+ }
+
+ /**
+ * @return the providerURL
+ */
+ public String getProviderURL() {
+ return providerURL;
+ }
+
+ /**
+ * @param provider the provider to set
+ */
+ public void setProvider(final AttributeProvider provider) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.provider = provider;
+ }
+
+ /**
+ * @return the provider
+ */
+ public AttributeProvider getProvider() {
+ return provider;
+ }
+
+ /**
+ * @param country the country to set
+ */
+ public void setCountry(final Country country) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.country = country;
+ }
+
+ /**
+ * @return the country
+ */
+ public Country getCountry() {
+ return country;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+ boolean outcome = false;
+
+ LOG.debug("Calling equals with Object.");
+ if ( obj instanceof AttributeSource ) {
+ LOG.debug("Calling equals with AttributeSource.");
+ outcome = this.equals((AttributeSource)obj);
+ }
+
+ LOG.debug("Object equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * Compare the given AttributeSource with the current object in order to determinine
+ * if they are equal.
+ *
+ * @param obj The AttributeSource to compare to
+ *
+ * @return true if the two objects are equal
+ */
+ public boolean equals(AttributeSource obj) {
+ boolean outcome = false;
+
+ if ( this.sourceType==obj.getSourceType() ) {
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( this.provider.getProviderId().equals(obj.getProvider().getProviderId()) )
+ outcome = true;
+ }
+ else if ( this.sourceType==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( this.country.getCountryId().equals(obj.getCountry().getCountryId()) )
+ outcome = true;
+ }
+ }
+
+ LOG.debug("AttributeSource equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hash = 1;
+ hash = hash * 17 + this.sourceType;
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER )
+ hash = hash * 31 + this.provider.getProviderName().hashCode();
+ else
+ hash = hash * 31 + this.country.getCountryName().hashCode();
+ return hash;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
new file mode 100644
index 000000000..af7ab6cf3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
@@ -0,0 +1,231 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-12-15 23:19:59 $
+ */
+public final class AttributeUtil {
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private AttributeUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Safe escape any given string.
+ *
+ * @param value The HTTP Value to escaped.
+ *
+ * @return The value escaped value.
+ */
+ public static String escape(final String value) {
+
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(attrSep, escAttrSep)
+ .replace(attrTupleSep, escAttrTupleSep)
+ .replace(attrValueSep, escAttrValueSep);
+ }
+
+ /**
+ * Unescape any given string.
+ *
+ * @param value The HTTP Value to be unescaped.
+ *
+ * @return The value unescaped value.
+ */
+ public static String unescape(final String value) {
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(escAttrSep, attrSep)
+ .replace(escAttrTupleSep, attrTupleSep)
+ .replace(escAttrValueSep, attrValueSep);
+ }
+
+ /**
+ * Appends the string representation of an object to a StringBuilder.
+ *
+ * @param strBuilder The StringBuilder to append to.
+ * @param val The string representation of an object.
+ */
+ public static void appendIfNotNull(final StringBuilder strBuilder,
+ final Object val) {
+
+ if (val != null) {
+ strBuilder.append(val);
+ }
+ }
+
+ /**
+ * Given a separator and a list of strings, joins the list, as a string,
+ * separated by the separator string.
+ *
+ * @param list The list of strings to join.
+ * @param separator The separator string.
+ * @return the list, as a string, separated by the separator string.
+ */
+ public static String listToString(final List<String> list,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ for (final String s : list) {
+ if (!StringUtils.isEmpty(s)) {
+ strBuilder.append(AttributeUtil.escape(s) + separator);
+ }
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Given a separator and a map of strings to strings, joins the map, as a
+ * string, separated by the separator string with the pair key/value
+ * concatenated with a '='.
+ *
+ * @param map The map of strings to join.
+ * @param separator The separator string.
+ *
+ * @return the map of strings, as a string, separated by the separator string
+ * with the pair key/value concatenated with a '='.
+ */
+ public static String mapToString(final Map<String, String> map,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ final Iterator<Entry<String, String>> valuesIt = map.entrySet().iterator();
+ while (valuesIt.hasNext()) {
+ final Entry<String, String> entry = valuesIt.next();
+ strBuilder.append(entry.getKey());
+ strBuilder.append('=');
+ strBuilder.append(AttributeUtil.escape(entry.getValue()));
+ strBuilder.append(separator);
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates the attribute value format.
+ *
+ * @param value The attribute value to validate.
+ *
+ * @return true if value has a valid format.
+ */
+ public static boolean isValidValue(final String value) {
+ boolean retVal = false;
+ if (value != null && value.charAt(0) == '[' && value.endsWith("]")) {
+ final String tmpAttrValue = value.substring(1, value.length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ if (tmpAttrValue.length() >= 0
+ || (vals.length > 0 && vals[0].length() > 0)) {
+ retVal = true;
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the attribute type value. It's case insensitive. E.g. return true
+ * value to: a) "true", "TRUE", "True", ... b) "false", "FALSE", "False", ...
+ *
+ * @param type The attribute type value.
+ *
+ * @return true if type has a true or false (case insensitive) value.
+ */
+ public static boolean isValidType(final String type) {
+ return StringUtils.isNotEmpty(type) && (PEPSValues.TRUE.toString().equalsIgnoreCase(type) || PEPSValues.FALSE.toString().equalsIgnoreCase(type)) ;
+ }
+
+ /**
+ * Validates the Personal attribute tuple. E.g. name:type:[value]:status
+ *
+ * @param tuples The Personal attribute's tuple.
+ *
+ * @return true if the tuples' format is valid.
+ *
+ * @see PEPSUtil#validateParameter(String, String, String)
+ * @see String#equalsIgnoreCase(String)
+ */
+ public static boolean hasValidTuples(final String[] tuples) {
+ boolean retVal = false;
+
+ final int numberTuples = AttributeConstants.NUMBER_TUPLES.intValue();
+ if (tuples != null && tuples.length == numberTuples) {
+ // validate attrName
+ final int attrNameIndex = AttributeConstants.ATTR_NAME_INDEX.intValue();
+ final int attrTypeIndex = AttributeConstants.ATTR_TYPE_INDEX.intValue();
+ final int attrValueIndex = AttributeConstants.ATTR_VALUE_INDEX.intValue();
+
+ retVal =
+ StringUtils.isNotEmpty(tuples[attrNameIndex])
+ && StringUtils.isNotEmpty(tuples[attrTypeIndex])
+ && StringUtils.isNotEmpty(tuples[attrValueIndex])
+ && AttributeUtil.isValidType(tuples[attrTypeIndex])
+ && AttributeUtil.isValidValue(tuples[attrValueIndex]);
+ }
+ return retVal;
+ }
+
+ /**
+ * Check if all mandatory attributes have values.
+ *
+ * @param personalAttrList The Personal Attributes List.
+ *
+ * @return true if all mandatory attributes have values, false if at least one
+ * attribute doesn't have value.
+ */
+ public static boolean checkMandatoryAttributes(
+ final IPersonalAttributeList personalAttrList) {
+
+ final Iterator<PersonalAttribute> itAttributes =
+ personalAttrList.values().iterator();
+ boolean retVal = true;
+ while (itAttributes.hasNext() && retVal) {
+ final PersonalAttribute attr = itAttributes.next();
+ if (attr.isRequired()
+ && !STORKStatusCode.STATUS_AVAILABLE.toString()
+ .equals(attr.getStatus())) {
+ retVal = false;
+ }
+ }
+ return retVal;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
new file mode 100644
index 000000000..9ebcfbd5a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
@@ -0,0 +1,123 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Citizen
+ * Consent.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CitizenConsent {
+
+ /**
+ * Mandatory attributes list.
+ */
+ private List<String> mandatoryList;
+
+ /**
+ * Optional attributes list.
+ */
+ private List<String> optionalList;
+
+ /**
+ * Citizen Consent default Constructor.
+ */
+ public CitizenConsent() {
+ this.mandatoryList = new ArrayList<String>();
+ this.optionalList = new ArrayList<String>();
+ }
+
+ /**
+ * Getter for the mandatoryList value.
+ *
+ * @return The mandatoryList value.
+ */
+ public List<String> getMandatoryList() {
+ return this.mandatoryList;
+ }
+
+ /**
+ * Setter for the mandatoryList value.
+ *
+ * @param mandatoryAttrList Mandatory parameters list.
+ */
+ public void setMandatoryList(final List<String> mandatoryAttrList) {
+ this.mandatoryList = mandatoryAttrList;
+ }
+
+ /**
+ * Setter for some mandatoryAttribute. Adds the input parameter to the
+ * mandatoryList.
+ *
+ * @param mandatoryAttr Attribute to add to the mandatoryList.
+ */
+ public void setMandatoryAttribute(final String mandatoryAttr) {
+ this.mandatoryList.add(mandatoryAttr);
+ }
+
+ /**
+ * Getter for the optionalList value.
+ *
+ * @return The optionalList value.
+ */
+ public List<String> getOptionalList() {
+ return optionalList;
+ }
+
+ /**
+ * Setter for the optionalList value.
+ *
+ * @param optAttrList Optional parameters list.
+ */
+ public void setOptionalList(final List<String> optAttrList) {
+ this.optionalList = optAttrList;
+ }
+
+ /**
+ * Setter for some optionalAttr. Adds the input parameter to the optionalList.
+ *
+ * @param optionalAttr Attribute to add to the optionalList.
+ */
+ public void setOptionalAttribute(final String optionalAttr) {
+ this.optionalList.add(optionalAttr);
+ }
+
+ /**
+ * Returns a string in the following format. "Mandatory attributes:
+ * mandatoryAttr1;mandatoryAttr2;mandatoryAttrN Optional attributes:
+ * optionalAttr1;optionalAttr2;optionalAttrN"
+ *
+ * @return {@inheritDoc}
+ */
+ public String toString() {
+ final StringBuilder strbldr = new StringBuilder(46);
+ strbldr.append("Mandatory attributes: ");
+ for (final String str : mandatoryList) {
+ strbldr.append(str).append(';');
+ }
+ strbldr.append(" Optional attributes: ");
+ for (final String str : optionalList) {
+ strbldr.append(str).append(';');
+ }
+ return strbldr.toString();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java
new file mode 100644
index 000000000..001f9317a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java
@@ -0,0 +1,95 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Country.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class Country implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1135994036496370993L;
+
+/**
+ * Country Id.
+ */
+ private String countryId;
+
+ /**
+ * Country Name.
+ */
+ private String countryName;
+
+ /**
+ * Country Constructor.
+ *
+ * @param cId Id of the Country.
+ * @param cName Name of the Country.
+ */
+ public Country(final String cId, final String cName) {
+
+ this.countryId = cId;
+ this.countryName = cName;
+ }
+
+ /**
+ * Getter for the countryId value.
+ *
+ * @return The countryId value.
+ */
+ public String getCountryId() {
+
+ return countryId;
+ }
+
+ /**
+ * Setter for the countryId value.
+ *
+ * @param cId Id of the Country.
+ */
+ public void setCountryId(final String cId) {
+
+ this.countryId = cId;
+ }
+
+ /**
+ * Getter for the countryName value.
+ *
+ * @return The countryName value.
+ */
+ public String getCountryName() {
+
+ return countryName;
+ }
+
+ /**
+ * Setter for the countryName value.
+ *
+ * @param name Name of the Country.
+ */
+ public void setCountryName(final String name) {
+
+ this.countryName = name;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
new file mode 100644
index 000000000..54345f3ea
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
@@ -0,0 +1,79 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This class contains all the ISO 3166-1 Alpha 3 Country Codes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2011-04-14 00:24:56 $
+ */
+public final class CountryCodes {
+
+ /**
+ * Private Constructor.
+ */
+ private CountryCodes() {
+
+ }
+
+ /**
+ * ISO 3166-1 Alpha 3 Country Codes.
+ */
+ private static List<String> countrysAlpha3 = Arrays.asList("ABW", "AFG",
+ "AGO", "AIA", "ALA", "ALB", "AND", "ANT", "ARE", "ARG", "ARM", "ASM",
+ "ATA", "ATF", "ATG", "AUS", "AUT", "AZE", "BDI", "BEL", "BEN", "BES",
+ "BFA", "BGD", "BGR", "BHR", "BHS", "BIH", "BLM", "BLR", "BLZ", "BMU",
+ "BOL", "BRA", "BRB", "BRN", "BTN", "BUR", "BVT", "BWA", "BYS", "CAF",
+ "CAN", "CCK", "CHE", "CHL", "CHN", "CIV", "CMR", "COD", "COG", "COK",
+ "COL", "COM", "CPV", "CRI", "CSK", "CUB", "CUW", "CXR", "CYM", "CYP",
+ "CZE", "DEU", "DJI", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "ERI",
+ "ESH", "ESP", "EST", "ETH", "FIN", "FJI", "FLK", "FRA", "FRO", "FSM",
+ "GAB", "GBR", "GEO", "GGY", "GHA", "GIB", "GIN", "GLP", "GMB", "GNB",
+ "GNQ", "GRC", "GRD", "GRL", "GTM", "GUF", "GUM", "GUY", "HKG", "HMD",
+ "HND", "HRV", "HTI", "HUN", "IDN", "IMN", "IND", "IOT", "IRL", "IRN",
+ "IRQ", "ISL", "ISR", "ITA", "JAM", "JEY", "JOR", "JPN", "KAZ", "KEN",
+ "KGZ", "KHM", "KIR", "KNA", "KOR", "KWT", "LAO", "LBN", "LBR", "LBY",
+ "LCA", "LIE", "LKA", "LSO", "LTU", "LUX", "LVA", "MAC", "MAF", "MAR",
+ "MCO", "MDA", "MDG", "MDV", "MEX", "MHL", "MKD", "MLI", "MLT", "MMR",
+ "MNE", "MNG", "MNP", "MOZ", "MRT", "MSR", "MTQ", "MUS", "MWI", "MYS",
+ "MYT", "NAM", "NCL", "NER", "NFK", "NGA", "NIC", "NIU", "NLD", "NOR",
+ "NPL", "NRU", "NZL", "OMN", "PAK", "PAN", "PCN", "PER", "PHL", "PLW",
+ "PNG", "POL", "PRI", "PRK", "PRT", "PRY", "PSE", "PYF", "QAT", "REU",
+ "ROM", "ROU", "RUS", "RWA", "SAU", "SCG", "SDN", "SEN", "SGP", "SGS",
+ "SHN", "SJM", "SLB", "SLE", "SLV", "SMR", "SOM", "SPM", "SRB", "STP",
+ "SUR", "SVK", "SVN", "SXW", "SWE", "SWZ", "SYC", "SYR", "TCA", "TCD",
+ "TGO", "THA", "TJK", "TKL", "TKM", "TLS", "TMP", "TON", "TTO", "TUN",
+ "TUR", "TUV", "TWN", "TZA", "UGA", "UKR", "UMI", "URY", "USA", "UZB",
+ "VAT", "VCT", "VEN", "VGB", "VIR", "VNM", "VUT", "WLF", "WSM", "YEM",
+ "YUG", "ZAF", "ZAR", "ZMB", "ZWE");
+
+ /**
+ * Searches the CountryCode (3166-1 alpha3 format) an return true if it
+ * exists.
+ *
+ * @param countryCode The Country code to search.
+ *
+ * @return true if the CountryCode exists, false otherwise.
+ */
+ public static boolean hasCountryCodeAlpha3(final String countryCode) {
+
+ return CountryCodes.countrysAlpha3.contains(countryCode);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
new file mode 100644
index 000000000..9c0bd6775
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
@@ -0,0 +1,169 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.sql.Timestamp;
+import java.util.GregorianCalendar;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.joda.time.Years;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * This class holds static helper methods for Date Operations.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class DateUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(DateUtil.class.getName());
+
+ /**
+ * yyyy Date format size.
+ */
+ private static final int YEAR_DATE_SIZE = 4;
+
+ /**
+ * yyyyMM Date format size.
+ */
+ private static final int MONTH_DATE_SIZE = 6;
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private DateUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Fulfils dateValue with a valid date. The following roles are applied: a) If
+ * the dateValue only contains the year then fulfils with last year's day.
+ * e.g. this method returns 19951231 to the 1995 dateValue. b) If the
+ * dateValue contains the year and the month then fulfils with last month's
+ * day. e.g. this method returns 19950630 to the 199505 dateValue.
+ *
+ * @param dateValue The date to be fulfilled.
+ *
+ * @return The dateValue fulfilled.
+ */
+ private static String fulfilDate(final String dateValue) {
+
+ final StringBuffer strBuf = new StringBuffer();
+ strBuf.append(dateValue);
+ // if the IdP just provides the year then we must fullfil the date.
+ if (dateValue.length() == YEAR_DATE_SIZE) {
+ strBuf.append(PEPSValues.LAST_MONTH.toString());
+ }
+ // if the IdP provides the year and the month then we must fullfil the
+ // date.
+ if (dateValue.length() == MONTH_DATE_SIZE
+ || strBuf.length() == MONTH_DATE_SIZE) {
+ // IdP doesn't provide the day, so we will use DateTime to
+ // calculate it.
+ final String noDayCons = PEPSValues.NO_DAY_DATE_FORMAT.toString();
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(noDayCons);
+ final DateTime dateTime = fmt.parseDateTime(strBuf.toString());
+ // Append the last month's day.
+ strBuf.append(dateTime.dayOfMonth().withMaximumValue().getDayOfMonth());
+ }
+
+ return strBuf.toString();
+ }
+
+ /**
+ * Validates the dateValue format: a) if has a valid size; b) if has a numeric
+ * value; Note: dateValue must have the format yyyyMMdd.
+ *
+ * @param dateValueTmp The date to be validated.
+ * @param pattern The accepted date format.
+ *
+ * @return true if the date has a valid format.
+ */
+ public static boolean isValidFormatDate(final String dateValueTmp,
+ final String pattern) {
+
+ boolean retVal = true;
+ try {
+ final String dateValue = DateUtil.fulfilDate(dateValueTmp);
+
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ fmt.parseDateTime(dateValue);
+ } catch (final Exception e) {
+ // We catch Exception because we only have to return false
+ // value!
+ retVal = false;
+ }
+ return retVal;
+ }
+
+ /**
+ * Calculates the age for a given date string.
+ *
+ * @param dateVal The date to be validated.
+ * @param now The current date.
+ * @param pattern The date pattern.
+ *
+ * @return The age value.
+ */
+ public static int calculateAge(final String dateVal, final DateTime now,
+ final String pattern) {
+
+ if (DateUtil.isValidFormatDate(dateVal, pattern)) {
+ try {
+ final String dateValueTemp = DateUtil.fulfilDate(dateVal);
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ final DateTime dateTime = fmt.parseDateTime(dateValueTemp);
+ // Calculating age
+ final Years age = Years.yearsBetween(dateTime, now);
+
+ return age.getYears();
+ } catch (final IllegalArgumentException e) {
+ LOG.warn("Invalid date format (" + pattern
+ + ") or an invalid dateValue.");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()),
+ e);
+ }
+ } else {
+ LOG.warn("Couldn't calculate Age, invalid date!");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()));
+ }
+
+ }
+
+ /**
+ * Generates the current timestamp.
+ *
+ * @return timestamp The current timestamp
+ */
+ public static Timestamp currentTimeStamp() {
+ final GregorianCalendar cal = new GregorianCalendar();
+ final long millis = cal.getTimeInMillis();
+ return new Timestamp(millis);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
new file mode 100644
index 000000000..b13c70f04
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
@@ -0,0 +1,148 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface for {@link AttributeListProcessor}.
+ *
+ * @author ricardo.ferreira@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ *
+ * @see IPersonalAttributeList
+ */
+public interface IAttributeListProcessor {
+
+ /**
+ * Checks if attribute list only contains allowed attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the allowed attributes
+ *
+ * @return true is all the attributes are allowed.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAllowedAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Lookup for business attribute.
+ *
+ * @param attrList the requested attribute list
+ * @param normalAttributes the normal attributes
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList, final List<String> normalAttributes);
+
+ /**
+ * Lookup for business attribute in normal attribute list (loaded by
+ * implementation).
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes to get business
+ * attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to add (eIdentifier, name,
+ * surname, and DateOfBirth).
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes, loaded by
+ * implementation, to get business attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Removes from attribute list the given list of attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to remove.
+ *
+ * @return the requested attribute list and the attributes removed.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Removes from attribute list the given list of attributes and change
+ * attributes status if attribute was optional in the request.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the map of attributes (attribute name, mandatory/optional) to remove.
+ *
+ * @return the requested attribute list and the attributes removed
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(IPersonalAttributeList attrList, Map<String, Boolean> attributes);
+
+ /**
+ * Checks if mandate attribute exist in the requested Attribute List. Power
+ * attribute name to lookup is loaded by implementation.
+ *
+ * @param attrList the requested attribute list.
+ *
+ * @return true if mandate attribute exists or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasPowerAttribute(final IPersonalAttributeList attrList);
+
+ /**
+ * Checks if attribute name was requested and has value.
+ *
+ * @param attrList the requested attribute list.
+ * @param attrName the attribute name to lookup for .
+ *
+ * @return true if attribute was requested and has value or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAttributeValue(final IPersonalAttributeList attrList, final String attrName);
+
+ /**
+ * Checks if attribute has value.
+ *
+ * @param attr the attribute to check.
+ *
+ * @return true if has value;
+ *
+ * @see PersonalAttribute
+ */
+ boolean hasAttributeValue(final PersonalAttribute attr);
+
+ /**
+ * Gets a map (attribute name, attribute isRequired) of attributes added to attribute list.
+ *
+ * @return the Map of attributes added and if is required to attribute list.
+ */
+ Map<String, Boolean> getNormalAttributesAdded();
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
new file mode 100644
index 000000000..5833f6822
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
@@ -0,0 +1,82 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+
+/**
+ * Interface for Attributes Providers map.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-09-20 $
+ */
+public interface IAttributeProvidersMap {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ IPersonalAttributeList get(AttributeSource key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(AttributeSource key, IPersonalAttributeList value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ IPersonalAttributeList remove(AttributeSource key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(AttributeSource key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns an Iterator of the keys contained in this map. The implementation must
+ * take care in order for the Iterator to have predictable order of the returned
+ * keys.
+ *
+ * @return an iterator of the keys contained in this map
+ */
+ Iterator<AttributeSource> keyIterator();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
new file mode 100644
index 000000000..b24c915c0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
@@ -0,0 +1,194 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Interface for {@link PersonalAttributeList}.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.16 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD.CloneMethodMustImplementCloneable")
+public interface IPersonalAttributeList extends Iterable<PersonalAttribute>,
+ Cloneable {
+
+ /**
+ * Associates the specified value with the specified key in this Personal
+ * Attribute List.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return the previous value associated with key, or null if there was no
+ * mapping for key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute put(String key, PersonalAttribute value);
+
+ /**
+ * Returns the value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @param key whose associated value is to be returned.
+ *
+ * @return The value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute get(Object key);
+
+ /**
+ * Adds to the PersonalAttributeList the given PersonalAttribute. It sets the
+ * attribute name as the key to the attribute value.
+ *
+ * @param value PersonalAttribute to add to the PersonalAttributeList
+ */
+ void add(PersonalAttribute value);
+
+ /**
+ * Get the size of the Personal Attribute List.
+ *
+ * @return size of the Personal Attribute List.
+ */
+ int size();
+
+ /**
+ * Checks if the Personal Attribute List contains the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if the Personal Attribute List contains the given key, false
+ * otherwise.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Getter for the iterator of the Personal Attribute List values.
+ *
+ * @return The iterator for the Personal Attribute List values.
+ *
+ * @see PersonalAttribute
+ */
+ Iterator<PersonalAttribute> iterator();
+
+ /**
+ * Creates a Personal Attribute List from a String representing an Attribute
+ * List.
+ *
+ * @param attrList String Object representing the attribute list.
+ */
+ void populate(String attrList);
+
+ /**
+ * Removes the mapping for this key from this map if present.
+ *
+ * @param key key whose mapping is to be removed from the map.
+ * @return previous value associated with specified key, or <tt>null</tt> if
+ * there was no mapping for key. A <tt>null</tt> return can also
+ * indicate that the map previously associated <tt>null</tt> with the
+ * specified key.
+ */
+ PersonalAttribute remove(Object key);
+
+ /**
+ * Returns a collection view of the values contained in this map. The
+ * collection is backed by the map, so changes to the map are reflected in the
+ * collection, and vice-versa. The collection supports element removal, which
+ * removes the corresponding mapping from this map, via the
+ * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>clear</tt> operations. It does not support the
+ * <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * @return a collection view of the values contained in this map.
+ */
+ Collection<PersonalAttribute> values();
+
+ /**
+ * Returns a {@link Set} view of the keys contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. If the map is modified
+ * while an iteration over the set is in progress (except through
+ * the iterator's own <tt>remove</tt> operation), the results of
+ * the iteration are undefined. The set supports element removal,
+ * which removes the corresponding mapping from the map, via the
+ * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or <tt>addAll</tt>
+ * operations.
+ *
+ * @return a set view of the keys contained in this map
+ */
+ Set<String> keySet();
+
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes.
+ *
+ * @return an IPersonalAttributeList of the complex attributes.
+ */
+ IPersonalAttributeList getComplexAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the simple value attributes.
+ *
+ * @return an IPersonalAttributeList of the simple value attributes.
+ */
+ IPersonalAttributeList getSimpleValueAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ IPersonalAttributeList getMandatoryAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ IPersonalAttributeList getOptionalAttributes();
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ *
+ * @return <tt>true</tt> if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns <tt>true</tt> if this map contains at least one element that doesn't have value.
+ *
+ * @return <tt>true</tt> if this map contains at least one element that doesn't have value.
+ */
+ boolean hasMissingValues();
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ Object clone() throws CloneNotSupportedException;
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
new file mode 100644
index 000000000..33eb618f0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
@@ -0,0 +1,239 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork logging.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public interface IStorkLogger {
+
+ /**
+ * Getter for SpApplication.
+ *
+ * @return The SpApplication value.
+ */
+ String getSpApplication();
+
+ /**
+ * Setter for SpApplication.
+ *
+ * @param spApplication The SP Application.
+ */
+ void setSpApplication(String spApplication);
+
+ /**
+ * Getter for ProviderName.
+ *
+ * @return The ProviderName value.
+ */
+ String getProviderName();
+
+ /**
+ * Setter for ProviderName.
+ *
+ * @param providerName The provider name.
+ */
+ void setProviderName(String providerName);
+
+ /**
+ *
+ * Getter for Origin.
+ *
+ * @return The Origin value.
+ *
+ */
+ String getOrigin();
+
+ /**
+ * Setter for Origin.
+ *
+ * @param origin The origin.
+ */
+ void setOrigin(String origin);
+
+ /**
+ *
+ * Getter for QAA Level.
+ *
+ * @return The QAA Level value.
+ *
+ */
+ int getQaaLevel();
+
+ /**
+ * Setter for QAA Level.
+ *
+ * @param qaaLevel The qaa level.
+ */
+ void setQaaLevel(int qaaLevel);
+
+ /**
+ *
+ * Getter for timestamp.
+ *
+ * @return The timestamp value.
+ *
+ */
+ String getTimestamp();
+
+ /**
+ * Setter for timestamp.
+ *
+ * @param timestamp The request's timestamp.
+ */
+ void setTimestamp(String timestamp);
+
+ /**
+ * Getter for InResponseTo.
+ *
+ * @return The InResponseTo value.
+ */
+ String getInResponseTo();
+
+ /**
+ * Setter for InResponseTo.
+ *
+ * @param inResponseTo The Saml's response id.
+ */
+ void setInResponseTo(String inResponseTo);
+
+ /**
+ * Getter for InResponseToSPReq.
+ *
+ * @return The InResponseToSPReq value.
+ */
+ String getInResponseToSPReq();
+
+ /**
+ * Setter for InResponseToSPRequ.
+ *
+ * @param inResponseToSPReq The Saml's response id.
+ */
+ void setInResponseToSPReq(String inResponseToSPReq);
+
+ /**
+ * Getter for opType.
+ *
+ * @return The opType value.
+ */
+ String getOpType();
+
+ /**
+ * Setter for opType.
+ *
+ * @param opType The operation type.
+ */
+ void setOpType(String opType);
+
+ /**
+ * Getter for destination.
+ *
+ * @return The destination value.
+ */
+ String getDestination();
+
+ /**
+ * Setter for destinationIp.
+ *
+ * @param destination The remote IP.
+ */
+ void setDestination(String destination);
+
+ /**
+ * Getter for message or assertion consumer.
+ *
+ * @return The message or assertion consumer.
+ */
+ String getMessage();
+
+ /**
+ * Setter for message or assertion consumer.
+ *
+ * @param message or assertion consumer.
+ */
+ void setMessage(String message);
+
+ /**
+ * Getter for country.
+ *
+ * @return The country value.
+ */
+ String getCountry();
+
+ /**
+ * Setter for country.
+ *
+ * @param country The country.
+ */
+ void setCountry(String country);
+
+ /**
+ * Getter for samlHash.
+ *
+ * @return The samlHash value.
+ */
+ byte[] getSamlHash();
+
+ /**
+ * Setter for samlHash.
+ *
+ * @param samlHash the encrypted SAML token
+ */
+ void setSamlHash(byte[] samlHash);
+
+ /**
+ * Getter for msgId.
+ *
+ * @return the msgId
+ */
+ String getMsgId();
+
+ /**
+ * Setter for msgId.
+ *
+ * @param msgId the ID of the originator of this message
+ */
+ void setMsgId(String msgId);
+
+ /**
+ * Getter for sPMsgId.
+ *
+ * @return the sPMsgId
+ */
+ String getSPMsgId();
+
+ /**
+ * Setter for sPMsgId.
+ *
+ * @param sPMsgId the ID of the originator of this message
+ */
+ void setSPMsgId(String sPMsgId);
+
+ /**
+ * The format of the returned String must be the following:
+ * "requestCounter#ddMMMyyyykk:mm:ss#opType#originIp#originName
+ * #destinationIp#destinationName#samlHash#[originatorName#msgId#]"
+ *
+ * The values enclosed in '[]' only apply when logging responses.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ String toString();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
new file mode 100644
index 000000000..f38b41838
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
@@ -0,0 +1,85 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork session.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public interface IStorkSession {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ Object get(Object key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(String key, Object value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object remove(Object key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
new file mode 100644
index 000000000..bf236258d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
@@ -0,0 +1,316 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information of Attribute Providers, the Attribute
+ * List to be requested, the Assertions returned by the Attribute Providers and the values
+ * that each Attribute has. This information along with the current status of the Linker (the
+ * attribute providers that were queried and the remaining providers) is used by the PEPS
+ * actions in order to complete the Attribute gathering.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.50 $, $Date: 2013-11-28 $
+ */
+public final class Linker implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -3268006381745987237L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(Linker.class.getName());
+
+ /**
+ * Attributes Providers map.
+ */
+ private IAttributeProvidersMap attributeProvidersMap;
+
+ /**
+ * Assertion map.
+ */
+ private LinkedHashMap<AttributeSource, STORKAttrQueryResponse> assertions;
+
+ /**
+ * The current index of local (domestic) Attribute Providers.
+ */
+ private int localIndex;
+
+ /**
+ * The current index of remote (foreign) Attribute Providers - countries.
+ */
+ private int remoteIndex;
+
+ /**
+ * Constructs an empty Linker object.
+ */
+ public Linker() {
+ localIndex = 0;
+ remoteIndex = 0;
+
+ assertions = new LinkedHashMap<AttributeSource, STORKAttrQueryResponse>();
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next local Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextLocalProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap!=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( curIndex>=localIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next remote Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextRemoteProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( curIndex>=remoteIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * It updates the Linker with the values returned by the Attribute Source. It also advances
+ * to the next index in order to mark this attribute source as completed.
+ *
+ * @param source The Attribute Source that was queried for attribute values.
+ * @param attrResponse The attrResponse returned by the Attribute Source that contains the attribute values.
+ *
+ * @see AttributeSource, STORKAttrQueryResponse
+ */
+ public void setProviderReponse(AttributeSource source, STORKAttrQueryResponse attrResponse) {
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ //Assertion storage
+ this.assertions.put(source, attrResponse);
+
+ this.attributeProvidersMap.put(source, attrResponse.getPersonalAttributeList());
+ //this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
+ }
+
+ /**
+ * Reset the internal state of the local Attribute Source in order to start over.
+ */
+ public void resetLocalIndex() {
+ localIndex = 0;
+ }
+
+ /**
+ * Reset the internal state of the remote Attribute Source in order to start over.
+ */
+ public void resetRemoteIndex() {
+ remoteIndex = 0;
+ }
+
+ /**
+ * Setter for attributeProvidersMap.
+ *
+ * @param attributeProvidersMap The attributeProvidersMap to set.
+ */
+ public void setAttributeProvidersMap(IAttributeProvidersMap attributeProvidersMap) {
+ this.attributeProvidersMap = attributeProvidersMap;
+ }
+
+ /**
+ * Getter for attributeProvidersMap.
+ *
+ * @return attributeProvidersMap
+ */
+ public IAttributeProvidersMap getAttributeProvidersMap() {
+ return attributeProvidersMap;
+ }
+
+ /**
+ * Returns the Personal Attribute list of the provided Attribute Source.
+ *
+ * @param source The attributeSource in reference
+ *
+ * @return The IPersonalAttributeList assosiated with this source or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getProviderAttributes(AttributeSource source) {
+ if ( attributeProvidersMap.containsKey(source) )
+ return attributeProvidersMap.get(source);
+ else
+ return null;
+ }
+
+ /**
+ * Returns the merged Personal Attribute list from all the Attribute Sources.
+ *
+ * @return The IPersonalAttributeList merged Personal Attribute list or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getAllAttributes() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source;
+ IPersonalAttributeList list, merged;
+
+ merged = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+
+ merged = new PersonalAttributeList();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+ list = this.getProviderAttributes(source);
+
+ for (final PersonalAttribute pa : list) {
+ merged.add(pa);
+ }
+ }
+ }
+
+ return merged;
+ }
+
+ /**
+ * Returns a List with all the assertions gathered by the AAS-PEPS module
+ * returned both by local APs or remote A-PEPS.
+ *
+ * @return The assertions returned from the APs and A-PEPS
+ */
+ public List<STORKAttrQueryResponse> getAttrQueryResponseList() {
+ List<STORKAttrQueryResponse> originalAssertions;
+
+ originalAssertions = new ArrayList<STORKAttrQueryResponse>();
+
+ //Gather all assertions
+ for (STORKAttrQueryResponse element : this.assertions.values()) {
+ originalAssertions.add(element);
+ }
+
+ return originalAssertions;
+ }
+
+ /**
+ * Checks the internal state of the Linker and if all Attribute Sources where visited
+ * returns true, otherwise it returns false. So if you go directly from AtPLinkerAction
+ * to MoreAttributesAction the call will have, since the method setProviderReponse
+ * was not executed from every Attribute Source.
+ *
+ * @return true if everything is OK, false otherwise
+ */
+ public boolean isComplete() {
+ boolean outcome = false;
+
+ LOG.debug("Check if linkder is complete: R[" + remoteIndex + "], L[" + localIndex + "], S[" + attributeProvidersMap.size() + "]");
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ if ( (remoteIndex + localIndex)==attributeProvidersMap.size() )
+ outcome = true;
+ }
+ else {
+ outcome = true;
+ }
+
+ return outcome;
+ }
+
+ /**
+ * Merge the two Linker objects.
+ *
+ * @param previous The other Linker object to merge with this one.
+ */
+ public void mergeWith(Linker previous) {
+ //BEFORE
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap from the current object.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ LOG.debug("The attributeProvidersMap from the provided object.");
+ ((AttributeProvidersMap)previous.getAttributeProvidersMap()).trace();
+ }
+
+ IAttributeProvidersMap map = previous.getAttributeProvidersMap();
+ Iterator<AttributeSource> items = map.keyIterator();
+ while( items.hasNext() ) {
+ AttributeSource item = items.next();
+ IPersonalAttributeList pal = map.get(item);
+
+ if ( this.attributeProvidersMap.containsKey(item) ) {
+ IPersonalAttributeList new_pal = this.attributeProvidersMap.get(item);
+
+ for(PersonalAttribute pa : pal)
+ new_pal.add(pa);
+ }
+ else {
+ if ( item.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ this.attributeProvidersMap.put(item, pal);
+ }
+ }
+
+ //AFTER
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap after the merge.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ }
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
new file mode 100644
index 000000000..5da9ba494
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public enum PEPSErrors {
+
+ /**
+ * Represents the 'authenticationFailed' constant error identifier.
+ */
+ AUTHENTICATION_FAILED_ERROR("authenticationFailed"),
+ /**
+ * Represents the 'spCountrySelector.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_ERROR_CREATE_SAML("spCountrySelector.errorCreatingSAML"),
+ /**
+ * Represents the 'spCountrySelector.destNull' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_DESTNULL("spCountrySelector.destNull"),
+ /**
+ * Represents the 'spCountrySelector.invalidAttr' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_ATTR("spCountrySelector.invalidAttr"),
+ /**
+ * Represents the 'spCountrySelector.invalidProviderName' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_PROVIDER_NAME(
+ "spCountrySelector.invalidProviderName"),
+ /**
+ * Represents the 'spCountrySelector.invalidQaaSPid' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_QAASPID("spCountrySelector.invalidQaaSPid"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpId' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPID("spCountrySelector.invalidSpId"),
+ /**
+ * Represents the 'spCountrySelector.invalidSPQAA' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPQAA("spCountrySelector.invalidSPQAA"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpURL' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPURL("spCountrySelector.invalidSpURL"),
+ /**
+ * Represents the 'spCountrySelector.spNotAllowed' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_SPNOTALLOWED("spCountrySelector.spNotAllowed"),
+
+ /**
+ * Represents the 'sProviderAction.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_ERROR_CREATE_SAML("sProviderAction.errorCreatingSAML"),
+ /**
+ * Represents the 'sProviderAction.attr' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_ATTR("sProviderAction.invalidAttr"),
+ /**
+ * Represents the 'sProviderAction.country' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_COUNTRY("sProviderAction.invalidCountry"),
+ /**
+ * Represents the 'sProviderAction.relayState' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_RELAY_STATE("sProviderAction.invalidRelayState"),
+ /**
+ * Represents the 'sProviderAction.saml' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SAML("sProviderAction.invalidSaml"),
+ /**
+ * Represents the 'sProviderAction.spAlias' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPALIAS("sProviderAction.invalidSPAlias"),
+ /**
+ * Represents the 'sProviderAction.spDomain' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPDOMAIN("sProviderAction.invalidSPDomain"),
+ /**
+ * Represents the 'sProviderAction.spId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPID("sProviderAction.invalidSPId"),
+ /**
+ * Represents the 'sProviderAction.spQAA' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAA("sProviderAction.invalidSPQAA"),
+ /**
+ * Represents the 'sProviderAction.spQAAId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAAID("sProviderAction.invalidSPQAAId"),
+ /**
+ * Represents the 'sProviderAction.spRedirect' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPREDIRECT("sProviderAction.invalidSPRedirect"),
+ /**
+ * Represents the 'sPPowerValidationAction.invalidSPPVAttrList' constant error identifier.
+ */
+ SPPOWERVALIDATION_SELECTOR_INVALID_SP_PV_ATTR_LIST("sPPowerValidationAction.invalidSPPVAttrList"),
+
+ /**
+ * Represents the 'sProviderAction.invalidSPProviderName' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SP_PROVIDERNAME(
+ "sProviderAction.invalidSPProviderName"),
+ /**
+ * Represents the 'sProviderAction.spNotAllowed' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_SPNOTALLOWED("sProviderAction.spNotAllowed"),
+
+
+ /**
+ * Represents the 'internalError' constant error identifier.
+ */
+ INTERNAL_ERROR("internalError"),
+
+ /**
+ * Represents the 'colleagueRequest.attrNull' constant error identifier.
+ */
+ COLLEAGUE_REQ_ATTR_NULL("colleagueRequest.attrNull"),
+ /**
+ * Represents the 'colleagueRequest.errorCreatingSAML' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_ERROR_CREATE_SAML("colleagueRequest.errorCreatingSAML"),
+ /**
+ * Represents the 'colleagueRequest.invalidCountryCode' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_COUNTRYCODE("colleagueRequest.invalidCountryCode"),
+ /**
+ * Represents the 'colleagueRequest.invalidDestUrl' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_DEST_URL("colleagueRequest.invalidDestUrl"),
+ /**
+ * Represents the 'colleagueRequest.invalidQaa' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_QAA("colleagueRequest.invalidQaa"),
+ /**
+ * Represents the 'colleagueRequest.invalidRedirect' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_REDIRECT("colleagueRequest.invalidRedirect"),
+ /**
+ * Represents the 'colleagueRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_SAML("colleagueRequest.invalidSAML"),
+
+ /**
+ * Represents the 'colleaguePVRequest.invalidPVAttrList' constant error identifier.
+ */
+ COLLEAGUE_PV_REQ_INVALID_PV_ATTR_LIST("colleaguePVRequest.invalidPVAttrList"),
+
+
+ /**
+ * Represents the 'cpepsRedirectUrl' constant error identifier.
+ */
+ CPEPS_REDIRECT_URL("cpepsRedirectUrl"),
+ /**
+ * Represents the 'spepsRedirectUrl' constant error identifier.
+ */
+ SPEPS_REDIRECT_URL("spepsRedirectUrl"),
+ /**
+ * Represents the 'sProviderAction.invCountry' constant error identifier.
+ */
+ SP_ACTION_INV_COUNTRY("sProviderAction.invCountry"),
+
+ /**
+ * Represents the 'providernameAlias.invalid' constant error identifier.
+ */
+ PROVIDER_ALIAS_INVALID("providernameAlias.invalid"),
+
+
+ /**
+ * Represents the 'cPeps.attrNull' constant error identifier.
+ */
+ CPEPS_ATTR_NULL("cPeps.attrNull"),
+
+ /**
+ * Represents the 'colleagueResponse.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_RESP_INVALID_SAML("colleagueResponse.invalidSAML"),
+
+ /**
+ * Represents the 'citizenNoConsent.mandatory' constant error identifier.
+ */
+ CITIZEN_NO_CONSENT_MANDATORY("citizenNoConsent.mandatory"),
+ /**
+ * Represents the 'citizenResponse.mandatory' constant error identifier.
+ */
+ CITIZEN_RESPONSE_MANDATORY("citizenResponse.mandatory"),
+ /**
+ * Represents the 'attVerification.mandatory' constant error identifier.
+ */
+ ATT_VERIFICATION_MANDATORY("attVerification.mandatory"),
+ /**
+ * Represents the 'attrValue.verification' constant error identifier.
+ */
+ ATTR_VALUE_VERIFICATION("attrValue.verification"),
+
+ /**
+ * Represents the 'audienceRestrictionError' constant error identifier.
+ */
+ AUDIENCE_RESTRICTION("audienceRestrictionError"),
+ /**
+ * Represents the 'auRequestIdError' constant error identifier.
+ */
+ AU_REQUEST_ID("auRequestIdError"),
+ /**
+ * Represents the 'domain' constant error identifier.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the 'hash.error' constant error identifier.
+ */
+ HASH_ERROR("hash.error"),
+ /**
+ * Represents the 'invalidAttributeList' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_LIST("invalidAttributeList"),
+ /**
+ * Represents the 'invalidAttributeValue' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_VALUE("invalidAttributeValue"),
+ /**
+ * Represents the 'qaaLevel' constant error identifier.
+ */
+ QAALEVEL("qaaLevel"),
+ /**
+ * Represents the 'requests' constant error identifier.
+ */
+ REQUESTS("requests"),
+ /**
+ * Represents the 'SPSAMLRequest' constant error identifier.
+ */
+ SP_SAML_REQUEST("SPSAMLRequest"),
+ /**
+ * Represents the 'spepsSAMLRequest' constant error identifier.
+ */
+ SPEPS_SAML_REQUEST("spepsSAMLRequest"),
+ /**
+ * Represents the 'IdPSAMLResponse' constant error identifier.
+ */
+ IDP_SAML_RESPONSE("IdPSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ CPEPS_SAML_RESPONSE("cpepsSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ SPEPS_SAML_RESPONSE("spepsSAMLResponse"),
+ /**
+ * Represents the 'session' constant error identifier.
+ */
+ SESSION("session"),
+ /**
+ * Represents the 'invalid.session' constant error identifier.
+ */
+ INVALID_SESSION("invalid.session"),
+ /**
+ * Represents the 'invalid.sessionId' constant error identifier.
+ */
+ INVALID_SESSION_ID("invalid.sessionId"),
+ /**
+ * Represents the 'missing.sessionId' constant error identifier.
+ */
+ MISSING_SESSION_ID("sessionError"),
+ /**
+ * Represents the 'missing.mandate' constant error identifier.
+ */
+ MISSING_MANDATE("missing.mandate"),
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_SAML_RESPONSE("AtPSAMLResponse"),
+
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_RESPONSE_ERROR("atp.response.error"),
+
+ /**
+ * Represents the 'apepsSAMLRequest' constant error identifier.
+ */
+ APEPS_SAML_REQUEST("apepsSAMLRequest"),
+
+ /**
+ * Represents the 'apepsSAMLResponse' constant error identifier.
+ */
+ APEPS_SAML_RESPONSE("apepsSAMLResponse"),
+
+ /**
+ * Represents the 'invalid.apepsRedirectUrl' constant error identifier.
+ */
+ INVALID_APEPS_REDIRECT_URL("invalid.apepsRedirectUrl"),
+
+ /**
+ * Represents the 'invalid.apepsCallbackUrl' constant error identifier.
+ */
+ INVALID_APEPS_CALLBACK_URL("invalid.apepsCallbackUrl"),
+
+ /**
+ * Represents the 'colleagueAttributeRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_ATTR_REQ_INVALID_SAML("colleagueAttributeRequest.invalidSAML");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String error;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nError The Constant error value.
+ */
+ PEPSErrors(final String nError) {
+ this.error = nError;
+ }
+
+ /**
+ * Construct the errorCode Constant value.
+ *
+ * @return The errorCode Constant.
+ */
+ public String errorCode() {
+ return error + ".code";
+ }
+
+ /**
+ * Construct the errorCode Constant value with the given code text.
+ *
+ * @param text the code text to append to the constant.
+ *
+ * @return The errorCode Constant for the given code text.
+ */
+ public String errorCode(final String text) {
+ return error + "." + text + ".code";
+ }
+
+ /**
+ * Construct the errorMessage constant value.
+ *
+ * @return The errorMessage constant.
+ */
+ public String errorMessage() {
+ return error + ".message";
+ }
+
+ /**
+ * Construct the errorMessage Constant value with the given message text.
+ *
+ * @param text the message text to append to the constant.
+ *
+ * @return The errorMessage Constant for the given text.
+ */
+ public String errorMessage(final String text) {
+ return error + "." + text + ".message";
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return error;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
new file mode 100644
index 000000000..146e4c39d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
@@ -0,0 +1,619 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific Parameters.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSParameters {
+
+ /**
+ * Represents the 'apId' parameter constant.
+ */
+ AP_ID("apId"),
+ /**
+ * Represents the 'apUrl' parameter constant.
+ */
+ AP_URL("apUrl"),
+ /**
+ * Represents the 'ap.number' parameter constant.
+ */
+ AP_NUMBER("ap.number"),
+
+ /**
+ * Represents the 'assertionConsumerServiceURL' parameter constant.
+ */
+ ASSERTION_CONSUMER_S_URL("assertionConsumerServiceURL"),
+
+ /**
+ * Represents the 'auth' parameter constant.
+ */
+ AUTHENTICATION("auth"),
+
+ /**
+ * Represents the 'auth-on-behalf-of' parameter constant.
+ */
+ AUTHENTICATION_ON_BEHALF_OF("auth-on-behalf-of"),
+
+ /**
+ * Represents the 'attr' parameter constant.
+ */
+ ATTRIBUTE("attr"),
+ /**
+ * Represents the 'attrName' parameter constant.
+ */
+ ATTRIBUTE_NAME("attrName"),
+ /**
+ * Represents the 'attrStatus' parameter constant.
+ */
+ ATTRIBUTE_STATUS("attrStatus"),
+ /**
+ * Represents the 'attrType' parameter constant.
+ */
+ ATTRIBUTE_TYPE("attrType"),
+ /**
+ * Represents the 'attrValue' parameter constant.
+ */
+ ATTRIBUTE_VALUE("attrValue"),
+ /**
+ * Represents the 'attrList' parameter constant.
+ */
+ ATTRIBUTE_LIST("attrList"),
+ /**
+ * Represents the 'apMandAttrList' parameter constant.
+ */
+ AP_MANDATORY_ATTRIBUTE_LIST("apMandAttrList"),
+ /**
+ * Represents the 'attrTuple' parameter constant.
+ */
+ ATTRIBUTE_TUPLE("attrTuple"),
+ /**
+ * Represents the 'attribute-missing' parameter constant.
+ */
+ ATTRIBUTE_MISSING("attribute-missing"),
+ /**
+ * Represents the 'attributesNotAllowed' parameter constant.
+ */
+ ATTRIBUTES_NOT_ALLOWED("attributesNotAllowed"),
+ /**
+ * Represents the 'authnRequest' parameter constant.
+ */
+ AUTH_REQUEST("authnRequest"),
+
+ /**
+ * Represents the 'attrValue.number' parameter constant.
+ */
+ ATTR_VALUE_NUMBER("attrValue.number"),
+
+ /**
+ * Represents the 'derivation.date.format' parameter constant.
+ */
+ DERIVATION_DATE_FORMAT("derivation.date.format"),
+ /**
+ * Represents the 'deriveAttr.number' parameter constant.
+ */
+ DERIVE_ATTRIBUTE_NUMBER("deriveAttr.number"),
+
+ /**
+ * Represents the complex attributes parameter constant.
+ */
+ COMPLEX_ADDRESS_VALUE("canonicalResidenceAddress"),
+ COMPLEX_NEWATTRIBUTE_VALUE("newAttribute2"),
+ COMPLEX_HASDEGREE_VALUE("hasDegree"),
+ COMPLEX_MANDATECONTENT_VALUE("mandateContent"),
+ /**
+ * Represents the 'consent-type' parameter constant.
+ */
+ CONSENT_TYPE("consent-type"),
+ /**
+ * Represents the 'consent-value' parameter constant.
+ */
+ CONSENT_VALUE("consent-value"),
+ /**
+ * Represents the 'country' parameter constant.
+ */
+ COUNTRY("country"),
+ /**
+ * Represents the 'countryOrigin' parameter constant.
+ */
+ COUNTRY_ORIGIN("countryOrigin"),
+
+ /**
+ * Represents the 'cpepsURL' parameter constant.
+ */
+ CPEPS_URL("cpepsURL"),
+ /**
+ * Represents the 'callback' parameter constant.
+ */
+ CPEPS_CALLBACK("callback"),
+ /**
+ * Represents the 'peps.specificidpredirect.url' parameter constant.
+ */
+ CPEPS_IDP_CALLBACK_VALUE("peps.specificidpredirect.url"),
+ /**
+ * Represents the 'peps.specificapredirect.url' parameter constant.
+ */
+ CPEPS_AP_CALLBACK_VALUE("peps.specificapredirect.url"),
+
+ /**
+ * Represents the 'errorCode' parameter constant.
+ */
+ ERROR_CODE("errorCode"),
+ /**
+ * Represents the 'subCode' parameter constant.
+ */
+ ERROR_SUBCODE("subCode"),
+ /**
+ * Represents the 'errorMessage' parameter constant.
+ */
+ ERROR_MESSAGE("errorMessage"),
+ /**
+ * Represents the 'errorRedirectUrl' parameter constant.
+ */
+ ERROR_REDIRECT_URL("errorRedirectUrl"),
+
+ /**
+ * errorRedirectUrl Represents the 'external-authentication' parameter
+ * constant.
+ */
+ EXTERNAL_AUTH("external-authentication"),
+ /**
+ * Represents the 'external-ap' parameter constant.
+ */
+ EXTERNAL_AP("external-ap"),
+ /**
+ * Represents the 'external-pv' parameter constant.
+ */
+ EXTERNAL_PV("external-pv"),
+ /**
+ * Represents the 'external-sig-module' parameter constant.
+ */
+ EXT_SIG_CREATOR_MOD("external-sig-module"),
+
+ /**
+ * Represents the 'http-x-forwarded-for' parameter constant.
+ */
+ HTTP_X_FORWARDED_FOR("http-x-forwarded-for"),
+
+ /**
+ * Represents the 'idp.url' parameter constant.
+ */
+ IDP_URL("idp.url"),
+ /**
+ * Represents the 'idpAUB.url' parameter constant.
+ */
+ IDPAUB_URL("idpAUB.url"),
+ /**
+ * Represents the 'internal-authentication' parameter constant.
+ */
+ INTERNAL_AUTH("internal-authentication"),
+ /**
+ * Represents the 'internal-ap' parameter constant.
+ */
+ INTERNAL_AP("internal-ap"),
+ /**
+ * Represents the 'internal-pv' parameter constant.
+ */
+ INTERNAL_PV("internal-pv"),
+
+ /**
+ * Represents the 'samlIssuer' parameter constant.
+ */
+ ISSUER("samlIssuer"),
+ /**
+ * Represents the 'samlIssuer.idp' parameter constant.
+ */
+ ISSUER_IDP("samlIssuer.idp"),
+ /**
+ * Represents the 'samlIssuer.atp' parameter constant.
+ */
+ ISSUER_ATP("samlIssuer.atp"),
+
+ /**
+ * Represents the 'mandatory' parameter constant.
+ */
+ MANDATORY("mandatory"),
+ /**
+ * Represents the 'mandatoryAttributeMissing' parameter constant.
+ */
+ MANDATORY_ATTR_MISSING("mandatoryAttributeMissing"),
+ /**
+ * Represents the 'mandatoryConsentAttrMissing' parameter constant.
+ */
+ MANDATORY_CONSENT_MISSING("mandatoryConsentAttrMissing"),
+ /**
+ * Represents the 'missing-attrs' parameter constant.
+ */
+ MISSING_ATTRS("missing-attrs"),
+ /**
+ * Represents the 'no-more-attrs' parameter constant.
+ */
+ NO_MORE_ATTRS("no-more-attrs"),
+
+ /**
+ * Represents the 'optional' parameter constant.
+ */
+ OPTIONAL("optional"),
+
+ /**
+ * Represents the 'no-consent-type' parameter constant.
+ */
+ NO_CONSENT_TYPE("no-consent-type"),
+ /**
+ * Represents the 'no-consent-value' parameter constant.
+ */
+ NO_CONSENT_VALUE("no-consent-value"),
+
+ /**
+ * Represents the 'provider.name' parameter constant.
+ */
+ PROVIDER_NAME_VALUE("providerName"),
+ /**
+ * Represents the 'cpeps.askconsent' parameter constant.
+ */
+ PEPS_ASK_CONSENT("cpeps.askconsent"),
+ /**
+ * Represents the 'cpeps.askconsentvalue' parameter constant.
+ */
+ PEPS_ASK_CONSENT_VALUE("cpeps.askconsentvalue"),
+ /**
+ * Represents the 'pepsAuth' parameter constant.
+ */
+ PEPS_AUTH_CONSENT("pepsAuth"),
+ /**
+ * Represents the 'validation.bypass' parameter constant.
+ */
+ PEPS_BYPASS("validation.bypass"),
+ /**
+ * Represents the 'cpeps.number' parameter constant.
+ */
+ PEPS_NUMBER("cpeps.number"),
+ /**
+ * Represents the 'cpeps.specificapredirect.url' parameter constant.
+ */
+ PEPS_SPECIFIC_URL("cpeps.specificapredirect.url"),
+ /**
+ * Represents the 'pv.url' parameter constant.
+ */
+ PV_URL("pv.url"),
+
+ /**
+ * Represents the 'qaaLevel' parameter constant.
+ */
+ QAALEVEL("qaaLevel"),
+
+ /**
+ * Represents the 'speps.redirectUrl' parameter constant.
+ */
+ SPEPS_REDIRECT_URL("speps.redirectUrl"),
+
+ /**
+ * Represents the 'sp.redirectUrl' parameter constant.
+ */
+ SP_REDIRECT_URL("sp.redirectUrl"),
+ /**
+ * Represents the 'cpeps.redirectUrl' parameter constant.
+ */
+ CPEPS_REDIRECT_URL("cpeps.redirectUrl"),
+ /**
+ * Represents the 'RelayState' parameter constant.
+ */
+ RELAY_STATE("RelayState"),
+ /**
+ * Represents the 'remoteAddr' parameter constant.
+ */
+ REMOTE_ADDR("remoteAddr"),
+ /**
+ * Represents the 'remoteUser' parameter constant.
+ */
+ REMOTE_USER("remoteUser"),
+
+ /**
+ * Represents the 'SAMLRequest' parameter constant.
+ */
+ SAML_REQUEST("SAMLRequest"),
+ /**
+ * Represents the 'SAMLResponse' parameter constant.
+ */
+ SAML_RESPONSE("SAMLResponse"),
+ /**
+ * Represents the 'SAMLFail' parameter constant.
+ */
+ SAML_TOKEN_FAIL("SAMLFail"),
+ /**
+ * Represents the 'TokenId' parameter constant.
+ */
+ SAML_TOKEN_ID("TokenId"),
+ /**
+ * Represents the 'inResponseTo' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO("inResponseTo"),
+ /**
+ * Represents the 'inResponseTo.idp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_IDP("inResponseTo.idp"),
+ /**
+ * Represents the 'inResponseTo.atp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_ATP("inResponseTo.atp"),
+ /**
+ * Represents the 'SignatureResponse' parameter constant.
+ */
+ SIGNATURE_RESPONSE("SignatureResponse"),
+
+ /**
+ * Represents the 'cPepsSession' parameter constant.
+ */
+ SESSION_ID_URL("cPepsSession"),
+ /**
+ * Represents the 'spId' parameter constant.
+ */
+ SP_ID("spId"),
+ /**
+ * Represents the 'spQaaLevel' parameter constant.
+ */
+ SP_QAALEVEL("spQaaLevel"),
+ /**
+ * Represents the 'spUrl' parameter constant.
+ */
+ SP_URL("spUrl"),
+
+ /**
+ * Represents the 'allow.derivation.all' parameter constant.
+ */
+ SPECIFIC_ALLOW_DERIVATION_ALL("allow.derivation.all"),
+ /**
+ * Represents the ''allow.unknowns parameter constant.
+ */
+ SPECIFIC_ALLOW_UNKNOWNS("allow.unknowns"),
+ /**
+ * Represents the 'derivation.date.separator' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DATE_SEP("derivation.date.separator"),
+ /**
+ * Represents the 'derivation.month.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_MONTH_POS("derivation.month.position"),
+ /**
+ * Represents the 'derivation.day.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DAY_POS("derivation.day.position"),
+ /**
+ * Represents the 'derivation.year.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_YEAR_POS("derivation.year.position"),
+
+ /**
+ * sp.authorized.parameters Represents the '' parameter constant.
+ */
+ SPEPS_AUTHORIZED("sp.authorized.parameters"),
+
+ /**
+ * Represents the 'spSector' constant value.
+ */
+ SPSECTOR("spSector"),
+ /**
+ * Represents the 'spApplication' constant value.
+ */
+ SPAPPLICATION("spApplication"),
+ /**
+ * Represents the 'spCountry' constant value.
+ */
+ SPCOUNTRY("spCountry"),
+ /**
+ * Represents the 'spInstitution' constant value.
+ */
+ SPINSTITUTION("spInstitution"),
+ /**
+ * Represents the 'storkAttribute.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_NUMBER("storkAttribute.number"),
+ /**
+ * Represents the 'storkAttributeValue.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_VALUE_NUMBER("storkAttributeValue.number"),
+
+ /**
+ * Represents the 'username' parameter constant.
+ */
+ USERNAME("username"),
+
+ /**
+ * Represents the 'tooManyParameters' parameter constant.
+ */
+ TOO_MANY_PARAMETERS("tooManyParameters"),
+ /**
+ * Represents the 'validation.active' parameter constant.
+ */
+ VALIDATION_ACTIVE("validation.active"),
+
+ /**
+ * Represents the 'x-forwarded-for' parameter constant.
+ */
+ X_FORWARDED_FOR("x-forwarded-for"),
+ /**
+ * Represents the 'x-forwarded-host' parameter constant.
+ */
+ X_FORWARDED_HOST("x-forwarded-host"),
+ /**
+ * Represents the 'XMLResponse' parameter constant.
+ */
+ XML_RESPONSE("XMLResponse"),
+
+ /**
+ * Represents the 'ap-cpeps.number' parameter constant.
+ */
+ AP_PEPS_NUMBER("ap-cpeps.number"),
+
+ /**
+ * Represents the 'atp.number' parameter constant.
+ */
+ ATTRIBUTE_PROVIDER_NUMBER("atp.number"),
+
+ /**
+ * Represents the 'atn.number' parameter constant.
+ */
+ ATTRIBUTE_NAME_NUMBER("atn.number"),
+
+ /**
+ * Represents the 'apLinker' parameter constant.
+ */
+ AP_LINKER("apLinker"),
+
+ /**
+ * Represents the 'prevApLinker' parameter constant.
+ */
+ PREV_AP_LINKER("prevApLinker"),
+
+ /**
+ * Represents the 'NOSEL' parameter constant (no attribute provider selected).
+ */
+ AP_NO_SELECTION("NOSEL"),
+
+ /**
+ * Represents the 'OCSEL' parameter constant (attribute provider in another country).
+ */
+ AP_OTHER_COUNTRY("OCSEL"),
+
+ /**
+ * Represents the '_provider' suffix parameter constant.
+ */
+ AP_PROVIDER_SELECT_SUFFIX("_provider"),
+
+ /**
+ * Represents the '_country' suffix parameter constant.
+ */
+ AP_COUNTRY_SELECT_SUFFIX("_country"),
+
+ /**
+ * Represents the '_name' suffix parameter constant.
+ */
+ AP_NAME_SELECT_SUFFIX("_name"),
+
+ /**
+ * Represents the 'next-ap' parameter constant.
+ */
+ NEXT_AP("next-ap"),
+
+ /**
+ * Represents the 'next-apeps' parameter constant.
+ */
+ NEXT_APEPS("next-apeps"),
+
+ /**
+ * Represents the 'back-to-apeps' parameter constant.
+ */
+ BACK_TO_APEPS("back-to-apeps"),
+
+ /**
+ * Represents the 'is-remote-apeps' parameter constant.
+ */
+ IS_REMOTE_APEPS("is-remote-apeps"),
+
+ /**
+ * Represents the 'more-attributes' parameter constant.
+ */
+ MORE_ATTRIBUTES("more-attributes"),
+
+ /**
+ * Represents the 'attr-filter.number' parameter constant.
+ */
+ ATTRIBUTES_FILTER_NUMBER("attr-filter.number"),
+
+ /**
+ * Represents the 'atp.url' parameter constant.
+ */
+ ATP_URL("atp.url"),
+ /**
+ * Represents the 'apepsURL' parameter constant.
+ */
+ APEPS_URL("apepsUrl"),
+
+ /**
+ * Represents the 'apepsCountry' parameter constant.
+ */
+ APEPS_COUNTRY("apepsCountry"),
+
+ /**
+ * Represents the 'apepsAuthRequest' parameter constant.
+ */
+ APEPS_ATTR_REQUEST("apepsAttrRequest"),
+
+ /**
+ * Represents the 'isApepsRequest' parameter constant.
+ */
+ APEPS_REQUEST_COMPLETE("apeps-request-complete"),
+
+ /**
+ * Represents the 'apeps.callbackUrl' parameter constant.
+ */
+ APEPS_CALLBACK_URL("apeps.callbackUrl"),
+ /**
+ * Represents the 'attrListMand' parameter constant.
+ */
+ ATTR_LIST_MAND("attrListMand"),
+
+ /**
+ * Represents the 'attrListOpt' parameter constant.
+ */
+ ATTR_LIST_OPT("attrListOpt"),
+
+ /**
+ * Represents the 'simpleAttrListMand' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_MAND("simpleAttrListMand"),
+
+ /**
+ * Represents the 'simpleAttrListOpt' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_OPT("simpleAttrListOpt"),
+
+ /**
+ * Represents the 'complexAttrListMand' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_MAND("complexAttrListMand"),
+
+ /**
+ * Represents the 'complexAttrListOpt' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_OPT("complexAttrListOpt");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nValue The Constant value.
+ */
+ PEPSParameters(final String nValue) {
+ this.value = nValue;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
new file mode 100644
index 000000000..a16b03edb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
@@ -0,0 +1,353 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.crypto.Digest;
+import org.bouncycastle.util.encoders.Base64;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.75 $, $Date: 2010-11-23 00:05:35 $
+ */
+public final class PEPSUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PEPSUtil.class.getName());
+
+ /**
+ * Configurations object.
+ */
+ private static Properties configs;
+
+ /**
+ * Max prefix.
+ */
+ private static final String MAX_PARAM_PREFIX = "max.";
+
+ /**
+ * Code prefix to get error code.
+ */
+ private static final String CODE_PARAM_SUFFIX = ".code";
+
+ /**
+ * param's size prefix to get max param size.
+ */
+ private static final String MAX_PARAM_SUFFIX = ".size";
+
+ /**
+ * Message prefix to get error message.
+ */
+ private static final String MSG_PARAM_SUFFIX = ".message";
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private PEPSUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Creates a single instance of this class and sets the properties.
+ *
+ * @param nConfigs The set of available configurations.
+ *
+ * @return The created PEPSUtil's class.
+ */
+ public static PEPSUtil createInstance(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ return new PEPSUtil();
+ }
+
+ /**
+ * Getter for the Properties.
+ *
+ * @return configs The properties value.
+ */
+ public Properties getConfigs() {
+ return configs;
+ }
+
+ /**
+ * Setter for the Properties.
+ *
+ * @param nConfigs The new properties value.
+ */
+ public static void setConfigs(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ }
+
+ /**
+ * Returns the identifier of some configuration given a set of configurations
+ * and the corresponding configuration key.
+ *
+ * @param configKey The key that IDs some configuration.
+ *
+ * @return The configuration String value.
+ */
+ public static String getConfig(final String configKey) {
+ return configs.getProperty(configKey);
+ }
+
+ /**
+ * Validates the input paramValue identified by the paramName.
+ *
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ *
+ * @return true if the parameter is valid.
+ */
+ public static boolean isValidParameter(final String paramName,
+ final String paramValue) {
+
+ final String validationParam =
+ PEPSUtil.getConfig(PEPSParameters.VALIDATION_ACTIVE.toString());
+ boolean retVal = true;
+
+ final String paramConf = MAX_PARAM_PREFIX + paramName + MAX_PARAM_SUFFIX;
+
+ if (PEPSValues.TRUE.toString().equals(validationParam)) {
+ final String paramSizeStr = PEPSUtil.getConfig(paramConf);
+ // Checking if the parameter size exists and if it's numeric
+ if (StringUtils.isNumeric(paramSizeStr)) {
+ final int maxParamSize = Integer.valueOf(paramSizeStr);
+ if (StringUtils.isEmpty(paramValue)
+ || paramValue.length() > maxParamSize) {
+ retVal = false;
+ LOG.warn("Invalid parameter [" + paramName + "] value " + paramValue);
+ }
+ } else {
+ retVal = false;
+ LOG.error("Missing " + paramConf
+ + " configuration in the pepsUtils.properties configuration file");
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the Parameter and throws an exception if an error occurs. Throws
+ * an InvalidParameterPEPSException runtime exception if the parameter is
+ * invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final Object paramValue) {
+
+ if (paramValue == null) {
+ PEPSUtil.validateParameter(className, paramName, "");
+ } else {
+ PEPSUtil.validateParameter(className, paramName, paramValue.toString());
+ }
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getErrorCode(paramName), PEPSUtil.getErrorMessage(paramName));
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param error The PEPSError to get error code and messages from configs.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final PEPSErrors error) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getConfig(error.errorCode()),
+ PEPSUtil.getConfig(error.errorMessage()));
+ }
+
+ /**
+ * Validates the HTTP Parameter and throws an exception if an error occurs.
+ * Throws an InvalidParameterPEPSException runtime exception if the parameter
+ * is invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param errorCode The error code to include on the exception.
+ * @param errorMessage The error message to include on the exception.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final String errorCode,
+ final String errorMessage) {
+
+ if (!isValidParameter(paramName, paramValue)) {
+ LOG.warn("Invalid parameter [" + paramName + "] value found at "
+ + className);
+ throw new InvalidParameterPEPSException(errorCode, errorMessage);
+ }
+ }
+
+ /**
+ * Getter for the error code of some given error related to the input param.
+ *
+ * @param paramName The name of the parameter associated with the error.
+ *
+ * @return The code of the error.
+ */
+ private static String getErrorCode(final String paramName) {
+ return getConfig(paramName + CODE_PARAM_SUFFIX);
+ }
+
+ /**
+ * Getter for the error message of some given error related to the input
+ * parameter.
+ *
+ * @param paramName The name of the parameter associated with the message.
+ *
+ * @return The message for the error.
+ */
+ private static String getErrorMessage(final String paramName) {
+ return getConfig(paramName + MSG_PARAM_SUFFIX);
+ }
+
+ /**
+ * {@link Base64} encodes the input samlToken parameter.
+ *
+ * @param samlToken the SAML Token to be encoded.
+ *
+ * @return The Base64 String representing the samlToken.
+ *
+ * @see Base64#encode
+ */
+ public static String encodeSAMLToken(final byte[] samlToken) {
+ try {
+ return new String(Base64.encode(samlToken), "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Decodes the {@link Base64} String input parameter representing a samlToken.
+ *
+ * @param samlToken the SAML Token to be decoded.
+ *
+ * @return The samlToken decoded bytes.
+ *
+ * @see Base64#decode
+ */
+ public static byte[] decodeSAMLToken(final String samlToken) {
+ return Base64.decode(samlToken);
+ }
+
+ /**
+ * Hashes a SAML token. Throws an InternalErrorPEPSException runtime exception
+ * if the Cryptographic Engine fails.
+ *
+ * @param samlToken the SAML Token to be hashed.
+ *
+ * @return byte[] with the hashed SAML Token.
+ */
+ public static byte[] hashPersonalToken(final byte[] samlToken) {
+ try {
+ final String className =
+ PEPSUtil.getConfig(PEPSValues.HASH_DIGEST_CLASS.toString());
+
+ final Digest digest =
+ (Digest) Class.forName(className).getConstructor()
+ .newInstance((Object[]) null);
+ digest.update(samlToken, 0, samlToken.length);
+
+ final int retLength = digest.getDigestSize();
+ final byte[] ret = new byte[retLength];
+
+ digest.doFinal(ret, 0);
+ return ret;
+
+ } catch (final Exception e) {
+ // For all those exceptions that could be thrown, we always log it and
+ // thrown an InternalErrorPEPSException.
+ LOG.error(PEPSErrors.HASH_ERROR.errorMessage(), e);
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Gets the Stork error code in the error message if exists!
+ *
+ * @param errorMessage The message to get the error code if exists;
+ *
+ * @return the error code if exists. Returns null otherwise.
+ */
+ public static String getStorkErrorCode(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the Stork error message in the saml message if exists!
+ *
+ * @param errorMessage The message to get in the saml message if exists;
+ *
+ * @return the error message if exists. Returns the original message
+ * otherwise.
+ */
+ public static String getStorkErrorMessage(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[1];
+ }
+ }
+ return errorMessage;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
new file mode 100644
index 000000000..e14c21cb5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
@@ -0,0 +1,329 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the value constants.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.17 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSValues {
+
+ /**
+ * Represents the 'all' constant value.
+ */
+ ALL("all"),
+ /**
+ * Represents the 'none' constant value.
+ */
+ NONE("none"),
+ /**
+ * Represents the 'true' constant value.
+ */
+ TRUE("true"),
+ /**
+ * Represents the 'false' constant value.
+ */
+ FALSE("false"),
+ /**
+ * Represents the empty string constant value.
+ */
+ EMPTY_STRING(""),
+
+ /**
+ * Represents the ',' separator constant value.
+ */
+ ATTRIBUTE_VALUE_SEP(","),
+ /**
+ * Represents the ';' separator constant value.
+ */
+ ATTRIBUTE_SEP(";"),
+ /**
+ * Represents the ':' separator constant value.
+ */
+ ATTRIBUTE_TUPLE_SEP(":"),
+ /**
+ * Represents the '/' separator constant value.
+ */
+ EID_SEPARATOR("/"),
+ /**
+ * Represents the ' - ' separator constant value.
+ */
+ ERROR_MESSAGE_SEP(" - "),
+ /**
+ * Represents the '#' parameter constant value.
+ */
+ LOGGER_SEP("#"),
+ /**
+ * Represents the 'NOT_AVAILABLE' parameter constant value.
+ */
+ NOT_AVAILABLE("NotAvailable"),
+ /**
+ * Represents the ';' parameter constant value.
+ */
+ SPEPS_AUTHORIZED_SEP(";"),
+
+ /**
+ * Represents the 'ap' constant value.
+ */
+ AP("ap"),
+ /**
+ * Represents the 'C-PEPS' constant value.
+ */
+ CPEPS("C-PEPS"),
+ /**
+ * Represents the 'cpeps' constant value.
+ */
+ CPEPS_PREFIX("cpeps"),
+ /**
+ * Represents the 'peps' constant value.
+ */
+ PEPS("peps"),
+ /**
+ * Represents the '-PEPS' constant value.
+ */
+ PEPS_SUFFIX("-PEPS"),
+ /**
+ * Represents the 'SP' constant value.
+ */
+ SP("SP"),
+ /**
+ * Represents the 'S-PEPS' constant value.
+ */
+ SPEPS("S-PEPS"),
+ /**
+ * Represents the 'speps' constant value.
+ */
+ SPEPS_PREFIX("speps"),
+ /**
+ * Represents the 'sp.default.parameters' constant value.
+ */
+ DEFAULT("sp.default.parameters"),
+ /**
+ * Represents the default saml id constant value.
+ */
+ DEFAULT_SAML_ID("1"),
+ /**
+ * Represents the 'hashDigest.className' constant value.
+ */
+ HASH_DIGEST_CLASS("hashDigest.className"),
+
+ /**
+ * Represents the 'eu.stork.communication.requests' constant value.
+ */
+ STORK_PACKAGE_REQUEST_LOGGER_VALUE("eu.stork.communication.requests"),
+ /**
+ * Represents the 'eu.stork.communication.responses' constant value.
+ */
+ STORK_PACKAGE_RESPONSE_LOGGER_VALUE("eu.stork.communication.responses"),
+
+ /**
+ * Represents the 'S-PEPS receives request from SP' constant value.
+ */
+ SP_REQUEST("S-PEPS receives request from SP"),
+ /**
+ * Represents the 'Get Citizen Consent' constant value.
+ */
+ CITIZEN_CONSENT_LOG("Get Citizen Consent"),
+ /**
+ * Represents the 'C-PEPS receives request from S-PEPS' constant value.
+ */
+ CPEPS_REQUEST("C-PEPS receives request from S-PEPS"),
+ /**
+ * Represents the 'C-PEPS generates response to S-PEPS' constant value.
+ */
+ CPEPS_RESPONSE("C-PEPS generates response to S-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates request to C-PEPS' constant value.
+ */
+ SPEPS_REQUEST("S-PEPS generates request to C-PEPS"),
+ /**
+ * Represents the 'S-PEPS receives response from C-PEPS' constant value.
+ */
+ SPEPS_RESPONSE("S-PEPS receives response from C-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates response to SP' constant value.
+ */
+ SP_RESPONSE("S-PEPS generates response to SP"),
+ /**
+ * Represents the 'Success' constant value.
+ */
+ SUCCESS("Success"),
+ /**
+ * Represents the December's month number constant value.
+ */
+ LAST_MONTH("12"),
+ /**
+ * Represents the yyyyMM constant value.
+ */
+ NO_DAY_DATE_FORMAT("yyyyMM"),
+
+ /**
+ * Represents the 'attrValue' constant value.
+ */
+ ATTRIBUTE("attrValue"),
+ /**
+ * Represents the 'derivedAttr' constant value.
+ */
+ DERIVE_ATTRIBUTE("deriveAttr"),
+ /**
+ * Represents the 'storkAttribute' constant value.
+ */
+ STORK_ATTRIBUTE("storkAttribute"),
+
+ /**
+ * Represents the 'properties' constant value.
+ */
+ PROPERTIES("properties"),
+ /**
+ * Represents the 'referer' constant value.
+ */
+ REFERER("referer"),
+ /**
+ * Represents the 'host' constant value.
+ */
+ HOST("host"),
+ /**
+ * Represents the 'spid' constant value.
+ */
+ SPID("spid"),
+ /**
+ * Represents the 'domain' constant value.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the '.validation' constant value.
+ */
+ VALIDATION_SUFFIX(".validation"),
+ /**
+ * Represents the 'jsessionid' constant value.
+ */
+ EQUAL("="),
+ /**
+ * Represents the 'HttpOnly' constant value.
+ */
+ HTTP_ONLY("HttpOnly"),
+ /**
+ * Represents the 'SET-COOKIE' constant value.
+ */
+ JSSESSION("JSESSIONID"),
+ /**
+ * Represents the '=' constant value.
+ */
+ SETCOOKIE("SET-COOKIE"),
+ /**
+ * Represents the ';' constant value.
+ */
+ SEMICOLON(";"),
+ /**
+ * Represents the ' ' constant value.
+ */
+ SPACE(" "),
+ /**
+ * Represents the 'atp' constant value.
+ */
+ APROVIDER_PREFIX("atp"),
+ /**
+ * Represents the 'atn' constant value.
+ */
+ ANAME_PREFIX("atn"),
+ /**
+ * Represents the 'ap-cpeps' constant value.
+ */
+ AP_CPEPS_PREFIX("ap-cpeps"),
+ /**
+ * Represents the 'attr-filter' constant value.
+ */
+ AP_ATTRFILTER_PREFIX("attr-filter");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ PEPSValues(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".id".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String index(final int index) {
+
+ return value + index + ".id";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".value".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated string value.
+ */
+ public String value(final int index) {
+
+ return value + index + ".value";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".name".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String name(final int index) {
+
+ return value + index + ".name";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".url".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String url(final int index) {
+
+ return value + index + ".url";
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
new file mode 100644
index 000000000..5d8281445
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
@@ -0,0 +1,348 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.log4j.Logger;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttribute.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.22 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class PersonalAttribute implements Serializable, Cloneable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2612951678412632174L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PersonalAttribute.class
+ .getName());
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String name;
+
+ /**
+ * Values of the personal attribute.
+ */
+ private List<String> value = new ArrayList<String>();
+
+ /**
+ * Type of the personal attribute.
+ */
+ private String type;
+
+ /**
+ * Complex values of the personal attribute.
+ */
+ private Map<String, String> complexValue = new ConcurrentHashMap<String, String>();
+
+ /**
+ * Is the personal attribute mandatory?
+ */
+ private transient boolean required;
+
+ /**
+ * Returned status of the attribute from the IdP.
+ */
+ private String status;
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String friendlyName;
+
+ /**
+ * Empty Constructor.
+ */
+ public PersonalAttribute() {
+ super();
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final List<String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's complex value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final Map<String, String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setComplexValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public Object clone() {
+
+ try {
+ final PersonalAttribute personalAttr = (PersonalAttribute) super.clone();
+ personalAttr.setIsRequired(this.isRequired());
+ personalAttr.setName(this.getName());
+ personalAttr.setStatus(this.getStatus());
+ if (!isEmptyValue()) {
+ final List<String> val =
+ (List<String>) ((ArrayList<String>) this.getValue()).clone();
+ personalAttr.setValue(val);
+ }
+ if (!isEmptyComplexValue()) {
+ final Map<String, String> complexVal =
+ (Map<String, String>) ((HashMap<String, String>) this
+ .getComplexValue()).clone();
+ personalAttr.setComplexValue(complexVal);
+ }
+ return personalAttr;
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("Nothing to do.");
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Getter for the required value.
+ *
+ * @return The required value.
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * Setter for the required value.
+ *
+ * @param attrIsRequired this attribute?
+ */
+ public void setIsRequired(final boolean attrIsRequired) {
+ this.required = attrIsRequired;
+ }
+
+ /**
+ * Getter for the name value.
+ *
+ * @return The name value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for the name value.
+ *
+ * @param attrName The personal attribute name.
+ */
+ public void setName(final String attrName) {
+ this.name = attrName;
+ }
+
+ /**
+ * Getter for the value.
+ *
+ * @return The list of values.
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Setter for the list of values.
+ *
+ * @param attrValue The personal attribute value.
+ */
+ public void setValue(final List<String> attrValue) {
+ if (attrValue != null) {
+ this.value = attrValue;
+ }
+ }
+
+
+ /**
+ * Getter for the type value.
+ *
+ * @return The name value.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Setter for the type value.
+ *
+ * @param attrName The personal attribute type.
+ */
+ public void setType(final String attrType) {
+ this.type = attrType;
+ }
+
+ /**
+ * Getter for the status.
+ *
+ * @return The status value.
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for the status value.
+ *
+ * @param attrStatus The personal attribute status.
+ */
+ public void setStatus(final String attrStatus) {
+ this.status = attrStatus;
+ }
+
+ /**
+ * Getter for the complex value.
+ *
+ * @return The complex value.
+ */
+ public Map<String, String> getComplexValue() {
+ return complexValue;
+ }
+
+ /**
+ * Setter for the complex value.
+ *
+ * @param complexVal The personal attribute Complex value.
+ */
+ public void setComplexValue(final Map<String, String> complexVal) {
+ if (complexVal != null) {
+ this.complexValue = complexVal;
+ }
+ }
+
+ /**
+ * Getter for the personal's friendly name.
+ *
+ * @return The personal's friendly name value.
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Setter for the personal's friendly name.
+ *
+ * @param fName The personal's friendly name.
+ */
+ public void setFriendlyName(final String fName) {
+ this.friendlyName = fName;
+ }
+
+ /**
+ * Return true the value is empty.
+ *
+ * @return True if the value is empty "[]";
+ */
+ public boolean isEmptyValue() {
+ return value.isEmpty() || (value.size() == 1 && value.get(0).length() == 0);
+ }
+
+ /**
+ * Returns true if the Complex Value is empty.
+ *
+ * @return True if the Complex Value is empty;
+ */
+ public boolean isEmptyComplexValue() {
+ return complexValue.isEmpty();
+ }
+
+ /**
+ * Returns true if the Status is empty.
+ *
+ * @return True if the Status is empty;
+ */
+ public boolean isEmptyStatus() {
+ return (status == null || status.length() == 0);
+ }
+
+ /**
+ * Prints the PersonalAttribute in the following format.
+ * name:required:[v,a,l,u,e,s]|[v=a,l=u,e=s]:status;
+ *
+ * @return The PersonalAttribute as a string.
+ */
+ public String toString() {
+ final StringBuilder strBuild = new StringBuilder();
+
+ AttributeUtil.appendIfNotNull(strBuild, getName());
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, String.valueOf(isRequired()));
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ strBuild.append('[');
+
+ if (isEmptyValue()) {
+ if (!isEmptyComplexValue()) {
+ AttributeUtil.appendIfNotNull(strBuild, AttributeUtil.mapToString(
+ getComplexValue(), PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+ } else {
+ AttributeUtil.appendIfNotNull(
+ strBuild,
+ AttributeUtil.listToString(getValue(),
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+
+ strBuild.append(']');
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, getStatus());
+ strBuild.append(PEPSValues.ATTRIBUTE_SEP.toString());
+
+ return strBuild.toString();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
new file mode 100644
index 000000000..9a0f87488
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
@@ -0,0 +1,397 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.StringTokenizer;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttributeList.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.27 $, $Date: 2010-11-18 22:54:56 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD")
+public final class PersonalAttributeList extends
+ ConcurrentHashMap<String, PersonalAttribute> implements IPersonalAttributeList, Serializable {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger
+ .getLogger(PersonalAttributeList.class.getName());
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = 7375127363889975062L;
+
+ /**
+ * Hash with the latest fetched attribute name alias.
+ */
+ private final Map<String, Integer> latestAttrAlias =
+ new HashMap<String, Integer>();
+
+ /**
+ * Hash with mapping number of alias or the attribute name.
+ */
+ private final Map<String, Integer> attrAliasNumber =
+ new HashMap<String, Integer>();
+
+ /**
+ * Default constructor.
+ */
+ public PersonalAttributeList() {
+ // The best practices recommend to call the super constructor.
+ super();
+ }
+
+ /**
+ * Constructor with initial capacity for the PersonalAttributeList size.
+ *
+ * @param capacity The initial capacity for the PersonalAttributeList.
+ */
+ public PersonalAttributeList(final int capacity) {
+ super(capacity);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Iterator<PersonalAttribute> iterator() {
+ return this.values().iterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute get(final Object key) {
+ String attrName = (String) key;
+
+ if (this.latestAttrAlias.containsKey(key)) {
+ attrName = attrName + this.latestAttrAlias.get(key);
+ } else {
+ if (this.attrAliasNumber.containsKey(key)) {
+ this.latestAttrAlias.put(attrName, this.attrAliasNumber.get(key));
+ }
+ }
+ return super.get(attrName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(final PersonalAttribute value) {
+ if (value != null) {
+ this.put(value.getName(), value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute put(final String key, final PersonalAttribute val) {
+ if (StringUtils.isNotEmpty(key) && val != null) {
+ // Validate if attribute name already exists!
+ String attrAlias = key;
+ if (this.containsKey(attrAlias)) {
+ //TODO isAgeOver should not be hardcoded, a better way of handling multipe isAgeOver requests should be implemented.
+ if (!val.isEmptyValue() && StringUtils.isNumeric(val.getValue().get(0)) && "isAgeOver".equals( val.getName() ) ) {
+ final String attrValue = val.getValue().get(0);
+ attrAlias = key + attrValue;
+ this.attrAliasNumber.put(key, Integer.valueOf(attrValue));
+ } else {
+ final PersonalAttribute attr = super.get(key);
+ if (!attr.isEmptyValue()
+ && StringUtils.isNumeric(attr.getValue().get(0))) {
+ attrAlias = key + attr.getValue().get(0);
+ super.put(key, (PersonalAttribute) attr);
+ this.attrAliasNumber.put(key, null);
+ }
+ }
+ }
+ return super.put(attrAlias, val);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void populate(final String attrList) {
+ final StringTokenizer strToken =
+ new StringTokenizer(attrList, PEPSValues.ATTRIBUTE_SEP.toString());
+
+ while (strToken.hasMoreTokens()) {
+ final PersonalAttribute persAttr = new PersonalAttribute();
+ String[] tuples =
+ strToken.nextToken().split(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString(),
+ AttributeConstants.NUMBER_TUPLES.intValue());
+
+ // Convert to the new format if needed!
+ tuples = convertFormat(tuples);
+
+ if (AttributeUtil.hasValidTuples(tuples)) {
+ final int attrValueIndex =
+ AttributeConstants.ATTR_VALUE_INDEX.intValue();
+ final String tmpAttrValue =
+ tuples[attrValueIndex].substring(1,
+ tuples[attrValueIndex].length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ persAttr.setName(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()]);
+ persAttr.setIsRequired(Boolean
+ .valueOf(tuples[AttributeConstants.ATTR_TYPE_INDEX.intValue()]));
+
+ // check if it is a complex value
+ if (isComplexValue(vals)) {
+ persAttr.setComplexValue(createComplexValue(vals));
+ }
+ else
+ {
+ persAttr.setValue(createValues(vals));
+ }
+
+ if (tuples.length == AttributeConstants.NUMBER_TUPLES.intValue()) {
+ persAttr.setStatus(tuples[AttributeConstants.ATTR_STATUS_INDEX
+ .intValue()]);
+ }
+ this.put(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()],
+ persAttr);
+
+ } else {
+ LOG.warn("Invalid personal attribute list tuples");
+ }
+
+ }
+ }
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ public Object clone() {
+ try {
+ return (PersonalAttributeList) super.clone();
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Creates a string in the following format.
+ *
+ * attrName:attrType:[attrValue1,attrValue2=attrComplexValue]:attrStatus;
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ final Iterator<Entry<String, PersonalAttribute>> itAttrs =
+ this.entrySet().iterator();
+ final StringBuilder strBuilder = new StringBuilder();
+
+ while (itAttrs.hasNext()) {
+ final Entry<String, PersonalAttribute> attrEntry = itAttrs.next();
+ final PersonalAttribute attr = attrEntry.getValue();
+ //strBuilder.append(attr.toString());
+ strBuilder.insert(0, attr.toString());
+ }
+
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates and creates the attribute's complex values.
+ *
+ * @param values The complex values.
+ *
+ * @return The {@link Map} with the complex values.
+ *
+ * @see Map
+ */
+ private Map<String, String> createComplexValue(final String[] values) {
+ final Map<String, String> complexValue = new HashMap<String, String>();
+ for (final String val : values) {
+ final String[] tVal = val.split("=");
+ if (StringUtils.isNotEmpty(val) && tVal.length == 2) {
+ complexValue.put(tVal[0], AttributeUtil.unescape(tVal[1]));
+ }
+ }
+ return complexValue;
+ }
+
+ /**
+ * Checks if value is complex or not
+ * @param values The values to check
+ * @return True if succesful
+ */
+ private boolean isComplexValue(final String[] values) {
+ boolean isComplex = false;
+ if (values.length > 0) {
+ final String[] tVal = values[0].split("=");
+ if (StringUtils.isNotEmpty(values[0]) && tVal.length == 2) {
+ isComplex = true;
+ }
+ }
+ return isComplex;
+ }
+
+ /**
+ * Validates and creates the attribute values.
+ *
+ * @param vals The attribute values.
+ *
+ * @return The {@link List} with the attribute values.
+ *
+ * @see List
+ */
+ private List<String> createValues(final String[] vals) {
+ final List<String> values = new ArrayList<String>();
+ for (final String val : vals) {
+ if (StringUtils.isNotEmpty(val)) {
+ values.add(AttributeUtil.unescape(val));
+ }
+ }
+ return values;
+ }
+
+ /**
+ * Converts the attribute tuple (attrName:attrType...) to the new format.
+ *
+ * @param tuples The attribute tuples to convert.
+ *
+ * @return The attribute tuples in the new format.
+ */
+ private String[] convertFormat(final String[] tuples) {
+ final String[] newFormatTuples =
+ new String[AttributeConstants.NUMBER_TUPLES.intValue()];
+ if (tuples != null) {
+ System.arraycopy(tuples, 0, newFormatTuples, 0, tuples.length);
+
+ for (int i = tuples.length; i < newFormatTuples.length; i++) {
+ if (i == AttributeConstants.ATTR_VALUE_INDEX.intValue()) {
+ newFormatTuples[i] = "[]";
+ } else {
+ newFormatTuples[i] = "";
+ }
+ }
+ }
+ return newFormatTuples;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the complex attributes contained in this map.
+ */
+ public IPersonalAttributeList getComplexAttributes() {
+ LOG.info("get complex attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(!attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding complex attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getSimpleValueAttributes() {
+ LOG.info("get simple attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding simple attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getMandatoryAttributes() {
+ return getAttributesByParam(true);
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the attributes in this map by parameter value.
+ *
+ * @param compareValue The boolean to get mandatory (true) or optional (false) attributes.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map if compareValue is true or optional otherwise.
+ */
+ private IPersonalAttributeList getAttributesByParam(final boolean compareValue) {
+ LOG.info("get attributes by param :"+compareValue);
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.isRequired() == compareValue) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ public IPersonalAttributeList getOptionalAttributes() {
+ return getAttributesByParam(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasMissingValues() {
+ for(PersonalAttribute attr: this) {
+ if(attr.isEmptyValue() && attr.isEmptyComplexValue()) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
new file mode 100644
index 000000000..07f178ecc
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
@@ -0,0 +1,447 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+public class STORKAttrQueryRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAttrQueryRequest</tt> instance.
+ *
+ * @return The copy of this STORKAttrQueryRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAttrQueryRequest storkAttrQueryReq = null;
+ storkAttrQueryReq = (STORKAttrQueryRequest) super.clone();
+ storkAttrQueryReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAttrQueryReq.setTokenSaml(getTokenSaml());
+ return storkAttrQueryReq;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
new file mode 100644
index 000000000..7bec86d17
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+public class STORKAttrQueryResponse implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 7653893041391541235L;
+
+/** Response Id. */
+ private String samlId;
+
+ /** Request failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** The complete assertion **/
+ private Assertion assertion;
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /** Citizen's personal attribute list. */
+ private transient IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ /** Get the assertion from the response **/
+ public Assertion getAssertion() {
+ return assertion;
+ }
+
+ /** Set the assertion in the response **/
+ public void setAssertion(final Assertion nAssertion) {
+ this.assertion = nAssertion;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
new file mode 100644
index 000000000..2354d0eb1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
@@ -0,0 +1,495 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnRequest (SAML Token Request).
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.21 $, $Date: 2011-02-17 22:44:34 $
+ */
+public final class STORKAuthnRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The destination. */
+ private String destination;
+
+ /** The provider name. */
+ private String providerName;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The provider name value.
+ */
+ public String getProviderName() {
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param samlProvider the provider name value.
+ */
+ public void setProviderName(final String samlProvider) {
+ this.providerName = samlProvider;
+ }
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAuthnRequest</tt> instance.
+ *
+ * @return The copy of this STORKAuthnRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAuthnRequest storkAuthnReq = null;
+ try {
+ storkAuthnReq = (STORKAuthnRequest) super.clone();
+ storkAuthnReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAuthnReq.setTokenSaml(getTokenSaml());
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+
+ return storkAuthnReq;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
new file mode 100644
index 000000000..cab723837
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
@@ -0,0 +1,395 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnResponse.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class STORKAuthnResponse implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -9100982727074068660L;
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Authentication failed?. */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** Citizen's personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** List of all assertions in response *. */
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions *. */
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists *. */
+ private List<IPersonalAttributeList> attributeLists;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ /**
+ * Sets the assertions.
+ *
+ * @param newAssert the new assertions
+ */
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ /**
+ * Gets the assertions.
+ *
+ * @return the assertions
+ */
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists.
+ *
+ * @return The lists
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrLists the new personal attribute lists
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
new file mode 100644
index 000000000..a02002d93
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
@@ -0,0 +1,197 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutRequest implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** The ID of principal as known to SP **/
+ private String spProvidedId;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /** Getter for spProvidedId **/
+ public String getSpProvidedId() {
+ return spProvidedId;
+ }
+
+ public void setSpProvidedId(final String nSpProvidedId) {
+ this.spProvidedId = nSpProvidedId;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutRequest storkLogoutRequest = null;
+ storkLogoutRequest = (STORKLogoutRequest) super.clone();
+ storkLogoutRequest.setTokenSaml(getTokenSaml());
+ return storkLogoutRequest;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
new file mode 100644
index 000000000..2686727db
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
@@ -0,0 +1,250 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutResponse implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Status message. */
+ private String statusMessage;
+
+ /** Logout failed? */
+ private boolean fail;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Setter for the statusMessage value.
+ *
+ * @param status the new statusMessage value.
+ */
+ public void setStatusMessage(final String status) {
+ this.statusMessage = status;
+ }
+
+ /**
+ * Getter for the statusMessage value.
+ *
+ * @return The statusMessage value.
+ */
+ public String getStatusMessage() {
+ return statusMessage;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutResponse storkLogoutResponse = null;
+ storkLogoutResponse = (STORKLogoutResponse) super.clone();
+ storkLogoutResponse.setTokenSaml(getTokenSaml());
+ return storkLogoutResponse;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
new file mode 100644
index 000000000..a9c4a156b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
@@ -0,0 +1,68 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKStatusCode {
+
+ /** URI for Requester status code. */
+ REQUESTER_URI("urn:oasis:names:tc:SAML:2.0:status:Requester"),
+
+ /** URI for Responder status code. */
+ RESPONDER_URI("urn:oasis:names:tc:SAML:2.0:status:Responder"),
+
+ /** URI for Success status code. */
+ SUCCESS_URI("urn:oasis:names:tc:SAML:2.0:status:Success"),
+
+ /** Attribute is Available. */
+ STATUS_AVAILABLE("Available"),
+
+ /** Attribute is NotAvailable. */
+ STATUS_NOT_AVAILABLE("NotAvailable"),
+
+ /** Attribute is Withheld. */
+ STATUS_WITHHELD("Withheld");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
new file mode 100644
index 000000000..0a711c9b7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
@@ -0,0 +1,71 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Sub Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.7 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKSubStatusCode {
+
+ /** URI for AuthnFailed status code. */
+ AUTHN_FAILED_URI("urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"),
+
+ /** URI for InvalidAttrNameOrValue status code. */
+ INVALID_ATTR_NAME_VALUE_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"),
+
+ /** URI for InvalidNameIDPolicy status code. */
+ INVALID_NAMEID_POLICY_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"),
+
+ /** URI for VersionMismatch status code. */
+ VERSION_MISMATCH_URI("urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"),
+
+ /** URI for RequestDenied status code. */
+ REQUEST_DENIED_URI("urn:oasis:names:tc:SAML:2.0:status:RequestDenied"),
+
+ /** URI for QaaNotSupported status code. */
+ QAA_NOT_SUPPORTED(
+ "http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKSubStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops
new file mode 100644
index 000000000..14f05b17c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops
@@ -0,0 +1,53 @@
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions
+END
+InvalidParameterPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
+END
+SecurityPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 123
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
+END
+InvalidSessionPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 129
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
+END
+CPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 116
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
+END
+StorkPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 120
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
+END
+AbstractPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 123
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
+END
+InternalErrorPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 128
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries
new file mode 100644
index 000000000..06755237e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries
@@ -0,0 +1,300 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+InternalErrorPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+36d8f6310e84c550f65bef78d5dc4238
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2471
+
+InvalidParameterPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+c6ad53378b03a346ca0fc48a381ed771
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1800
+
+SecurityPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+78d50b78a69cb0c630e4e14420e3b7be
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2199
+
+InvalidSessionPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+5fd7f04ad6f6cc121084e682b2a4e678
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1555
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+7055c01b74382c525c7fcf110646d8fc
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+129
+
+CPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+5d3cb4a7303baeaf2104aaa7da301b21
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3570
+
+StorkPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+fea01f750728ea5f15b449acb517f4b2
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1690
+
+AbstractPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+c9aedb030e6dbc9f002c7cd3d52cf03f
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4422
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base
new file mode 100644
index 000000000..e9a96d7c2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base
@@ -0,0 +1,173 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+import java.io.Serializable;
+
+/**
+ * Abstract class to represent the various PEPS exceptions.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public abstract class AbstractPEPSException extends RuntimeException implements
+ Serializable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -1884417567740138022L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public AbstractPEPSException(final String code, final String message) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with the errorMessage as parameters and the Throwable
+ * cause.
+ *
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final Throwable cause) {
+
+ super(message, cause);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with three Strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final String samlToken) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Constructor with SAML Token as argument. Error message and error code are
+ * embedded in the SAML.
+ *
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String samlToken) {
+ super();
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Getter for errorCode.
+ *
+ * @return The errorCode value.
+ */
+ public final String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for errorCode.
+ *
+ * @param code The error code value.
+ */
+ public final void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for errorMessage.
+ *
+ * @return The error Message value.
+ */
+ public final String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for errorMessage.
+ *
+ * @param message The error message value.
+ */
+ public final void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for SAMLTokenFail.
+ *
+ * @return The error SAML Token.
+ */
+ public final String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for SAMLTokenFail.
+ *
+ * @param samlToken The error SAML token.
+ */
+ public final void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base
new file mode 100644
index 000000000..69cb20fdd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base
@@ -0,0 +1,143 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * This exception is thrown by the C-PEPS service and holds the relative
+ * information to present to the citizen.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CPEPSException extends RuntimeException {
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = -4012295047127999362L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message) {
+
+ super(message);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The original exception;
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+ return this.getErrorMessage() + " (" + this.getErrorCode() + ")";
+ }
+
+ /**
+ * Getter for the error code.
+ *
+ * @return The errorCode value.
+ */
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for the error code.
+ *
+ * @param code The error code.
+ */
+ public void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for the error message.
+ *
+ * @return The errorMessage value.
+ */
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for the error message.
+ *
+ * @param message The error message.
+ */
+ public void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for the samlTokenFail.
+ *
+ * @return The samlTokenFail value.
+ */
+ public String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for the samlTokenFail.
+ *
+ * @param samlToken The error Saml Token.
+ */
+ public void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base
new file mode 100644
index 000000000..67514d4fe
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base
@@ -0,0 +1,74 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Internal Error Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class InternalErrorPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 1193001455410319795L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with three strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final String samlTokenFail) {
+
+ super(errorCode, errorMessage, samlTokenFail);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base
new file mode 100644
index 000000000..12c83b589
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base
@@ -0,0 +1,54 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid Parameter Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.11 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidParameterPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2046282148740524875L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error code message value.
+ */
+ public InvalidParameterPEPSException(final String errorCode,
+ final String errorMessage) {
+ super(errorCode, errorMessage);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InvalidParameterPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base
new file mode 100644
index 000000000..800525eee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base
@@ -0,0 +1,46 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid session Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.14 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidSessionPEPSException extends InvalidParameterPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7147090160978319016L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InvalidSessionPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base
new file mode 100644
index 000000000..fc27371d2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base
@@ -0,0 +1,67 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.18 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class SecurityPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 5605743302478554967L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public SecurityPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public SecurityPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public SecurityPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base
new file mode 100644
index 000000000..a2da61a02
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base
@@ -0,0 +1,53 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class StorkPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8048033129798427574L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public StorkPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+
+ return "Security Error (" + this.getErrorCode() + ") processing request : "
+ + this.getErrorMessage();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..1a3c57329
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,7 @@
+/**
+ * Package for the PEPS’ Exceptions handling.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
new file mode 100644
index 000000000..e9a96d7c2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
@@ -0,0 +1,173 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+import java.io.Serializable;
+
+/**
+ * Abstract class to represent the various PEPS exceptions.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public abstract class AbstractPEPSException extends RuntimeException implements
+ Serializable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -1884417567740138022L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public AbstractPEPSException(final String code, final String message) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with the errorMessage as parameters and the Throwable
+ * cause.
+ *
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final Throwable cause) {
+
+ super(message, cause);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with three Strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final String samlToken) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Constructor with SAML Token as argument. Error message and error code are
+ * embedded in the SAML.
+ *
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String samlToken) {
+ super();
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Getter for errorCode.
+ *
+ * @return The errorCode value.
+ */
+ public final String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for errorCode.
+ *
+ * @param code The error code value.
+ */
+ public final void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for errorMessage.
+ *
+ * @return The error Message value.
+ */
+ public final String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for errorMessage.
+ *
+ * @param message The error message value.
+ */
+ public final void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for SAMLTokenFail.
+ *
+ * @return The error SAML Token.
+ */
+ public final String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for SAMLTokenFail.
+ *
+ * @param samlToken The error SAML token.
+ */
+ public final void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
new file mode 100644
index 000000000..69cb20fdd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
@@ -0,0 +1,143 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * This exception is thrown by the C-PEPS service and holds the relative
+ * information to present to the citizen.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CPEPSException extends RuntimeException {
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = -4012295047127999362L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message) {
+
+ super(message);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The original exception;
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+ return this.getErrorMessage() + " (" + this.getErrorCode() + ")";
+ }
+
+ /**
+ * Getter for the error code.
+ *
+ * @return The errorCode value.
+ */
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for the error code.
+ *
+ * @param code The error code.
+ */
+ public void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for the error message.
+ *
+ * @return The errorMessage value.
+ */
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for the error message.
+ *
+ * @param message The error message.
+ */
+ public void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for the samlTokenFail.
+ *
+ * @return The samlTokenFail value.
+ */
+ public String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for the samlTokenFail.
+ *
+ * @param samlToken The error Saml Token.
+ */
+ public void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
new file mode 100644
index 000000000..67514d4fe
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
@@ -0,0 +1,74 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Internal Error Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class InternalErrorPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 1193001455410319795L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with three strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final String samlTokenFail) {
+
+ super(errorCode, errorMessage, samlTokenFail);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
new file mode 100644
index 000000000..12c83b589
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
@@ -0,0 +1,54 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid Parameter Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.11 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidParameterPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2046282148740524875L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error code message value.
+ */
+ public InvalidParameterPEPSException(final String errorCode,
+ final String errorMessage) {
+ super(errorCode, errorMessage);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InvalidParameterPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
new file mode 100644
index 000000000..800525eee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
@@ -0,0 +1,46 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid session Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.14 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidSessionPEPSException extends InvalidParameterPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7147090160978319016L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InvalidSessionPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
new file mode 100644
index 000000000..fc27371d2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
@@ -0,0 +1,67 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.18 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class SecurityPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 5605743302478554967L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public SecurityPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public SecurityPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public SecurityPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
new file mode 100644
index 000000000..a2da61a02
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
@@ -0,0 +1,53 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class StorkPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8048033129798427574L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public StorkPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+
+ return "Security Error (" + this.getErrorCode() + ") processing request : "
+ + this.getErrorMessage();
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
new file mode 100644
index 000000000..1a3c57329
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
@@ -0,0 +1,7 @@
+/**
+ * Package for the PEPS’ Exceptions handling.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
new file mode 100644
index 000000000..58ee7bcac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
@@ -0,0 +1,9 @@
+/**
+ * Common Authentication Service functionalities to be deployed in every PEPS
+ * is contained in this package.
+ * In particular, it contains the SAML Engine that implements the SAML messages
+ * management
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons;
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops
new file mode 100644
index 000000000..3cd5d5378
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops
@@ -0,0 +1,41 @@
+K 25
+svn:wc:ra_dav:version-url
+V 87
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific
+END
+IDeriveAttribute.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
+END
+IAUService.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
+END
+INormaliseValue.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
+END
+ITranslatorService.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 104
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
+END
+ICheckAttributeValue.java
+K 25
+svn:wc:ra_dav:version-url
+V 112
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries
new file mode 100644
index 000000000..1dfa9b9fc
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries
@@ -0,0 +1,232 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/specific
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+IDeriveAttribute.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+dce3856a97583f739cdf50ca78491277
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1504
+
+IAUService.java
+file
+
+
+
+
+2014-01-21T08:38:55.228702Z
+b622aaaa29b0cd72261ca7799db691b9
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7023
+
+INormaliseValue.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+09f6e376875762fca294be4dfecb71f1
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1237
+
+ITranslatorService.java
+file
+
+
+
+
+2014-01-21T08:38:55.228702Z
+c027ed5506150c744b8e586b325de5fb
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3120
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+eef7721d55c2edb02a432fc08ae9e487
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+164
+
+ICheckAttributeValue.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+b0472ff15d1c86f175da134b0f0eda71
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1321
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base
new file mode 100644
index 000000000..5c24cc5a8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base
@@ -0,0 +1,215 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.Map;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+
+/**
+ * Interface for Specific Authentication methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IAUService {
+
+ /**
+ * Prepares the citizen to be redirected to the IdP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareCitizenAuthentication(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Prepares the citizen to be redirected to the PV.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] preparePVRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Authenticates a citizen.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList authenticateCitizen(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Validates a power.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List (power validated).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList powerValidation(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Prepares the Citizen browser to be redirected to the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return true in case of no error.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean prepareAPRedirect(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Returns the attributes values from the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The request attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList getAttributesFromAttributeProviders(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Get the attributes from the AP with verification.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The HTTP Parameters.
+ * @param requestAttributes The requested Attributes.
+ * @param session The session object.
+ * @param auProcessId The SAML identifier.
+ *
+ * @return true if the attributes were correctly verified.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean getAttributesWithVerification(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session, String auProcessId);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAuthnResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAuthnResponse processAuthenticationResponse(byte[] samlToken,
+ IStorkSession session);
+
+ /**
+ * Generates a SAML Response in case of error.
+ *
+ * @param inResponseTo The SAML's identifier to response.
+ * @param issuer The issuer value.
+ * @param assertionURL The assertion URL.
+ * @param code The error code.
+ * @param subcode The sub error code.
+ * @param message The error message.
+ * @param ipUserAddress The user IP address.
+ *
+ * @return byte[] containing the SAML Response.
+ */
+ byte[] generateErrorAuthenticationResponse(String inResponseTo,
+ String issuer, String assertionURL, String code, String subcode,
+ String message, String ipUserAddress);
+
+ /**
+ * Compares two given personal attribute lists.
+ *
+ * @param original The original Personal Attribute List.
+ * @param modified The modified Personal Attribute List.
+ * @return true if the original list contains the modified one. False
+ * otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean comparePersonalAttributeLists(IPersonalAttributeList original,
+ IPersonalAttributeList modified);
+
+ /**
+ * Prepares the citizen to be redirected to the AtP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareAttributeRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, IStorkSession session);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAttrQueryResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAttrQueryResponse processAttributeResponse(byte[] samlToken,
+ IStorkSession session);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base
new file mode 100644
index 000000000..31a8d78ff
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base
@@ -0,0 +1,37 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.List;
+
+/**
+ * Interface that defines the methods to work with the validation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ICheckAttributeValue {
+
+ /**
+ * Checks if the list of values contains the expected value.
+ *
+ * @param values The List of values.
+ * @param expectedValue The value to check if it exists on the list.
+ *
+ * @return boolean true, if the value is present in the list. False,
+ * otherwise.
+ */
+ boolean checkValue(List<String> values, String expectedValue);
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base
new file mode 100644
index 000000000..78eb53004
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base
@@ -0,0 +1,40 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface that defines the methods to work with derivation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IDeriveAttribute {
+
+ /**
+ * Derives the attribute value. Set the Personal Attribute value to null if
+ * the value in session or the value of age are invalid (non-numeric or null).
+ *
+ * @param personalAttrList The Personal Attribute List.
+ * @param session The session object.
+ *
+ * @see PersonalAttribute The personal Attribute
+ * @see IStorkSession The session object.
+ */
+ void deriveAttributeToData(PersonalAttribute personalAttrList,
+ IStorkSession session);
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base
new file mode 100644
index 000000000..ca2114e32
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base
@@ -0,0 +1,35 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface for attribute's value normalisation.
+ *
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface INormaliseValue {
+
+ /**
+ * Translates the attribute's value from local format to STORK format.
+ *
+ * @param personalAttribute The Personal Attribute to normalise the value.
+ *
+ * @see PersonalAttribute
+ */
+ void normaliseAttributeValueToStork(PersonalAttribute personalAttribute);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base
new file mode 100644
index 000000000..8a33897d8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base
@@ -0,0 +1,100 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+
+/**
+ * Interface for attributes normalization.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ITranslatorService {
+
+ /**
+ * Translates the attributes from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The Personal Attribute List with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes values from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised values.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeValuesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes from STORK format to local format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names To Stork format.
+ *
+ * @param personalList The Personal Attribute List,
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names from Stork format.
+ *
+ * @param session The session object.
+ * @param modifiedList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IStorkSession
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeToStork(IStorkSession session,
+ IPersonalAttributeList modifiedList);
+
+ /**
+ * Validate the values of the attributes.
+ *
+ * @param pal The attribute list
+ *
+ * @return True, if all the attributes have values. False, otherwise.
+ *
+ * @see STORKAuthnRequest
+ */
+ boolean checkAttributeValues(IPersonalAttributeList pa);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..7b2fac5ef
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,8 @@
+/**
+ * Specific PEPS Interfaces that implements functionality of the Authentication
+ * Service.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.specific;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
new file mode 100644
index 000000000..5c24cc5a8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
@@ -0,0 +1,215 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.Map;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+
+/**
+ * Interface for Specific Authentication methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IAUService {
+
+ /**
+ * Prepares the citizen to be redirected to the IdP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareCitizenAuthentication(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Prepares the citizen to be redirected to the PV.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] preparePVRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Authenticates a citizen.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList authenticateCitizen(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Validates a power.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List (power validated).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList powerValidation(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Prepares the Citizen browser to be redirected to the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return true in case of no error.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean prepareAPRedirect(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Returns the attributes values from the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The request attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList getAttributesFromAttributeProviders(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Get the attributes from the AP with verification.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The HTTP Parameters.
+ * @param requestAttributes The requested Attributes.
+ * @param session The session object.
+ * @param auProcessId The SAML identifier.
+ *
+ * @return true if the attributes were correctly verified.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean getAttributesWithVerification(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session, String auProcessId);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAuthnResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAuthnResponse processAuthenticationResponse(byte[] samlToken,
+ IStorkSession session);
+
+ /**
+ * Generates a SAML Response in case of error.
+ *
+ * @param inResponseTo The SAML's identifier to response.
+ * @param issuer The issuer value.
+ * @param assertionURL The assertion URL.
+ * @param code The error code.
+ * @param subcode The sub error code.
+ * @param message The error message.
+ * @param ipUserAddress The user IP address.
+ *
+ * @return byte[] containing the SAML Response.
+ */
+ byte[] generateErrorAuthenticationResponse(String inResponseTo,
+ String issuer, String assertionURL, String code, String subcode,
+ String message, String ipUserAddress);
+
+ /**
+ * Compares two given personal attribute lists.
+ *
+ * @param original The original Personal Attribute List.
+ * @param modified The modified Personal Attribute List.
+ * @return true if the original list contains the modified one. False
+ * otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean comparePersonalAttributeLists(IPersonalAttributeList original,
+ IPersonalAttributeList modified);
+
+ /**
+ * Prepares the citizen to be redirected to the AtP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareAttributeRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, IStorkSession session);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAttrQueryResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAttrQueryResponse processAttributeResponse(byte[] samlToken,
+ IStorkSession session);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
new file mode 100644
index 000000000..31a8d78ff
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
@@ -0,0 +1,37 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.List;
+
+/**
+ * Interface that defines the methods to work with the validation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ICheckAttributeValue {
+
+ /**
+ * Checks if the list of values contains the expected value.
+ *
+ * @param values The List of values.
+ * @param expectedValue The value to check if it exists on the list.
+ *
+ * @return boolean true, if the value is present in the list. False,
+ * otherwise.
+ */
+ boolean checkValue(List<String> values, String expectedValue);
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
new file mode 100644
index 000000000..78eb53004
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
@@ -0,0 +1,40 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface that defines the methods to work with derivation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IDeriveAttribute {
+
+ /**
+ * Derives the attribute value. Set the Personal Attribute value to null if
+ * the value in session or the value of age are invalid (non-numeric or null).
+ *
+ * @param personalAttrList The Personal Attribute List.
+ * @param session The session object.
+ *
+ * @see PersonalAttribute The personal Attribute
+ * @see IStorkSession The session object.
+ */
+ void deriveAttributeToData(PersonalAttribute personalAttrList,
+ IStorkSession session);
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
new file mode 100644
index 000000000..ca2114e32
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
@@ -0,0 +1,35 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface for attribute's value normalisation.
+ *
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface INormaliseValue {
+
+ /**
+ * Translates the attribute's value from local format to STORK format.
+ *
+ * @param personalAttribute The Personal Attribute to normalise the value.
+ *
+ * @see PersonalAttribute
+ */
+ void normaliseAttributeValueToStork(PersonalAttribute personalAttribute);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
new file mode 100644
index 000000000..8a33897d8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
@@ -0,0 +1,100 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+
+/**
+ * Interface for attributes normalization.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ITranslatorService {
+
+ /**
+ * Translates the attributes from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The Personal Attribute List with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes values from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised values.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeValuesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes from STORK format to local format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names To Stork format.
+ *
+ * @param personalList The Personal Attribute List,
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names from Stork format.
+ *
+ * @param session The session object.
+ * @param modifiedList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IStorkSession
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeToStork(IStorkSession session,
+ IPersonalAttributeList modifiedList);
+
+ /**
+ * Validate the values of the attributes.
+ *
+ * @param pal The attribute list
+ *
+ * @return True, if all the attributes have values. False, otherwise.
+ *
+ * @see STORKAuthnRequest
+ */
+ boolean checkAttributeValues(IPersonalAttributeList pa);
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
new file mode 100644
index 000000000..7b2fac5ef
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
@@ -0,0 +1,8 @@
+/**
+ * Specific PEPS Interfaces that implements functionality of the Authentication
+ * Service.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.specific;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/all-wcprops
new file mode 100644
index 000000000..48074222b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/resources
+END
+log4j.xml
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/resources/log4j.xml
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/entries b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/entries
new file mode 100644
index 000000000..4e038b836
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/resources
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+log4j.xml
+file
+
+
+
+
+2013-12-20T12:27:56.554475Z
+aa8c46e41a236b8c7049713b3eeecc49
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+660
+
diff --git a/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base
new file mode 100644
index 000000000..8bce0bec0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="/opt/storklogs/stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/legacy-backup/stork2-commons/src/main/resources/log4j.xml b/id/server/legacy-backup/stork2-commons/src/main/resources/log4j.xml
new file mode 100644
index 000000000..8bce0bec0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/main/resources/log4j.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="/opt/storklogs/stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/legacy-backup/stork2-commons/src/test/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/.svn/all-wcprops
new file mode 100644
index 000000000..48b797f41
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/.svn/entries
new file mode 100644
index 000000000..20b446883
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+java
+dir
+
+resources
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/java/.svn/all-wcprops
new file mode 100644
index 000000000..6957eb776
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/java/.svn/entries
new file mode 100644
index 000000000..ae019ed10
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+eu
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/all-wcprops
new file mode 100644
index 000000000..51a31d6f6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/entries
new file mode 100644
index 000000000..f649532fd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+stork
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops
new file mode 100644
index 000000000..dece991f4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/entries
new file mode 100644
index 000000000..ed1d5001e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+peps
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops
new file mode 100644
index 000000000..57300d6a5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/entries
new file mode 100644
index 000000000..5908857a7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork/peps
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+tests
+dir
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops
new file mode 100644
index 000000000..0bc94ebcd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops
@@ -0,0 +1,53 @@
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps/tests
+END
+PersonalAttributeTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/package-info.java
+END
+DateUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
+END
+AttributeProvidersMapTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
+END
+AttributeUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
+END
+PersonalAttributeListTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
+END
+AttributeSourceTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
+END
+PEPSUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries
new file mode 100644
index 000000000..8a8c64359
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries
@@ -0,0 +1,300 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork/peps/tests
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+AttributeSourceTestCase.java
+file
+
+
+
+
+2014-01-21T08:38:55.140702Z
+28eeedf050cdff69d4d2cca83a98bcc8
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2363
+
+PEPSUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+f54beadeab9af936f44af326eb1116d2
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16714
+
+PersonalAttributeTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+77386880d5ffadd21c9b3a3c7d51b990
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5449
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+04f136539bda0caa3d5ccdfee912cfce
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+92
+
+DateUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+244cc6104660a7835dbf72dadb305d71
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8907
+
+AttributeProvidersMapTestCase.java
+file
+
+
+
+
+2014-01-21T08:38:55.140702Z
+943e143bcc0ee8e573997e358859d6f2
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3809
+
+AttributeUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+6037f125adf7f4c2f6873a0d99ab0705
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16318
+
+PersonalAttributeListTestCase.java
+file
+
+
+
+
+2014-01-21T08:38:55.140702Z
+ae552dce95a6b83d15e381306e2f5e59
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+24508
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base
new file mode 100644
index 000000000..782b3d02d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base
@@ -0,0 +1,134 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeProvidersMap;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+import eu.stork.peps.auth.commons.IAttributeProvidersMap;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public class AttributeProvidersMapTestCase {
+
+ @Test
+ public void testObjectOK1() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK2() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ if ( map.get(source)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK3() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK4() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ if ( map.get(target)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectNOK1() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+
+ @Test
+ public void testObjectNOK2() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base
new file mode 100644
index 000000000..96b2c8317
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base
@@ -0,0 +1,88 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeSourceTestCase {
+ private AttributeSource ap1 = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL1");
+ private AttributeSource ap2 = new AttributeSource(new AttributeProvider("ID2", "Name 2"), "URL2");
+ private AttributeSource ap3 = new AttributeSource(new AttributeProvider("ID1", "Name 2"), "URL2");
+ private AttributeSource ap4 = new AttributeSource(new AttributeProvider("ID1", "Name 2"), "URL1");
+ private AttributeSource ap5 = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL1");
+
+ private AttributeSource c1 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+ private AttributeSource c2 = new AttributeSource(new Country("ID2", "Name 2"), "URL2");
+ private AttributeSource c3 = new AttributeSource(new Country("ID1", "Name 2"), "URL2");
+ private AttributeSource c4 = new AttributeSource(new Country("ID1", "Name 2"), "URL1");
+ private AttributeSource c5 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+
+ @Test
+ public void testNotEquals1() {
+ assertFalse(ap1.equals(ap2));
+ }
+
+ @Test
+ public void testNotEquals2() {
+ assertFalse(ap1.equals(c1));
+ }
+
+ @Test
+ public void testNotEquals3() {
+ assertFalse(c1.equals(c2));
+ }
+
+ @Test
+ public void testEquals1() {
+ assertTrue(ap1.equals(ap3));
+ }
+
+ @Test
+ public void testEquals2() {
+ assertTrue(ap1.equals(ap4));
+ }
+
+ @Test
+ public void testEquals3() {
+ assertTrue(ap1.equals(ap5));
+ }
+
+ @Test
+ public void testEquals4() {
+ assertTrue(c1.equals(c3));
+ }
+
+ @Test
+ public void testEquals5() {
+ assertTrue(c1.equals(c4));
+ }
+
+ @Test
+ public void testEquals6() {
+ assertTrue(c1.equals(c5));
+ }
+
+ @Test
+ public void testEquals7() {
+ Object obj = ap5;
+ assertTrue(ap1.equals(obj));
+ }
+
+ @Test
+ public void testEquals8() {
+ Object obj = c5;
+ assertTrue(c1.equals(obj));
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base
new file mode 100644
index 000000000..77fc4b9c2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base
@@ -0,0 +1,537 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeUtil;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSValues;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeUtilTestCase {
+
+ /**
+ * Empty String to be used on the tests.
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * Tuple value sample to be used on the tests.
+ */
+ private static final String[] TUPLE_STRING = new String[] { "age", "true",
+ "[18]", "Available" };
+
+ /**
+ * Complex value to be used on escape/unescape tests.
+ */
+ private static final String COMPLEX_VAL = "postalCode=4100,"
+ + "apartmentNumber=A,state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,";
+
+ /**
+ * Escaped Complex value to be used on escape/unescape tests.
+ */
+ private static final String ESC_COMPLEX_VAL = "postalCode=4100%44"
+ + "apartmentNumber=A%44state=Porto%44countryCodeAddress=PT%44"
+ + "streetNumber=379%44streetName=Avenida Sidonio Pais%44town=Porto%44";
+
+ /**
+ * Simple value to be used on escape/unescape tests.
+ */
+ private static final String SIMPLE_VAL = "Avenida da Boavista, Porto";
+
+ /**
+ * Escaped simple value to be used on escape/unescape tests.
+ */
+ private static final String ESC_SIMPLE_VAL = "Avenida da Boavista%44 Porto";
+
+ /**
+ * Simple text to be used on escape/unescape tests. Must match the escaped
+ * text.
+ */
+ private static final String SIMPLE_TEXT = "John Doe";
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given complex
+ * attribute value (canonical address' example attribute value).
+ */
+ @Test
+ public void testEscapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.escape(COMPLEX_VAL), ESC_COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given
+ * attribute value.
+ */
+ @Test
+ public void testEscapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.escape(SIMPLE_VAL), ESC_SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to escape.
+ */
+ @Test
+ public void testEscapeNormalChars() {
+ assertEquals(AttributeUtil.escape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#unescape(String)} method for the given
+ * escape complex attribute value (canonical address' example attribute
+ * value).
+ */
+ @Test
+ public void testUnescapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.unescape(ESC_COMPLEX_VAL), COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given escape
+ * attribute value.
+ */
+ @Test
+ public void testUnescapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.unescape(ESC_SIMPLE_VAL), SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to unescape.
+ */
+ @Test
+ public void testUnescapeNormalChars() {
+ assertEquals(AttributeUtil.unescape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given empty string.
+ */
+ @Test
+ public void testAppendIfNotNullEmptyStr() {
+ final StringBuilder strBuilder = new StringBuilder(SIMPLE_TEXT);
+ AttributeUtil.appendIfNotNull(strBuilder, EMPTY_STRING);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given string.
+ */
+ @Test
+ public void testAppendIfNotNullStr() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, SIMPLE_TEXT);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given null value.
+ */
+ @Test
+ public void testAppendIfNotNull() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, null);
+ assertEquals(strBuilder.toString(), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with two values.
+ */
+ @Test
+ public void testListToStringTwoVals() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+ vals.add(SIMPLE_TEXT);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one values.
+ */
+ @Test
+ public void testListToStringOneVal() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one value.
+ */
+ @Test
+ public void testListToStringEmptyVal() {
+ final List<String> vals = new ArrayList<String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given Map with one value.
+ */
+ @Test
+ public void testMapToStringOneVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+ vals.put("CanonicalAddress", COMPLEX_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("CanonicalAddress=");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given empty Map.
+ */
+ @Test
+ public void testMapToStringEmptyVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid List.
+ */
+ @Test
+ public void testIsValidValueInvalidList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * null value.
+ */
+ @Test
+ public void testIsValidValueNullList() {
+ assertFalse(AttributeUtil.isValidValue(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyList() {
+ assertTrue(AttributeUtil.isValidValue("[]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyCommaList() {
+ assertTrue(AttributeUtil.isValidValue("[,]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * multi value List.
+ */
+ @Test
+ public void testIsValidValueMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid multi value List.
+ */
+ @Test
+ public void testIsValidValueInvalidMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * true type.
+ */
+ @Test
+ public void testIsValidTypetrue() {
+ assertTrue(AttributeUtil.isValidType("true"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * True type.
+ */
+ @Test
+ public void testIsValidTypeTrue() {
+ assertTrue(AttributeUtil.isValidType("True"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * TRUE type.
+ */
+ @Test
+ public void testIsValidTypeTRUE() {
+ assertTrue(AttributeUtil.isValidType("TRUE"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * invalid type.
+ */
+ @Test
+ public void testIsValidTypeInvalidType() {
+ assertFalse(AttributeUtil.isValidType("str"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * false type.
+ */
+ @Test
+ public void testIsValidTypefalse() {
+ assertTrue(AttributeUtil.isValidType("false"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * False type.
+ */
+ @Test
+ public void testIsValidTypeFalse() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * FALSE type.
+ */
+ @Test
+ public void testIsValidTypeFALSEVal() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * null.
+ */
+ @Test
+ public void testIsValidTypeNullVal() {
+ assertFalse(AttributeUtil.isValidType(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given valid tuple.
+ */
+ @Test
+ public void testHasValidTuples() {
+ assertTrue(AttributeUtil.hasValidTuples(TUPLE_STRING));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple.
+ */
+ @Test
+ public void testHasValidTuplesInvalid() {
+ final String[] tuple = new String[]{"name", "type"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple with valid size.
+ */
+ @Test
+ public void testHasValidTuplesSameSizeInvalidValues() {
+ final String[] tuple = new String[] { "age", "type", "[18]", "Available"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given null value.
+ */
+ @Test
+ public void testHasValidTuplesNull() {
+ assertFalse(AttributeUtil.hasValidTuples(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list..
+ */
+ @Test
+ public void testCheckMandatoryAttributes() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[18,]:Available;");
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testCheckMandatoryAttributesNullAttrList() {
+ assertTrue(AttributeUtil.checkMandatoryAttributes(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given empty attribute list.
+ */
+ @Test
+ public void testCheckMandatoryAttributesEmptyAttrList() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list (missing mandatory attribute).
+ */
+ @Test
+ public void testCheckMandatoryAttributesMissingAttr() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[]:NotAvailable;");
+ assertFalse(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base
new file mode 100644
index 000000000..5d2296997
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base
@@ -0,0 +1,294 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.sql.Timestamp;
+import java.util.Properties;
+
+import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.DateUtil;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class DateUtilTestCase {
+
+ /**
+ * Stork Format date.
+ */
+ private static final String FORMAT = "yyyyMMdd";
+
+ /**
+ * Expected 10 value.
+ */
+ private static final int TEN = 10;
+
+ /**
+ * Expected 11 value.
+ */
+ private static final int ELEVEN = 11;
+
+ /**
+ * The testing Date ("current" date).
+ */
+ private static final DateTime TESTDATE = new DateTime(2011, 10, 10, 15, 20,
+ 0, 0);
+
+ /**
+ * Init DateUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Properties configs = new Properties();
+ configs.setProperty("invalidAgeDateValue.code", "35");
+ configs.setProperty("invalidAttributeValue.code", "34");
+ configs
+ .setProperty(
+ "invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ PEPSUtil.createInstance(configs);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year against
+ * the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromYear() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("2000", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyMonth() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("200001", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromSameMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200010", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyFullDate() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20000101", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromSameDay() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20001010", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterFullDate() {
+ Assert.assertTrue(TEN == DateUtil
+ .calculateAge("20001011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDate() {
+ DateUtil.calculateAge("200", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidMonth() {
+ DateUtil.calculateAge("200013", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDay() {
+ DateUtil.calculateAge("20000230", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullDate() {
+ DateUtil.calculateAge(null, TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullCurDate() {
+ DateUtil.calculateAge("2000", null, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullFormat() {
+ DateUtil.calculateAge("2000", TESTDATE, null);
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return true
+ */
+ @Test
+ public void isValidFormatDateFromYear() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("2000", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year and
+ * month. Must return true.
+ */
+ @Test
+ public void isValidFormatDateFromMonth() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("200001", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDate() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("20000101", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidYear() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidMonth() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200013", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("20010229", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate(null, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullFormat() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("2000", null));
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampBefore() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertNotSame(ts, DateUtil.currentTimeStamp());
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampAfter() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertEquals(DateUtil.currentTimeStamp(), ts);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base
new file mode 100644
index 000000000..d4841ed43
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base
@@ -0,0 +1,553 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSErrors;
+import eu.stork.peps.auth.commons.PEPSParameters;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * The PEPSUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class PEPSUtilTestCase {
+
+ /**
+ * Message example.
+ */
+ private static final String MESSAGE_SAMPLE = "003002 - Authentication Failed";
+
+ /**
+ * Error message example.
+ */
+ private static final String ERROR_MESSAGE_SAMPLE = "Authentication Failed";
+
+ /**
+ * Error code example.
+ */
+ private static final String ERROR_CODE_SAMPLE = "003002";
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS1 = new Properties();
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS2 = new Properties();
+
+ /**
+ * The empty string value: "".
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * The empty byte value: [].
+ */
+ private static final byte[] EMPTY_BYTE = new byte[] {};
+
+ /**
+ * The empty byte hash value.
+ */
+ private static final byte[] EMPTY_HASH_BYTE = new byte[] { -49, -125, -31,
+ 53, 126, -17, -72, -67, -15, 84, 40, 80, -42, 109, -128, 7, -42, 32, -28,
+ 5, 11, 87, 21, -36, -125, -12, -87, 33, -45, 108, -23, -50, 71, -48, -47,
+ 60, 93, -123, -14, -80, -1, -125, 24, -46, -121, 126, -20, 47, 99, -71, 49,
+ -67, 71, 65, 122, -127, -91, 56, 50, 122, -7, 39, -38, 62 };
+
+ /**
+ * The SAML example byte[] value.
+ */
+ private static final byte[] SAML_BYTE_SAMPLE = new byte[] { 60, 115, 97, 109,
+ 108, 62, 46, 46, 46, 60, 47, 115, 97, 109, 108 };
+
+ /**
+ * The SAML's Base64 example value.
+ */
+ private static final String SAML_BASE64_SAMPLE = "PHNhbWw+Li4uPC9zYW1s";
+
+ /**
+ * The SAML's Base64 byte[] example value.
+ */
+ private static byte[] SAML_BASE64_BYTE_SAMPLE = new byte[] { 80, 72, 78, 104,
+ 98, 87, 119, 43, 76, 105, 52, 117, 80, 67, 57, 122, 89, 87, 49, 115 };
+
+ /**
+ * The SAML's Base64 Hash byte[] example value.
+ */
+ private static byte[] HASH_BYTE_SAMPLE = new byte[] { 67, 38, 11, 115, 49,
+ -5, 54, -85, 38, 43, -99, 96, 71, -41, 50, -96, 71, -86, 90, -97, 66, -67,
+ 90, 101, 30, 82, -13, 60, -106, -72, -103, -75, 19, 2, -107, 107, -6, -56,
+ 34, -111, -44, -57, -26, -5, 33, 78, -1, 30, 21, 74, -26, 118, -46, -12,
+ -102, 12, -56, 30, -59, -104, -21, -42, -103, 82 };
+
+ /**
+ * Init PEPSUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+
+ CONFIGS1.setProperty("max.attrList.size", "20000");
+ CONFIGS1.setProperty("attrList.code", "202005");
+ CONFIGS1.setProperty("attrList.message", "invalid.attrList.parameter");
+
+ CONFIGS1.setProperty("max.qaaLevel.size", "1");
+ CONFIGS1.setProperty("max.spUrl.size", "inv");
+ CONFIGS1.setProperty("validation.active", "true");
+ CONFIGS1.setProperty("hashDigest.className",
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ CONFIGS1.setProperty("invalidAgeDateValue.code", "35");
+ CONFIGS1.setProperty("invalidAttributeValue.code", "34");
+ CONFIGS1.setProperty("invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#createInstance(Properties)} method for the given
+ * properties object.
+ */
+ @Test
+ public void testCreateInstance() {
+ Assert.assertNotNull(PEPSUtil.createInstance(CONFIGS2));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigs() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertEquals(pepsUtils.getConfigs(), CONFIGS1);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigsDifferent() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertNotSame(pepsUtils.getConfigs(), CONFIGS2);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given existing
+ * config.
+ */
+ @Test
+ public void testGetConfigExists() {
+ assertEquals(PEPSUtil.getConfig("hashDigest.className"),
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given not
+ * existing config.
+ */
+ @Test
+ public void testGetConfigNoExists() {
+ assertNull(PEPSUtil.getConfig("doesnt.exists"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given null
+ * value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testGetConfigNull() {
+ assertNull(PEPSUtil.getConfig(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExists() {
+ assertTrue(PEPSUtil.isValidParameter("qaaLevel", "1"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsGreat() {
+ assertFalse(PEPSUtil.isValidParameter("qaaLevel", "12"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsIvalidConf() {
+ assertFalse(PEPSUtil
+ .isValidParameter("spUrl", "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNotExists() {
+ assertFalse(PEPSUtil.isValidParameter("doesntexists",
+ "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamName() {
+ assertFalse(PEPSUtil.isValidParameter(null, "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamValue() {
+ assertFalse(PEPSUtil.isValidParameter("spUrl", null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given object values.
+ */
+ @Test
+ public void testValidateParameterValid() {
+ final IPersonalAttributeList persAttrList = new PersonalAttributeList();
+ persAttrList.populate("isAgeOver:true:[15,]:Available;");
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), persAttrList);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNull() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), null);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, String)} method
+ * for the given string values.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameter() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, PEPSErrors)}
+ * method for the given string value and {@link PEPSErrors} enum.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameterPEPSErrors() {
+ PEPSUtil.validateParameter("CountrySelectorAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;",
+ PEPSErrors.SP_COUNTRY_SELECTOR_INVALID_ATTR);
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test
+ public void testValidateParameterValidParams() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "10",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "doesnt.exists", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", null, "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", null,
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * string value.
+ */
+ @Test
+ public void testEncodeSAMLToken() {
+ assertEquals(PEPSUtil.encodeSAMLToken(SAML_BYTE_SAMPLE), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * null.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testEncodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.encodeSAMLToken(null), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * empty byte[] value.
+ */
+ @Test
+ public void testEncodeSAMLTokenEmpty() {
+ assertEquals(PEPSUtil.encodeSAMLToken(EMPTY_BYTE), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testDecodeSAMLToken() {
+ assertArrayEquals(PEPSUtil.decodeSAMLToken(SAML_BASE64_SAMPLE),
+ SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testDecodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.decodeSAMLToken(null), SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * empty string value.
+ */
+ @Test(expected = StringIndexOutOfBoundsException.class)
+ public void testDecodeSAMLTokenEmpty() {
+ assertTrue(PEPSUtil.decodeSAMLToken(EMPTY_STRING) == EMPTY_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testHashPersonalToken() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(SAML_BASE64_BYTE_SAMPLE),
+ HASH_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = InternalErrorPEPSException.class)
+ public void testHashPersonalTokenNull() {
+ assertNull(PEPSUtil.hashPersonalToken(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * empty value.
+ */
+ @Test
+ public void testHashPersonalTokenEmpty() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(EMPTY_BYTE), EMPTY_HASH_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * correct message.
+ */
+ @Test
+ public void testGetStorkErrorCodeExists() {
+ assertEquals(PEPSUtil.getStorkErrorCode(MESSAGE_SAMPLE), ERROR_CODE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNoExists() {
+ assertNull(PEPSUtil.getStorkErrorCode(ERROR_MESSAGE_SAMPLE));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * empty message.
+ */
+ @Test
+ public void testGetStorkErrorCodeEmpty() {
+ assertNull(PEPSUtil.getStorkErrorCode(EMPTY_STRING));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * null message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNull() {
+ assertNull(PEPSUtil.getStorkErrorCode(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("-"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepAndCodeFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("000001 -"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given correct message.
+ */
+ @Test
+ public void testGetStorkErrorMessageExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNoExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(ERROR_MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given empty message.
+ */
+ @Test
+ public void testGetStorkErrorMessageEmpty() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(EMPTY_STRING),
+ EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given null message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNull() {
+ assertNull(PEPSUtil.getStorkErrorMessage(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("-"),"-");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepAndCodeFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("000001 -"),"000001 -");
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base
new file mode 100644
index 000000000..7052b320a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base
@@ -0,0 +1,747 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttributeList's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-11-17 05:17:02 $
+ */
+public final class PersonalAttributeListTestCase {
+
+ /**
+ * isAgeOver constant value.
+ */
+ private static final String ISAGEOVER_CONS = "isAgeOver";
+
+ /**
+ * 1 constant value.
+ */
+ private static final int ONE_CONS = 1;
+
+ /**
+ * 2 constant value.
+ */
+ private static final int TWO_CONS = 2;
+
+ /**
+ * An empty attribute.
+ */
+ @SuppressWarnings("unused")
+ private static final PersonalAttributeList EMPTY_ATTR_LIST =
+ new PersonalAttributeList(0);
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST =
+ "isAgeOver:true:[15,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST2 =
+ "isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3 =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3_REVERSE =
+ "isAgeOver:true:[18,]:Available;isAgeOver:true:[15,]:Available;";
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String COMPLEX_ATTRLIST =
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=Ed. B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;";
+ /**
+ * Mix attribute list string.
+ */
+ private static final String STR_MIX_ATTR_LIST =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:"
+ + "Available;";
+
+ /**
+ * Mix attribute list 2 string.
+ */
+ private static final String STR_MIX_ATTR_LIST2 =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:Available;"
+ + "mandateContent:true:["
+ + "isJoint=\"isjoint\",typeOfPower=\"power\",ValidTo=\"validto\",validfrom=\"validfrom\",AQAA=\"3\",isChained=\"ischained\",]:"
+ + "Available;";
+
+ /**
+ * Attribute List example.
+ */
+ @SuppressWarnings({ "serial" })
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeListTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "Ed. B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testAddSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testAddCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testAddNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Simple Value.
+ */
+ @Test
+ public void testPutSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Complex Value.
+ */
+ @Test
+ public void testPutComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testPutNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put("", null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testGetSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertEquals(ATTR_VALUE, attrList.get(ATTR_VALUE.getName()));
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testGetCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertEquals(complexAttrValue.toString(),
+ attrList.get(complexAttrValue.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testGetIsAgeOverAttr() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST,
+ attrList.get(attrValueUnder.getName()).toString());
+ Assert.assertEquals(SIMPLE_ATTRLIST2,
+ attrList.get(attrValueOver.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple attribute.
+ */
+ @Test
+ public void testPopulateSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Complex attribute.
+ */
+ @Test
+ public void testPopulateComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple and Complex attribute.
+ */
+ @Test
+ public void testPopulateMixAttrs() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using put.
+ *
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromSimplePopulate() {
+ final String strAttrList = "isAgeOver:true";
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(strAttrList);
+ Assert.assertEquals("isAgeOver:true:[]:;", attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromPopulate() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST3);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid values.
+ */
+ @Test
+ public void testPopulateWithInvalidValuesFormat() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type:values:status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid format.
+ */
+ @Test
+ public void testPopulateWithInvalidFormat() {
+
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type::status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using put.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using populate.
+ */
+ @Test
+ public void testCloneFromPopulate() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertNotSame(pal, pal.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List iterator.
+ */
+ @Test
+ public void testIterator() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ final Iterator<PersonalAttribute> itAttr = pal.iterator();
+ while (itAttr.hasNext()) {
+ final PersonalAttribute attr = itAttr.next();
+ Assert.assertEquals(ISAGEOVER_CONS, attr.getName());
+ }
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetOptionalAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method without optional attributes.
+ */
+ @Test
+ public void testGetOptionalAttributesWithoutOptional() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with one optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOneOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:true:[15,]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with two optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOnlyOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method without mandatory attributes.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithoutMandatory() {
+ final String strAttrList =
+ "isAgeOver:false:[15,]:Available;isAgeOver:false:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with one mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOneMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:false:[15,]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOnlyMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method without simple attributes.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method with one simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOneSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOnlySimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetComplexAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method without complex attributes.
+ */
+ @Test
+ public void testGetComplexAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST2);
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method with one complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOneComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getComplexAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with only two Complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOnlyComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST2);
+ Assert.assertTrue(pal.getComplexAttributes().size() == TWO_CONS);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base
new file mode 100644
index 000000000..458d510e0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base
@@ -0,0 +1,182 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class PersonalAttributeTestCase {
+
+ /**
+ * An empty attribute.
+ */
+ private static final PersonalAttribute EMPTYATTR = new PersonalAttribute();
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * An attribute with a simple value (age).
+ */
+ @SuppressWarnings("serial")
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given simple
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringValues() {
+ Assert.assertEquals("age:true:[15,]:Available;", ATTR_VALUE.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given complex
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringComplexValues() {
+ Assert.assertEquals(
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;",
+ complexAttrValue.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithNull() {
+ Assert.assertTrue(EMPTYATTR.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * new attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithEmptyString() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setStatus("");
+ Assert.assertTrue(attr.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setValue(null);
+ Assert.assertTrue(attr.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setComplexValue(null);
+ Assert.assertTrue(attr.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithEmptyComplexValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToComplexValue() {
+ Assert.assertNotSame(complexAttrValue, complexAttrValue.clone());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToValue() {
+ Assert.assertNotSame(ATTR_VALUE, ATTR_VALUE.clone());
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..270311128
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,5 @@
+/**
+ * This package provides all JUnit test classes.
+ */
+package eu.stork.peps.tests;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
new file mode 100644
index 000000000..782b3d02d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
@@ -0,0 +1,134 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeProvidersMap;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+import eu.stork.peps.auth.commons.IAttributeProvidersMap;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public class AttributeProvidersMapTestCase {
+
+ @Test
+ public void testObjectOK1() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK2() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ if ( map.get(source)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK3() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK4() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ if ( map.get(target)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectNOK1() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+
+ @Test
+ public void testObjectNOK2() {
+ IAttributeProvidersMap map = new AttributeProvidersMap();
+ AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL");
+ AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1"), "URL");
+ IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
new file mode 100644
index 000000000..96b2c8317
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
@@ -0,0 +1,88 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeSourceTestCase {
+ private AttributeSource ap1 = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL1");
+ private AttributeSource ap2 = new AttributeSource(new AttributeProvider("ID2", "Name 2"), "URL2");
+ private AttributeSource ap3 = new AttributeSource(new AttributeProvider("ID1", "Name 2"), "URL2");
+ private AttributeSource ap4 = new AttributeSource(new AttributeProvider("ID1", "Name 2"), "URL1");
+ private AttributeSource ap5 = new AttributeSource(new AttributeProvider("ID1", "Name 1"), "URL1");
+
+ private AttributeSource c1 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+ private AttributeSource c2 = new AttributeSource(new Country("ID2", "Name 2"), "URL2");
+ private AttributeSource c3 = new AttributeSource(new Country("ID1", "Name 2"), "URL2");
+ private AttributeSource c4 = new AttributeSource(new Country("ID1", "Name 2"), "URL1");
+ private AttributeSource c5 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+
+ @Test
+ public void testNotEquals1() {
+ assertFalse(ap1.equals(ap2));
+ }
+
+ @Test
+ public void testNotEquals2() {
+ assertFalse(ap1.equals(c1));
+ }
+
+ @Test
+ public void testNotEquals3() {
+ assertFalse(c1.equals(c2));
+ }
+
+ @Test
+ public void testEquals1() {
+ assertTrue(ap1.equals(ap3));
+ }
+
+ @Test
+ public void testEquals2() {
+ assertTrue(ap1.equals(ap4));
+ }
+
+ @Test
+ public void testEquals3() {
+ assertTrue(ap1.equals(ap5));
+ }
+
+ @Test
+ public void testEquals4() {
+ assertTrue(c1.equals(c3));
+ }
+
+ @Test
+ public void testEquals5() {
+ assertTrue(c1.equals(c4));
+ }
+
+ @Test
+ public void testEquals6() {
+ assertTrue(c1.equals(c5));
+ }
+
+ @Test
+ public void testEquals7() {
+ Object obj = ap5;
+ assertTrue(ap1.equals(obj));
+ }
+
+ @Test
+ public void testEquals8() {
+ Object obj = c5;
+ assertTrue(c1.equals(obj));
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
new file mode 100644
index 000000000..77fc4b9c2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
@@ -0,0 +1,537 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeUtil;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSValues;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeUtilTestCase {
+
+ /**
+ * Empty String to be used on the tests.
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * Tuple value sample to be used on the tests.
+ */
+ private static final String[] TUPLE_STRING = new String[] { "age", "true",
+ "[18]", "Available" };
+
+ /**
+ * Complex value to be used on escape/unescape tests.
+ */
+ private static final String COMPLEX_VAL = "postalCode=4100,"
+ + "apartmentNumber=A,state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,";
+
+ /**
+ * Escaped Complex value to be used on escape/unescape tests.
+ */
+ private static final String ESC_COMPLEX_VAL = "postalCode=4100%44"
+ + "apartmentNumber=A%44state=Porto%44countryCodeAddress=PT%44"
+ + "streetNumber=379%44streetName=Avenida Sidonio Pais%44town=Porto%44";
+
+ /**
+ * Simple value to be used on escape/unescape tests.
+ */
+ private static final String SIMPLE_VAL = "Avenida da Boavista, Porto";
+
+ /**
+ * Escaped simple value to be used on escape/unescape tests.
+ */
+ private static final String ESC_SIMPLE_VAL = "Avenida da Boavista%44 Porto";
+
+ /**
+ * Simple text to be used on escape/unescape tests. Must match the escaped
+ * text.
+ */
+ private static final String SIMPLE_TEXT = "John Doe";
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given complex
+ * attribute value (canonical address' example attribute value).
+ */
+ @Test
+ public void testEscapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.escape(COMPLEX_VAL), ESC_COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given
+ * attribute value.
+ */
+ @Test
+ public void testEscapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.escape(SIMPLE_VAL), ESC_SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to escape.
+ */
+ @Test
+ public void testEscapeNormalChars() {
+ assertEquals(AttributeUtil.escape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#unescape(String)} method for the given
+ * escape complex attribute value (canonical address' example attribute
+ * value).
+ */
+ @Test
+ public void testUnescapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.unescape(ESC_COMPLEX_VAL), COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given escape
+ * attribute value.
+ */
+ @Test
+ public void testUnescapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.unescape(ESC_SIMPLE_VAL), SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to unescape.
+ */
+ @Test
+ public void testUnescapeNormalChars() {
+ assertEquals(AttributeUtil.unescape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given empty string.
+ */
+ @Test
+ public void testAppendIfNotNullEmptyStr() {
+ final StringBuilder strBuilder = new StringBuilder(SIMPLE_TEXT);
+ AttributeUtil.appendIfNotNull(strBuilder, EMPTY_STRING);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given string.
+ */
+ @Test
+ public void testAppendIfNotNullStr() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, SIMPLE_TEXT);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given null value.
+ */
+ @Test
+ public void testAppendIfNotNull() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, null);
+ assertEquals(strBuilder.toString(), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with two values.
+ */
+ @Test
+ public void testListToStringTwoVals() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+ vals.add(SIMPLE_TEXT);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one values.
+ */
+ @Test
+ public void testListToStringOneVal() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one value.
+ */
+ @Test
+ public void testListToStringEmptyVal() {
+ final List<String> vals = new ArrayList<String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given Map with one value.
+ */
+ @Test
+ public void testMapToStringOneVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+ vals.put("CanonicalAddress", COMPLEX_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("CanonicalAddress=");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given empty Map.
+ */
+ @Test
+ public void testMapToStringEmptyVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid List.
+ */
+ @Test
+ public void testIsValidValueInvalidList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * null value.
+ */
+ @Test
+ public void testIsValidValueNullList() {
+ assertFalse(AttributeUtil.isValidValue(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyList() {
+ assertTrue(AttributeUtil.isValidValue("[]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyCommaList() {
+ assertTrue(AttributeUtil.isValidValue("[,]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * multi value List.
+ */
+ @Test
+ public void testIsValidValueMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid multi value List.
+ */
+ @Test
+ public void testIsValidValueInvalidMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * true type.
+ */
+ @Test
+ public void testIsValidTypetrue() {
+ assertTrue(AttributeUtil.isValidType("true"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * True type.
+ */
+ @Test
+ public void testIsValidTypeTrue() {
+ assertTrue(AttributeUtil.isValidType("True"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * TRUE type.
+ */
+ @Test
+ public void testIsValidTypeTRUE() {
+ assertTrue(AttributeUtil.isValidType("TRUE"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * invalid type.
+ */
+ @Test
+ public void testIsValidTypeInvalidType() {
+ assertFalse(AttributeUtil.isValidType("str"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * false type.
+ */
+ @Test
+ public void testIsValidTypefalse() {
+ assertTrue(AttributeUtil.isValidType("false"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * False type.
+ */
+ @Test
+ public void testIsValidTypeFalse() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * FALSE type.
+ */
+ @Test
+ public void testIsValidTypeFALSEVal() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * null.
+ */
+ @Test
+ public void testIsValidTypeNullVal() {
+ assertFalse(AttributeUtil.isValidType(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given valid tuple.
+ */
+ @Test
+ public void testHasValidTuples() {
+ assertTrue(AttributeUtil.hasValidTuples(TUPLE_STRING));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple.
+ */
+ @Test
+ public void testHasValidTuplesInvalid() {
+ final String[] tuple = new String[]{"name", "type"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple with valid size.
+ */
+ @Test
+ public void testHasValidTuplesSameSizeInvalidValues() {
+ final String[] tuple = new String[] { "age", "type", "[18]", "Available"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given null value.
+ */
+ @Test
+ public void testHasValidTuplesNull() {
+ assertFalse(AttributeUtil.hasValidTuples(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list..
+ */
+ @Test
+ public void testCheckMandatoryAttributes() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[18,]:Available;");
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testCheckMandatoryAttributesNullAttrList() {
+ assertTrue(AttributeUtil.checkMandatoryAttributes(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given empty attribute list.
+ */
+ @Test
+ public void testCheckMandatoryAttributesEmptyAttrList() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list (missing mandatory attribute).
+ */
+ @Test
+ public void testCheckMandatoryAttributesMissingAttr() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[]:NotAvailable;");
+ assertFalse(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
new file mode 100644
index 000000000..5d2296997
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
@@ -0,0 +1,294 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.sql.Timestamp;
+import java.util.Properties;
+
+import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.DateUtil;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class DateUtilTestCase {
+
+ /**
+ * Stork Format date.
+ */
+ private static final String FORMAT = "yyyyMMdd";
+
+ /**
+ * Expected 10 value.
+ */
+ private static final int TEN = 10;
+
+ /**
+ * Expected 11 value.
+ */
+ private static final int ELEVEN = 11;
+
+ /**
+ * The testing Date ("current" date).
+ */
+ private static final DateTime TESTDATE = new DateTime(2011, 10, 10, 15, 20,
+ 0, 0);
+
+ /**
+ * Init DateUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Properties configs = new Properties();
+ configs.setProperty("invalidAgeDateValue.code", "35");
+ configs.setProperty("invalidAttributeValue.code", "34");
+ configs
+ .setProperty(
+ "invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ PEPSUtil.createInstance(configs);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year against
+ * the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromYear() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("2000", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyMonth() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("200001", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromSameMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200010", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyFullDate() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20000101", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromSameDay() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20001010", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterFullDate() {
+ Assert.assertTrue(TEN == DateUtil
+ .calculateAge("20001011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDate() {
+ DateUtil.calculateAge("200", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidMonth() {
+ DateUtil.calculateAge("200013", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDay() {
+ DateUtil.calculateAge("20000230", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullDate() {
+ DateUtil.calculateAge(null, TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullCurDate() {
+ DateUtil.calculateAge("2000", null, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullFormat() {
+ DateUtil.calculateAge("2000", TESTDATE, null);
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return true
+ */
+ @Test
+ public void isValidFormatDateFromYear() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("2000", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year and
+ * month. Must return true.
+ */
+ @Test
+ public void isValidFormatDateFromMonth() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("200001", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDate() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("20000101", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidYear() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidMonth() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200013", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("20010229", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate(null, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullFormat() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("2000", null));
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampBefore() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertNotSame(ts, DateUtil.currentTimeStamp());
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampAfter() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertEquals(DateUtil.currentTimeStamp(), ts);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
new file mode 100644
index 000000000..d4841ed43
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
@@ -0,0 +1,553 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSErrors;
+import eu.stork.peps.auth.commons.PEPSParameters;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * The PEPSUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class PEPSUtilTestCase {
+
+ /**
+ * Message example.
+ */
+ private static final String MESSAGE_SAMPLE = "003002 - Authentication Failed";
+
+ /**
+ * Error message example.
+ */
+ private static final String ERROR_MESSAGE_SAMPLE = "Authentication Failed";
+
+ /**
+ * Error code example.
+ */
+ private static final String ERROR_CODE_SAMPLE = "003002";
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS1 = new Properties();
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS2 = new Properties();
+
+ /**
+ * The empty string value: "".
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * The empty byte value: [].
+ */
+ private static final byte[] EMPTY_BYTE = new byte[] {};
+
+ /**
+ * The empty byte hash value.
+ */
+ private static final byte[] EMPTY_HASH_BYTE = new byte[] { -49, -125, -31,
+ 53, 126, -17, -72, -67, -15, 84, 40, 80, -42, 109, -128, 7, -42, 32, -28,
+ 5, 11, 87, 21, -36, -125, -12, -87, 33, -45, 108, -23, -50, 71, -48, -47,
+ 60, 93, -123, -14, -80, -1, -125, 24, -46, -121, 126, -20, 47, 99, -71, 49,
+ -67, 71, 65, 122, -127, -91, 56, 50, 122, -7, 39, -38, 62 };
+
+ /**
+ * The SAML example byte[] value.
+ */
+ private static final byte[] SAML_BYTE_SAMPLE = new byte[] { 60, 115, 97, 109,
+ 108, 62, 46, 46, 46, 60, 47, 115, 97, 109, 108 };
+
+ /**
+ * The SAML's Base64 example value.
+ */
+ private static final String SAML_BASE64_SAMPLE = "PHNhbWw+Li4uPC9zYW1s";
+
+ /**
+ * The SAML's Base64 byte[] example value.
+ */
+ private static byte[] SAML_BASE64_BYTE_SAMPLE = new byte[] { 80, 72, 78, 104,
+ 98, 87, 119, 43, 76, 105, 52, 117, 80, 67, 57, 122, 89, 87, 49, 115 };
+
+ /**
+ * The SAML's Base64 Hash byte[] example value.
+ */
+ private static byte[] HASH_BYTE_SAMPLE = new byte[] { 67, 38, 11, 115, 49,
+ -5, 54, -85, 38, 43, -99, 96, 71, -41, 50, -96, 71, -86, 90, -97, 66, -67,
+ 90, 101, 30, 82, -13, 60, -106, -72, -103, -75, 19, 2, -107, 107, -6, -56,
+ 34, -111, -44, -57, -26, -5, 33, 78, -1, 30, 21, 74, -26, 118, -46, -12,
+ -102, 12, -56, 30, -59, -104, -21, -42, -103, 82 };
+
+ /**
+ * Init PEPSUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+
+ CONFIGS1.setProperty("max.attrList.size", "20000");
+ CONFIGS1.setProperty("attrList.code", "202005");
+ CONFIGS1.setProperty("attrList.message", "invalid.attrList.parameter");
+
+ CONFIGS1.setProperty("max.qaaLevel.size", "1");
+ CONFIGS1.setProperty("max.spUrl.size", "inv");
+ CONFIGS1.setProperty("validation.active", "true");
+ CONFIGS1.setProperty("hashDigest.className",
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ CONFIGS1.setProperty("invalidAgeDateValue.code", "35");
+ CONFIGS1.setProperty("invalidAttributeValue.code", "34");
+ CONFIGS1.setProperty("invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#createInstance(Properties)} method for the given
+ * properties object.
+ */
+ @Test
+ public void testCreateInstance() {
+ Assert.assertNotNull(PEPSUtil.createInstance(CONFIGS2));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigs() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertEquals(pepsUtils.getConfigs(), CONFIGS1);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigsDifferent() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertNotSame(pepsUtils.getConfigs(), CONFIGS2);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given existing
+ * config.
+ */
+ @Test
+ public void testGetConfigExists() {
+ assertEquals(PEPSUtil.getConfig("hashDigest.className"),
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given not
+ * existing config.
+ */
+ @Test
+ public void testGetConfigNoExists() {
+ assertNull(PEPSUtil.getConfig("doesnt.exists"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given null
+ * value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testGetConfigNull() {
+ assertNull(PEPSUtil.getConfig(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExists() {
+ assertTrue(PEPSUtil.isValidParameter("qaaLevel", "1"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsGreat() {
+ assertFalse(PEPSUtil.isValidParameter("qaaLevel", "12"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsIvalidConf() {
+ assertFalse(PEPSUtil
+ .isValidParameter("spUrl", "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNotExists() {
+ assertFalse(PEPSUtil.isValidParameter("doesntexists",
+ "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamName() {
+ assertFalse(PEPSUtil.isValidParameter(null, "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamValue() {
+ assertFalse(PEPSUtil.isValidParameter("spUrl", null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given object values.
+ */
+ @Test
+ public void testValidateParameterValid() {
+ final IPersonalAttributeList persAttrList = new PersonalAttributeList();
+ persAttrList.populate("isAgeOver:true:[15,]:Available;");
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), persAttrList);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNull() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), null);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, String)} method
+ * for the given string values.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameter() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, PEPSErrors)}
+ * method for the given string value and {@link PEPSErrors} enum.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameterPEPSErrors() {
+ PEPSUtil.validateParameter("CountrySelectorAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;",
+ PEPSErrors.SP_COUNTRY_SELECTOR_INVALID_ATTR);
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test
+ public void testValidateParameterValidParams() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "10",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "doesnt.exists", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", null, "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", null,
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * string value.
+ */
+ @Test
+ public void testEncodeSAMLToken() {
+ assertEquals(PEPSUtil.encodeSAMLToken(SAML_BYTE_SAMPLE), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * null.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testEncodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.encodeSAMLToken(null), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * empty byte[] value.
+ */
+ @Test
+ public void testEncodeSAMLTokenEmpty() {
+ assertEquals(PEPSUtil.encodeSAMLToken(EMPTY_BYTE), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testDecodeSAMLToken() {
+ assertArrayEquals(PEPSUtil.decodeSAMLToken(SAML_BASE64_SAMPLE),
+ SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testDecodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.decodeSAMLToken(null), SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * empty string value.
+ */
+ @Test(expected = StringIndexOutOfBoundsException.class)
+ public void testDecodeSAMLTokenEmpty() {
+ assertTrue(PEPSUtil.decodeSAMLToken(EMPTY_STRING) == EMPTY_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testHashPersonalToken() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(SAML_BASE64_BYTE_SAMPLE),
+ HASH_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = InternalErrorPEPSException.class)
+ public void testHashPersonalTokenNull() {
+ assertNull(PEPSUtil.hashPersonalToken(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * empty value.
+ */
+ @Test
+ public void testHashPersonalTokenEmpty() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(EMPTY_BYTE), EMPTY_HASH_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * correct message.
+ */
+ @Test
+ public void testGetStorkErrorCodeExists() {
+ assertEquals(PEPSUtil.getStorkErrorCode(MESSAGE_SAMPLE), ERROR_CODE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNoExists() {
+ assertNull(PEPSUtil.getStorkErrorCode(ERROR_MESSAGE_SAMPLE));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * empty message.
+ */
+ @Test
+ public void testGetStorkErrorCodeEmpty() {
+ assertNull(PEPSUtil.getStorkErrorCode(EMPTY_STRING));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * null message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNull() {
+ assertNull(PEPSUtil.getStorkErrorCode(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("-"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepAndCodeFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("000001 -"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given correct message.
+ */
+ @Test
+ public void testGetStorkErrorMessageExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNoExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(ERROR_MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given empty message.
+ */
+ @Test
+ public void testGetStorkErrorMessageEmpty() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(EMPTY_STRING),
+ EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given null message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNull() {
+ assertNull(PEPSUtil.getStorkErrorMessage(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("-"),"-");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepAndCodeFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("000001 -"),"000001 -");
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
new file mode 100644
index 000000000..7052b320a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
@@ -0,0 +1,747 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttributeList's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-11-17 05:17:02 $
+ */
+public final class PersonalAttributeListTestCase {
+
+ /**
+ * isAgeOver constant value.
+ */
+ private static final String ISAGEOVER_CONS = "isAgeOver";
+
+ /**
+ * 1 constant value.
+ */
+ private static final int ONE_CONS = 1;
+
+ /**
+ * 2 constant value.
+ */
+ private static final int TWO_CONS = 2;
+
+ /**
+ * An empty attribute.
+ */
+ @SuppressWarnings("unused")
+ private static final PersonalAttributeList EMPTY_ATTR_LIST =
+ new PersonalAttributeList(0);
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST =
+ "isAgeOver:true:[15,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST2 =
+ "isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3 =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3_REVERSE =
+ "isAgeOver:true:[18,]:Available;isAgeOver:true:[15,]:Available;";
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String COMPLEX_ATTRLIST =
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=Ed. B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;";
+ /**
+ * Mix attribute list string.
+ */
+ private static final String STR_MIX_ATTR_LIST =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:"
+ + "Available;";
+
+ /**
+ * Mix attribute list 2 string.
+ */
+ private static final String STR_MIX_ATTR_LIST2 =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:Available;"
+ + "mandateContent:true:["
+ + "isJoint=\"isjoint\",typeOfPower=\"power\",ValidTo=\"validto\",validfrom=\"validfrom\",AQAA=\"3\",isChained=\"ischained\",]:"
+ + "Available;";
+
+ /**
+ * Attribute List example.
+ */
+ @SuppressWarnings({ "serial" })
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeListTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "Ed. B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testAddSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testAddCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testAddNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Simple Value.
+ */
+ @Test
+ public void testPutSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Complex Value.
+ */
+ @Test
+ public void testPutComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testPutNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put("", null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testGetSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertEquals(ATTR_VALUE, attrList.get(ATTR_VALUE.getName()));
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testGetCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertEquals(complexAttrValue.toString(),
+ attrList.get(complexAttrValue.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testGetIsAgeOverAttr() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST,
+ attrList.get(attrValueUnder.getName()).toString());
+ Assert.assertEquals(SIMPLE_ATTRLIST2,
+ attrList.get(attrValueOver.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple attribute.
+ */
+ @Test
+ public void testPopulateSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Complex attribute.
+ */
+ @Test
+ public void testPopulateComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple and Complex attribute.
+ */
+ @Test
+ public void testPopulateMixAttrs() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using put.
+ *
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromSimplePopulate() {
+ final String strAttrList = "isAgeOver:true";
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(strAttrList);
+ Assert.assertEquals("isAgeOver:true:[]:;", attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromPopulate() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST3);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid values.
+ */
+ @Test
+ public void testPopulateWithInvalidValuesFormat() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type:values:status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid format.
+ */
+ @Test
+ public void testPopulateWithInvalidFormat() {
+
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type::status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using put.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using populate.
+ */
+ @Test
+ public void testCloneFromPopulate() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertNotSame(pal, pal.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List iterator.
+ */
+ @Test
+ public void testIterator() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ final Iterator<PersonalAttribute> itAttr = pal.iterator();
+ while (itAttr.hasNext()) {
+ final PersonalAttribute attr = itAttr.next();
+ Assert.assertEquals(ISAGEOVER_CONS, attr.getName());
+ }
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetOptionalAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method without optional attributes.
+ */
+ @Test
+ public void testGetOptionalAttributesWithoutOptional() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with one optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOneOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:true:[15,]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with two optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOnlyOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method without mandatory attributes.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithoutMandatory() {
+ final String strAttrList =
+ "isAgeOver:false:[15,]:Available;isAgeOver:false:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with one mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOneMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:false:[15,]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOnlyMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method without simple attributes.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method with one simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOneSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOnlySimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetComplexAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method without complex attributes.
+ */
+ @Test
+ public void testGetComplexAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST2);
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method with one complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOneComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getComplexAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with only two Complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOnlyComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST2);
+ Assert.assertTrue(pal.getComplexAttributes().size() == TWO_CONS);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
new file mode 100644
index 000000000..458d510e0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
@@ -0,0 +1,182 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class PersonalAttributeTestCase {
+
+ /**
+ * An empty attribute.
+ */
+ private static final PersonalAttribute EMPTYATTR = new PersonalAttribute();
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * An attribute with a simple value (age).
+ */
+ @SuppressWarnings("serial")
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given simple
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringValues() {
+ Assert.assertEquals("age:true:[15,]:Available;", ATTR_VALUE.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given complex
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringComplexValues() {
+ Assert.assertEquals(
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;",
+ complexAttrValue.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithNull() {
+ Assert.assertTrue(EMPTYATTR.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * new attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithEmptyString() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setStatus("");
+ Assert.assertTrue(attr.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setValue(null);
+ Assert.assertTrue(attr.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setComplexValue(null);
+ Assert.assertTrue(attr.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithEmptyComplexValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToComplexValue() {
+ Assert.assertNotSame(complexAttrValue, complexAttrValue.clone());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToValue() {
+ Assert.assertNotSame(ATTR_VALUE, ATTR_VALUE.clone());
+ }
+}
diff --git a/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java
new file mode 100644
index 000000000..270311128
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * This package provides all JUnit test classes.
+ */
+package eu.stork.peps.tests;
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/all-wcprops b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/all-wcprops
new file mode 100644
index 000000000..a3a21b424
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/resources
+END
+log4j.xml
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/resources/log4j.xml
+END
diff --git a/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/entries b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/entries
new file mode 100644
index 000000000..e6b7f5399
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+665
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/resources
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+log4j.xml
+file
+
+
+
+
+2013-12-20T12:27:56.542475Z
+4e990a84da0033594135b05cd01a9cdd
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+645
+
diff --git a/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base
new file mode 100644
index 000000000..0ad2ea9a4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/legacy-backup/stork2-commons/src/test/resources/log4j.xml b/id/server/legacy-backup/stork2-commons/src/test/resources/log4j.xml
new file mode 100644
index 000000000..0ad2ea9a4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-commons/src/test/resources/log4j.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/stork2-saml-engine/Releases b/id/server/legacy-backup/stork2-saml-engine/Releases
index 0031906e6..0031906e6 100644
--- a/id/server/stork2-saml-engine/Releases
+++ b/id/server/legacy-backup/stork2-saml-engine/Releases
diff --git a/id/server/legacy-backup/stork2-saml-engine/SamlEngine.iml b/id/server/legacy-backup/stork2-saml-engine/SamlEngine.iml
new file mode 100644
index 000000000..34b744ca9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/SamlEngine.iml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: eu.stork:Commons:1.2.0" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.6.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.4.0" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.7" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.5.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xml-apis:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xercesImpl:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:serializer:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/legacy-backup/stork2-saml-engine/find.save b/id/server/legacy-backup/stork2-saml-engine/find.save
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/find.save
diff --git a/id/server/legacy-backup/stork2-saml-engine/pom.xml b/id/server/legacy-backup/stork2-saml-engine/pom.xml
new file mode 100644
index 000000000..05e95441d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/pom.xml
@@ -0,0 +1,202 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>MOA.id</groupId>
+ <artifactId>moa-id</artifactId>
+ <version>1.9.98-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eu.stork</groupId>
+ <artifactId>SamlEngine</artifactId>
+ <packaging>jar</packaging>
+ <name>STORKSAMLEngine</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <saml.version>1.1.0</saml.version>
+ <samlspec.version>0.5.2</samlspec.version>
+ <samlspecacept.version>0.5.1</samlspecacept.version>
+ <commons.version>1.2.0</commons.version>
+ <opensaml.version>2.6.0</opensaml.version>
+ <timestamp>${maven.build.timestamp}</timestamp>
+ </properties>
+ <version>${saml.version}</version>
+ <description>
+ The STORKSAMLEngine library provides tools to support developers working with the Security Assertion Markup Language (SAML).
+ </description>
+
+ <repositories>
+ <repository>
+ <id>org.opensaml</id>
+ <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
+ </repository>
+ <!-- repository OpenSaml -->
+ <repository>
+ <id>shibboleth-release</id>
+ <name>Internet2 Releases</name>
+ <layout>default</layout>
+ <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <!-- Compile dependencies -->
+ <dependency>
+ <groupId>eu.stork</groupId>
+ <artifactId>Commons</artifactId>
+ <version>${commons.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>${opensaml.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.11.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <SAMLEngineVersion>${saml.version}</SAMLEngineVersion>
+ <SAMLSpecVersion-accept>${samlspecacept.version}</SAMLSpecVersion-accept>
+ <SAMLSpecVersion-send>${samlspec.version}</SAMLSpecVersion-send>
+ <SAMLSpecKnownIssues>None</SAMLSpecKnownIssues>
+ <timestamp>${timestamp}</timestamp>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>metrics</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <reporting>
+ </reporting>
+</project>
diff --git a/id/server/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml b/id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml
index 9a6086c74..9a6086c74 100644
--- a/id/server/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/StorkSamlEngine_CPEPS.xml
diff --git a/id/server/stork2-saml-engine/src/main/config/embedded/quartz.properties b/id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/quartz.properties
index 4e4de5cac..dfa62f3ae 100644
--- a/id/server/stork2-saml-engine/src/main/config/embedded/quartz.properties
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/config/embedded/quartz.properties
@@ -1,5 +1,5 @@
-org.quartz.scheduler.instanceName = UpdateScheduler
-org.quartz.threadPool.threadCount = 1
-org.quartz.jobStore.class =org.quartz.simpl.RAMJobStore
-org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
+org.quartz.scheduler.instanceName = UpdateScheduler
+org.quartz.threadPool.threadCount = 1
+org.quartz.jobStore.class =org.quartz.simpl.RAMJobStore
+org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/config/jBoss/context.xml b/id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/context.xml
index 9520f2161..9520f2161 100644
--- a/id/server/stork2-saml-engine/src/main/config/jBoss/context.xml
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/context.xml
diff --git a/id/server/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml b/id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml
index 20c6509de..20c6509de 100644
--- a/id/server/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/config/jBoss/jboss-classloading.xml
diff --git a/id/templates/src/main/webapp/META-INF/MANIFEST.MF b/id/server/legacy-backup/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF
index 5e9495128..254272e1c 100644
--- a/id/templates/src/main/webapp/META-INF/MANIFEST.MF
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF
@@ -1,3 +1,3 @@
-Manifest-Version: 1.0
-Class-Path:
-
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
new file mode 100644
index 000000000..bcf5e289b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
@@ -0,0 +1,421 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.opensaml.Configuration;
+import org.opensaml.DefaultBootstrap;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.xml.ConfigurationException;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallerFactory;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallerFactory;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.opensaml.xml.parse.XMLParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.auth.engine.core.STORKSAMLCore;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryMarshaller;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SignModuleFactory;
+import eu.stork.peps.configuration.ConfigurationCreator;
+import eu.stork.peps.configuration.ConfigurationReader;
+import eu.stork.peps.configuration.InstanceEngine;
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * Class that wraps the operations over SAML tokens, both generation and
+ * validation of SAML requests and SAML responses. Compliant with "OASIS Secure
+ * Assertion Markup Language (SAML) 2.0, May 2005", but taking into account
+ * STORK specific requirements.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ */
+
+public class SAMLEngine {
+
+ /** The Document Builder Factory. */
+ private static javax.xml.parsers.DocumentBuilderFactory dbf = null;
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SAMLEngine.class
+ .getName());
+
+ /** The Constant MODULE_SIGN_CONF. */
+ private static final String MODULE_SIGN_CONF = "SignatureConf";
+
+ /** The Constant SAML_ENGINE_SIGN_CLASS. */
+ private static final String SAML_ENGINE_SIGN_CLASS = "class";
+
+ /** The Constant SAML_ENGINE_CONF. */
+ private static final String SAML_ENGINE_CONF = "SamlEngineConf";
+
+ /** The Constant SAML_ENGINE_FILE_CONF. */
+ private static final String SAML_ENGINE_FILE_CONF = "fileConfiguration";
+
+ /** The codification of characters. */
+ private static final String CHARACTER_ENCODING = "UTF-8";
+
+ /** The SAML core. */
+ private STORKSAMLCore samlCore;
+
+ /** The Module of Signature. */
+ private SAMLEngineSignI signer;
+
+
+ /** Initializes the SAML engine. */
+ /** Configure Document Builder Factory. */
+
+ static {
+ startUp();
+ loadDocumentFactory();
+ }
+
+ /**
+ * Load document factory.
+ */
+ private static void loadDocumentFactory() {
+
+ try {
+ dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ dbf.setNamespaceAware(true);
+ dbf.setIgnoringComments(true);
+ } catch (ParserConfigurationException e) {
+ LOG.error("Error parser configuration.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+
+ }
+
+ /**
+ * Method that initializes the basic services for the SAML Engine, like the
+ * OpenSAML library and the BouncyCastle provider.
+ */
+ private static void startUp() {
+
+ LOG.info("SAMLEngine: Initialize OpenSAML");
+
+ //TLenz: MOA-ID uses an own Bootstrap
+// try {
+// DefaultBootstrap.bootstrap();
+// } catch (ConfigurationException e) {
+// LOG.error("Problem initializing the OpenSAML library.");
+// throw new STORKSAMLEngineRuntimeException(e);
+// }
+
+ LOG.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOG.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+
+ LOG.debug("Create all instaces of saml engine. (instances of SAMLEngine)");
+ try {
+ instances = ConfigurationCreator
+ .createConfiguration(instanceConfigs);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error initializing instances from Stork SAML engine.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Instantiates a new SAML engine.
+ */
+ private SAMLEngine() {
+
+ }
+
+ /**
+ * Instantiates a new SAML engine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ protected SAMLEngine(final String nameInstance)
+ throws STORKSAMLEngineException {
+ LOG.info("Loading Specific Configuration.");
+
+ LOG.debug("Create intance of saml messages.");
+
+ Map<String, Object> instance = instances.get(nameInstance);
+
+ if (instance == null || instance.isEmpty()) {
+ LOG.error("Instance: " + nameInstance + " not exist.");
+ throw new STORKSAMLEngineException("Instance: " + nameInstance
+ + " not exist.");
+ }
+
+ Properties properties = (Properties) instance.get(SAML_ENGINE_CONF);
+
+ if (properties == null) {
+ LOG.error("SamlEngine.xml: not exist.");
+ throw new STORKSAMLEngineException("SamlEngine.xml: not exist.");
+ }
+
+ samlCore = new STORKSAMLCore(properties);
+
+ final HashMap<String, String> propertiesSign = (HashMap<String, String>) instance
+ .get(MODULE_SIGN_CONF);
+
+ LOG.debug("Loading Module of sign.");
+ signer = SignModuleFactory.getInstance(propertiesSign
+ .get(SAML_ENGINE_SIGN_CLASS));
+
+ try {
+ LOG.info("Initialize module of sign.");
+ signer.init(propertiesSign.get(SAML_ENGINE_FILE_CONF));
+ LOG.info("Load cryptographic service provider of module of sign.");
+ signer.loadCryptServiceProvider();
+ } catch (SAMLEngineException e) {
+ LOG.error("Error create signature module: "
+ + propertiesSign.get(SAML_ENGINE_FILE_CONF));
+ LOG.info("Exception" + e);
+ throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Gets the Signer properties.
+ *
+ * @return the SAML Sign properties
+ */
+ protected SAMLEngineSignI getSigner() {
+ return signer;
+ }
+
+ /**
+ * Gets the SAML core properties.
+ *
+ * @return the SAML core properties
+ */
+ protected final STORKSAMLCore getSamlCoreProperties() {
+ return samlCore;
+ }
+
+ /**
+ * Method that transform the received SAML object into a byte array
+ * representation.
+ *
+ * @param samlToken the SAML token.
+ *
+ * @return the byte[] of the SAML token.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private byte[] marshall(final XMLObject samlToken)
+ throws SAMLEngineException {
+
+ try {
+ javax.xml.parsers.DocumentBuilder docBuilder = null;
+
+ final MarshallerFactory marshallerFactory = Configuration
+ .getMarshallerFactory();
+
+ final Marshaller marshaller;
+ if (samlToken.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ marshaller = new CustomAttributeQueryMarshaller();
+ else
+ marshaller = marshallerFactory
+ .getMarshaller(samlToken);
+
+ docBuilder = dbf.newDocumentBuilder();
+
+ final Document doc = docBuilder.newDocument();
+
+ marshaller.marshall(samlToken, doc);
+
+ // Obtain a byte array representation of the marshalled SAML object
+ final DOMSource domSource = new DOMSource(doc);
+ final StringWriter writer = new StringWriter();
+ final StreamResult result = new StreamResult(writer);
+ final TransformerFactory transFactory = TransformerFactory
+ .newInstance();
+ Transformer transformer;
+
+ transformer = transFactory.newTransformer();
+ transformer.transform(domSource, result);
+ LOG.debug("SAML request \n"+ writer.toString());
+ return writer.toString().getBytes(CHARACTER_ENCODING);
+
+ } catch (ParserConfigurationException e) {
+ LOG.error("ParserConfigurationException.");
+ throw new SAMLEngineException(e);
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException.");
+ throw new SAMLEngineException(e);
+ } catch (TransformerConfigurationException e) {
+ LOG.error("TransformerConfigurationException.");
+ throw new SAMLEngineException(e);
+ } catch (TransformerException e) {
+ LOG.error("TransformerException.");
+ throw new SAMLEngineException(e);
+ } catch (UnsupportedEncodingException e) {
+ LOG.error("UnsupportedEncodingException: " + CHARACTER_ENCODING);
+ throw new SAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Method that signs a SAML Token.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the SAML object sign
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private SignableSAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.debug("Sign SamlToken.");
+ signer.sign(tokenSaml);
+ return tokenSaml;
+ }
+
+ /**
+ * Sign and transform to byte array.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the byte[] of the SAML token
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final byte[] signAndMarshall(final SignableSAMLObject samlToken)
+ throws SAMLEngineException {
+ LOG.debug("Marshall Saml Token.");
+ SignableSAMLObject signElement = sign(samlToken);
+ return marshall(signElement);
+ }
+
+ /**
+ * Method that unmarshalls a SAML Object from a byte array representation to
+ * an XML Object.
+ *
+ * @param samlToken Byte array representation of a SAML Object
+ *
+ * @return XML Object (superclass of SAMLObject)
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final XMLObject unmarshall(final byte[] samlToken)
+ throws SAMLEngineException {
+ try {
+ // Get parser pool manager
+ final BasicParserPool ppMgr = new BasicParserPool();
+ // Note: this is necessary due to an unresolved Xerces deferred DOM
+ // issue/bug
+ final HashMap<String, Boolean> features = new HashMap<String, Boolean>();
+ features.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
+ ppMgr.setBuilderFeatures(features);
+
+ ppMgr.setNamespaceAware(true);
+
+ // Parse SAMLToken
+ Document document = ppMgr.parse(new ByteArrayInputStream(samlToken));
+ if (document != null){
+ final Element root = document.getDocumentElement();
+ // Get appropriate unmarshaller
+ final UnmarshallerFactory unmarshallerFact = Configuration.getUnmarshallerFactory();
+ // Unmarshall using the SAML Token root element
+ if (unmarshallerFact != null && root != null){
+ final Unmarshaller unmarshaller;
+ if (root.getLocalName().equals(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ unmarshaller = new CustomAttributeQueryUnmarshaller();
+ else
+ unmarshaller = unmarshallerFact.getUnmarshaller(root);
+ try {
+ return unmarshaller.unmarshall(root);
+ } catch (NullPointerException e){
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException", e);
+ }
+ } else {
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException : unmarshallerFact or root is null");
+ }
+ } else {
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException : document is null");
+ }
+ } catch (XMLParserException e) {
+ LOG.error("XML Parsing Error.", e);
+ throw new SAMLEngineException(e);
+ } catch (UnmarshallingException e) {
+ LOG.error("TransformerException.", e);
+ throw new SAMLEngineException(e);
+ } catch (NullPointerException e) {
+ LOG.error("Error element tag incomplet or null.", e);
+ throw new SAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Method that validates an XML Signature contained in a SAML Token.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the SAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final SAMLObject validateSignature(
+ final SignableSAMLObject samlToken) throws SAMLEngineException {
+
+ LOG.info("Validate Signature");
+ signer.validateSignature(samlToken);
+
+ return samlToken;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java
new file mode 100644
index 000000000..e9116ea8c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java
@@ -0,0 +1,885 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.lang.StringUtils;
+import org.joda.time.DateTime;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.common.impl.ExtensionsBuilder;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.AttributeQuery;
+import org.opensaml.saml2.core.AttributeValue;
+import org.opensaml.saml2.core.AuthnContext;
+import org.opensaml.saml2.core.AuthnRequest;
+import org.opensaml.saml2.core.AuthnStatement;
+import org.opensaml.saml2.core.Issuer;
+import org.opensaml.saml2.core.LogoutRequest;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.saml2.core.Status;
+import org.opensaml.saml2.core.StatusCode;
+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.core.impl.AssertionBuilder;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSAny;
+import org.opensaml.xml.schema.XSString;
+import org.opensaml.xml.signature.KeyInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.SPApplication;
+import eu.stork.peps.auth.engine.core.SPCountry;
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import eu.stork.peps.auth.engine.core.SPSector;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryBuilder;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class SAMLEngineUtils.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ */
+public final class SAMLEngineUtils {
+
+ /** The Constant UTF_8. */
+ public static final String UTF_8 = "UTF-8";
+
+ /** The Constant SHA_512. */
+ public static final String SHA_512 = "SHA-512";
+
+
+ /** The generator. */
+ private static SecureRandomIdentifierGenerator generator;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(SAMLEngineUtils.class.getName());
+
+ /**
+ * Method that generates a random value according to NCName grammar.
+ *
+ * NCName ::= NCNameStartChar NCNameChar* NCNameChar ::= NameChar - ':'
+ * NCNameStartChar ::= Letter | '_' NameStartChar ::= ":" | [A-Z] | "_" |
+ * [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] |
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+ * NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] |
+ * [#x203F-#x2040] Name ::= NameStartChar (NameChar)* Letter ::= BaseChar |
+ * Ideographic BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] |
+ * [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] |
+ * [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] |
+ * [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] |
+ * [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] |
+ * [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 |
+ * [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] |
+ * [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] |
+ * [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] |
+ * #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] |
+ * [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] |
+ * [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] |
+ * [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] |
+ * [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 |
+ * [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] |
+ * [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] |
+ * [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] |
+ * #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] |
+ * [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] |
+ * #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] |
+ * [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D |
+ * [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] |
+ * [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] |
+ * [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] |
+ * [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] |
+ * [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] |
+ * [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE |
+ * [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] |
+ * [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 |
+ * [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 |
+ * [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] |
+ * [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] |
+ * #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] |
+ * [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 |
+ * [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] |
+ * [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 |
+ * [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 |
+ * #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 |
+ * #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] |
+ * #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] |
+ * [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] |
+ * [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] |
+ * [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] |
+ * [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] |
+ * [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E |
+ * [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] |
+ * [#xAC00-#xD7A3] Ideographic ::= [#x4E00-#x9FA5] | #x3007 |
+ * [#x3021-#x3029]
+ *
+ * @return Random ID value
+ */
+
+ //Initialization of a generator of identifiers for all token SAML.
+
+ static {
+ loadRandomIdentifierGenerator();
+ }
+
+
+ /**
+ * Load random identifier generator.
+ *
+ *@throws STORKSAMLEngineRuntimeException the STORKSAML engine runtime exception
+ */
+ private static void loadRandomIdentifierGenerator() {
+
+ try {
+ generator = new SecureRandomIdentifierGenerator();
+ } catch (NoSuchAlgorithmException ex) {
+ LOG.error("Error init SecureRandomIdentifierGenerator", ex);
+ throw new STORKSAMLEngineRuntimeException(ex);
+ }
+
+ }
+
+ /**
+ * Creates the SAML object.
+ *
+ * @param qname the QName
+ *
+ * @return the XML object
+ */
+ public static XMLObject createSamlObject(final QName qname) {
+ if (qname.toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ CustomAttributeQueryBuilder builder = new CustomAttributeQueryBuilder();
+ return builder.buildObject(qname);
+ }
+ else
+ {
+ return Configuration.getBuilderFactory().getBuilder(qname).buildObject(
+ qname);
+ }
+ }
+
+ /**
+ * Creates the SAML object.
+ *
+ * @param qname the quality name
+ * @param qname1 the qname1
+ *
+ * @return the xML object
+ */
+ public static XMLObject createSamlObject(final QName qname,
+ final QName qname1) {
+ return Configuration.getBuilderFactory().getBuilder(qname1)
+ .buildObject(qname, qname1);
+ }
+
+ /**
+ * Encode value with an specific algorithm.
+ *
+ * @param value the value
+ * @param alg the algorithm
+ *
+ * @return the string
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static String encode(final String value, final String alg)
+ throws STORKSAMLEngineException {
+ LOG.debug("Encode value with " + alg + " algorithm.");
+ byte[] buffer;
+
+ final StringBuffer hash = new StringBuffer("");
+ try {
+ buffer = value.getBytes(UTF_8);
+ MessageDigest msgDig;
+ msgDig = MessageDigest.getInstance(alg);
+
+
+ msgDig.update(buffer);
+ final byte[] digest = msgDig.digest();
+
+ final int signedByte = 0xff;
+ for (byte aux : digest) {
+ final int byt = aux & signedByte;
+ if (Integer.toHexString(byt).length() == 1) {
+ hash.append('0');
+ }
+ hash.append(Integer.toHexString(byt));
+ }
+
+ } catch (UnsupportedEncodingException e1) {
+ LOG.error("UnsupportedEncodingException: " + UTF_8);
+ throw new STORKSAMLEngineException(e1);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("NoSuchAlgorithmException: " + alg);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ return hash.toString();
+ }
+
+ /**
+ * Generate assertion.
+ *
+ * @param version the version
+ * @param identifier the identifier
+ * @param issueInstant the issue instant
+ * @param issuer the issuer
+ *
+ * @return the assertion
+ */
+ public static Assertion generateAssertion(final SAMLVersion version,
+ final String identifier, final DateTime issueInstant,
+ final Issuer issuer) {
+ final AssertionBuilder assertionBuilder = new AssertionBuilder();
+ final Assertion assertion = assertionBuilder.buildObject();
+ assertion.setVersion(version);
+ assertion.setID(identifier);
+ assertion.setIssueInstant(issueInstant);
+
+ // <saml:Issuer>
+ assertion.setIssuer(issuer);
+ return assertion;
+ }
+
+ /**
+ * Generate authentication statement.
+ *
+ * @param authnInstant the authentication instant
+ * @param authnContext the authentication context
+ *
+ * @return the authentication statement
+ */
+ public static AuthnStatement generateAthnStatement(final DateTime authnInstant,
+ final AuthnContext authnContext) {
+ // <saml:AuthnStatement>
+ final AuthnStatement authnStatement = (AuthnStatement) SAMLEngineUtils
+ .createSamlObject(AuthnStatement.DEFAULT_ELEMENT_NAME);
+
+ authnStatement.setAuthnInstant(authnInstant);
+ authnStatement.setAuthnContext(authnContext);
+
+ return authnStatement;
+ }
+
+
+
+
+
+ /**
+ * Generate attribute from a list of values.
+ *
+ * @param name the name of the attribute.
+ * @param status the status of the parameter: "Available", "NotAvailable" or
+ * "Withheld".
+ * @param values the value of the attribute.
+ * @param isHashing the is hashing with "SHA-512" algorithm.
+ * @return the attribute
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Attribute generateAttrComplex(final String name,
+ final String status, final Map<String, String> values,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute complex: " + name);
+ final Attribute attribute = (Attribute) SAMLEngineUtils
+ .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
+
+ attribute.setName(name);
+ attribute.setNameFormat(Attribute.URI_REFERENCE);
+
+ attribute.getUnknownAttributes().put(
+ new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
+ SAMLCore.STORK10_PREFIX.getValue()), status);
+
+ if (!values.isEmpty()) {
+ LOG.debug("Add attribute values.");
+
+ // Create an attribute that contains all XSAny elements.
+ final XSAny attrValue = (XSAny) SAMLEngineUtils.createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME, XSAny.TYPE_NAME);
+
+ final Iterator<Entry<String, String>> iterator = values.entrySet()
+ .iterator();
+ while (iterator.hasNext()) {
+ final Map.Entry<String, String> pairs = iterator.next();
+
+ final String value = pairs.getValue();
+
+ if (StringUtils.isNotBlank(value)) {
+ // Create the attribute statement
+ final XSAny attrValueSimple = (XSAny) SAMLEngineUtils
+ .createSamlObject(new QName(SAMLCore.STORK10_NS.getValue(),
+ pairs.getKey().toString(),
+ SAMLCore.STORK10_PREFIX.getValue()), XSAny.TYPE_NAME);
+
+ // if it's necessary encode the information.
+ if (isHashing) {
+ attrValueSimple
+ .setTextContent(encode(value, SHA_512));
+ } else {
+ attrValueSimple.setTextContent(value);
+ }
+
+ attrValue.getUnknownXMLObjects().add(attrValueSimple);
+ attribute.getAttributeValues().add(attrValue);
+ }
+ }
+
+ }
+ return attribute;
+ }
+
+ /**
+ * Generate extension.
+ *
+ * @return the extensions
+ */
+ public static Extensions generateExtension() {
+ final ExtensionsBuilder extensionsBuilder = new ExtensionsBuilder();
+ return extensionsBuilder.buildObject(
+ "urn:oasis:names:tc:SAML:2.0:protocol", "Extensions", "saml2p");
+ }
+
+
+
+
+ /**
+ * Generate issuer.
+ *
+ * @return the issuer
+ */
+ public static Issuer generateIssuer() {
+ return (Issuer) SAMLEngineUtils
+ .createSamlObject(Issuer.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate key info.
+ *
+ * @return the key info
+ */
+ public static KeyInfo generateKeyInfo() {
+ return (KeyInfo) SAMLEngineUtils
+ .createSamlObject(KeyInfo.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate name id.
+ *
+ * @return the name id
+ */
+ public static NameID generateNameID() {
+ return (NameID) SAMLEngineUtils
+ .createSamlObject(NameID.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate name id.
+ *
+ * @param nameQualifier the name qualifier
+ * @param format the format
+ * @param spNameQualifier the sP name qualifier
+ *
+ * @return the name id
+ */
+ public static NameID generateNameID(final String nameQualifier,
+ final String format, final String spNameQualifier) {
+ // <saml:NameID>
+ final NameID nameId = (NameID) Configuration.getBuilderFactory()
+ .getBuilder(NameID.DEFAULT_ELEMENT_NAME).buildObject(
+ NameID.DEFAULT_ELEMENT_NAME);
+
+ // optional
+ nameId.setNameQualifier(nameQualifier);
+
+ // optional
+ nameId.setFormat(format);
+
+ // optional
+ nameId.setSPNameQualifier(spNameQualifier);
+
+ return nameId;
+ }
+
+ /**
+ * Generate NCName.
+ *
+ * @return the string
+ */
+ public static String generateNCName() {
+ return generator.generateIdentifier();
+ }
+
+
+ /**
+ * Generate the quality authentication assurance level.
+ *
+ * @param qaal the level of quality authentication assurance.
+ *
+ * @return the quality authentication assurance attribute
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static QAAAttribute generateQAAAttribute(final int qaal)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate QAAAttribute.");
+
+ final QAAAttribute qaaAttribute = (QAAAttribute) SAMLEngineUtils
+ .createSamlObject(QAAAttribute.DEF_ELEMENT_NAME);
+ qaaAttribute.setQaaLevel(String.valueOf(qaal));
+ return qaaAttribute;
+ }
+
+ /**
+ * Generate requested attribute.
+ *
+ * @param name the name
+ * @param friendlyName the friendly name
+ * @param isRequired the is required
+ * @param value the value
+ *
+ * @return the requested attribute
+ */
+ public static RequestedAttribute generateReqAuthnAttributeSimple(
+ final String name, final String friendlyName,
+ final String isRequired, final List<String> value) {
+ LOG.debug("Generate the requested attribute.");
+
+ final RequestedAttribute requested = (RequestedAttribute) SAMLEngineUtils
+ .createSamlObject(RequestedAttribute.DEF_ELEMENT_NAME);
+ requested.setName(name);
+ requested.setNameFormat(RequestedAttribute.URI_REFERENCE);
+
+ requested.setFriendlyName(friendlyName);
+
+ requested.setIsRequired(isRequired);
+
+ // The value is optional in an authentication request.
+ if (!value.isEmpty()) {
+ for (int nextValue = 0; nextValue < value.size(); nextValue++) {
+ final String valor = value.get(nextValue);
+ if (StringUtils.isNotBlank(valor)) {
+
+ if(!name.equals("http://www.stork.gov.eu/1.0/signedDoc")){
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ attrValue.setTextContent(valor.trim());
+ requested.getAttributeValues().add(attrValue);
+
+ }else{
+
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true);
+ Document document = null;
+ DocumentBuilder builder;
+
+ // Parse the signedDoc value into an XML DOM Document
+ try {
+ builder = domFactory.newDocumentBuilder();
+ InputStream is;
+ is = new ByteArrayInputStream(valor.trim().getBytes("UTF-8"));
+ document = builder.parse(is);
+ is.close();
+ } catch (SAXException e1) {
+ LOG.error("SAX Error while parsing signModule attribute", e1);
+ throw new STORKSAMLEngineRuntimeException(e1);
+ } catch (ParserConfigurationException e2) {
+ LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
+ throw new STORKSAMLEngineRuntimeException(e2);
+ } catch (UnsupportedEncodingException e3) {
+ LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
+ throw new STORKSAMLEngineRuntimeException(e3);
+ } catch (IOException e4) {
+ LOG.error("IO Error while parsing signModule attribute", e4);
+ throw new STORKSAMLEngineRuntimeException(e4);
+ }
+
+ // Create the XML statement(this will be overwritten with the previous DOM structure)
+ final XSAny xmlValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "XMLValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ //Set the signedDoc XML content to this element
+ xmlValue.setDOM(document.getDocumentElement());
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ //Add previous signedDocXML to the AttributeValue Element
+ attrValue.getUnknownXMLObjects().add(xmlValue);
+
+ requested.getAttributeValues().add(attrValue);
+ }
+
+
+ }
+ }
+ }
+
+ return requested;
+ }
+
+ /**
+ * Generate response.
+ *
+ * @param version the version
+ * @param identifier the identifier
+ * @param issueInstant the issue instant
+ * @param status the status
+ *
+ * @return the response
+ */
+ public static Response generateResponse(final SAMLVersion version,
+ final String identifier, final DateTime issueInstant,
+ final Status status) {
+ final Response response = (Response) SAMLEngineUtils
+ .createSamlObject(Response.DEFAULT_ELEMENT_NAME);
+ response.setID(identifier);
+ response.setIssueInstant(issueInstant);
+ response.setStatus(status);
+ return response;
+ }
+
+ /**
+ * Method that generates a SAML Authentication Request basing on the
+ * provided information.
+ *
+ * @param identifier the identifier
+ * @param version the version
+ * @param issueInstant the issue instant
+ *
+ * @return the authentication request
+ */
+ public static AuthnRequest generateSAMLAuthnRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate basic authentication request.");
+ final AuthnRequest authnRequest = (AuthnRequest) SAMLEngineUtils
+ .createSamlObject(AuthnRequest.DEFAULT_ELEMENT_NAME);
+
+ authnRequest.setID(identifier);
+ authnRequest.setVersion(version);
+ authnRequest.setIssueInstant(issueInstant);
+ return authnRequest;
+ }
+
+ /*public static AttributeQuery generateSAMLAttrQueryRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate attribute query request.");
+ final AttributeQuery attrQueryRequest = (AttributeQuery) SAMLEngineUtils
+ .createSamlObject(AttributeQuery.DEFAULT_ELEMENT_NAME);
+
+ attrQueryRequest.setID(identifier);
+ attrQueryRequest.setVersion(version);
+ attrQueryRequest.setIssueInstant(issueInstant);
+ return attrQueryRequest;
+ }*/
+
+ public static CustomAttributeQuery generateSAMLAttrQueryRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate attribute query request.");
+ final CustomAttributeQuery attrQueryRequest = (CustomAttributeQuery) SAMLEngineUtils
+ .createSamlObject(CustomAttributeQuery.DEFAULT_ELEMENT_NAME);
+
+ attrQueryRequest.setID(identifier);
+ attrQueryRequest.setVersion(version);
+ attrQueryRequest.setIssueInstant(issueInstant);
+ return attrQueryRequest;
+ }
+
+ public static LogoutRequest generateSAMLLogoutRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate logout request.");
+ final LogoutRequest logoutRequest = (LogoutRequest)SAMLEngineUtils.
+ createSamlObject(LogoutRequest.DEFAULT_ELEMENT_NAME);
+
+
+ logoutRequest.setID(identifier);
+ logoutRequest.setVersion(version);
+ logoutRequest.setIssueInstant(issueInstant);
+ return logoutRequest;
+ }
+
+ public static LogoutResponse generateSAMLLogoutResponse(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant,
+ final Status status, final String inResponseTo) {
+ LOG.debug("Generate logout response.");
+ final LogoutResponse logoutResponse = (LogoutResponse)SAMLEngineUtils.
+ createSamlObject(LogoutResponse.DEFAULT_ELEMENT_NAME);
+
+ logoutResponse.setInResponseTo(inResponseTo);
+ logoutResponse.setStatus(status);
+ logoutResponse.setID(identifier);
+ logoutResponse.setVersion(version);
+ logoutResponse.setIssueInstant(issueInstant);
+ return logoutResponse;
+ }
+
+ /**
+ * Generate service provider application.
+ *
+ * @param spApplication the service provider application
+ *
+ * @return the sP application
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPApplication generateSPApplication(final String spApplication)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPApplication.");
+
+ final SPApplication applicationAttr = (SPApplication) SAMLEngineUtils
+ .createSamlObject(SPApplication.DEF_ELEMENT_NAME);
+ applicationAttr.setSPApplication(spApplication);
+ return applicationAttr;
+ }
+
+ /**
+ * Generate service provider country.
+ *
+ * @param spCountry the service provider country
+ *
+ * @return the service provider country
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPCountry generateSPCountry(final String spCountry)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPApplication.");
+
+ final SPCountry countryAttribute = (SPCountry) SAMLEngineUtils
+ .createSamlObject(SPCountry.DEF_ELEMENT_NAME);
+ countryAttribute.setSPCountry(spCountry);
+ return countryAttribute;
+ }
+
+ /**
+ * Generate service provider institution.
+ *
+ * @param spInstitution the service provider institution
+ *
+ * @return the service provider institution
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPInstitution generateSPInstitution(final String spInstitution)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPInstitution.");
+
+ final SPInstitution institutionAttr = (SPInstitution) SAMLEngineUtils
+ .createSamlObject(SPInstitution.DEF_ELEMENT_NAME);
+ institutionAttr.setSPInstitution(spInstitution);
+ return institutionAttr;
+ }
+
+ /**
+ * Generate service provider sector.
+ *
+ * @param spSector the service provider sector
+ *
+ * @return the service provider sector
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPSector generateSPSector(final String spSector)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPSector.");
+
+ final SPSector sectorAttribute = (SPSector) SAMLEngineUtils
+ .createSamlObject(SPSector.DEF_ELEMENT_NAME);
+ sectorAttribute.setSPSector(spSector);
+ return sectorAttribute;
+ }
+
+ /**
+ * Generate status.
+ *
+ * @param statusCode the status code
+ *
+ * @return the status
+ */
+ public static Status generateStatus(final StatusCode statusCode) {
+ final Status status = (Status) SAMLEngineUtils
+ .createSamlObject(Status.DEFAULT_ELEMENT_NAME);
+ status.setStatusCode(statusCode);
+ return status;
+ }
+
+ /**
+ * Generate status code.
+ *
+ * @param value the value
+ *
+ * @return the status code
+ */
+ public static StatusCode generateStatusCode(final String value) {
+ final StatusCode statusCode = (StatusCode) SAMLEngineUtils
+ .createSamlObject(StatusCode.DEFAULT_ELEMENT_NAME);
+ statusCode.setValue(value);
+ return statusCode;
+ }
+
+
+ /**
+ * Generate status message.
+ *
+ * @param message the message
+ *
+ * @return the status message
+ */
+ public static StatusMessage generateStatusMessage(final String message) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .createSamlObject(StatusMessage.DEFAULT_ELEMENT_NAME);
+ statusMessage.setMessage(message);
+ return statusMessage;
+ }
+
+ /**
+ * Generate subject.
+ *
+ * @return the subject
+ */
+ public static Subject generateSubject() {
+ return (Subject) SAMLEngineUtils
+ .createSamlObject(Subject.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate subject confirmation.
+ *
+ * @param method the method
+ * @param data the data
+ *
+ * @return the subject confirmation
+ */
+ public static SubjectConfirmation generateSubjectConfirmation(
+ final String method, final SubjectConfirmationData data) {
+ final SubjectConfirmation subjectConf = (SubjectConfirmation) Configuration
+ .getBuilderFactory().getBuilder(
+ SubjectConfirmation.DEFAULT_ELEMENT_NAME).buildObject(
+ SubjectConfirmation.DEFAULT_ELEMENT_NAME);
+
+ subjectConf.setMethod(method);
+
+ subjectConf.setSubjectConfirmationData(data);
+
+ return subjectConf;
+ }
+
+
+ /**
+ * Generate subject confirmation data.
+ *
+ * @param notOnOrAfter the not on or after
+ * @param recipient the recipient
+ * @param inResponseTo the in response to
+ *
+ * @return the subject confirmation data
+ */
+ public static SubjectConfirmationData generateSubjectConfirmationData(
+ final DateTime notOnOrAfter, final String recipient,
+ final String inResponseTo) {
+ final SubjectConfirmationData subjectConfData = (SubjectConfirmationData) SAMLEngineUtils
+ .createSamlObject(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
+ subjectConfData.setNotOnOrAfter(notOnOrAfter);
+ subjectConfData.setRecipient(recipient);
+ subjectConfData.setInResponseTo(inResponseTo);
+ return subjectConfData;
+ }
+
+
+ /**
+ * Generate subject locality.
+ *
+ * @param address the address
+ *
+ * @return the subject locality
+ */
+ public static SubjectLocality generateSubjectLocality(final String address) {
+ final SubjectLocality subjectLocality = (SubjectLocality) SAMLEngineUtils
+ .createSamlObject(SubjectLocality.DEFAULT_ELEMENT_NAME);
+ subjectLocality.setAddress(address);
+ return subjectLocality;
+ }
+
+
+
+
+ /**
+ * Method that returns the current time.
+ *
+ * @return the current time
+ */
+ public static DateTime getCurrentTime() {
+ return new DateTime();
+ }
+
+
+ /**
+ * Instantiates a new SAML engine utilities.
+ */
+ private SAMLEngineUtils() {
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java
new file mode 100644
index 000000000..bfec3aa21
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java
@@ -0,0 +1,3705 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.commons.lang.StringUtils;
+import org.bouncycastle.jce.X509Principal;
+import org.joda.time.DateTime;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.AttributeQuery;
+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.AuthnContextDecl;
+import org.opensaml.saml2.core.AuthnRequest;
+import org.opensaml.saml2.core.AuthnStatement;
+import org.opensaml.saml2.core.Conditions;
+import org.opensaml.saml2.core.Issuer;
+import org.opensaml.saml2.core.LogoutRequest;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.saml2.core.OneTimeUse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.saml2.core.Status;
+import org.opensaml.saml2.core.StatusCode;
+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.core.impl.SubjectConfirmationBuilder;
+import org.opensaml.xml.Namespace;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSAny;
+import org.opensaml.xml.schema.impl.XSAnyBuilder;
+import org.opensaml.xml.schema.impl.XSAnyImpl;
+import org.opensaml.xml.schema.impl.XSAnyMarshaller;
+import org.opensaml.xml.schema.impl.XSAnyUnmarshaller;
+import org.opensaml.xml.schema.impl.XSDateTimeImpl;
+import org.opensaml.xml.schema.impl.XSStringImpl;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+import org.opensaml.xml.validation.ValidatorSuite;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.commons.STORKLogoutRequest;
+import eu.stork.peps.auth.commons.STORKLogoutResponse;
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.SPApplication;
+import eu.stork.peps.auth.engine.core.SPCountry;
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import eu.stork.peps.auth.engine.core.SPSector;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeBuilder;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeBuilder;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeBuilder;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPCountryBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPCountryMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPCountryUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPIDBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPIDMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPIDUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInformationBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPInformationMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInformationUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPSectorBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPSectorMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPSectorUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.validator.CustomAttributeQueryValidator;
+import eu.stork.peps.auth.engine.core.validator.ExtensionsSchemaValidator;
+import eu.stork.peps.auth.engine.core.validator.QAAAttributeSchemaValidator;
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * Class that wraps the operations over SAML tokens, both generation and
+ * validation of SAML STORK requests and SAML STORK responses. Complaint with
+ * "OASIS Secure Assertion Markup Language (SAML) 2.0, May 2005", but taking
+ * into account STORK specific requirements.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ */
+public final class STORKSAMLEngine extends SAMLEngine {
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(STORKSAMLEngine.class.getName());
+
+ private static final String ATTRIBUTE_EMPTY_LITERAL = "Attribute name is null or empty.";
+ /**
+ * Gets the single instance of STORKSAMLEngine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @return single instance of STORKSAMLEngine
+ */
+ public static synchronized STORKSAMLEngine getInstance(
+ final String nameInstance) {
+ STORKSAMLEngine engine = null;
+ LOG.info("Get instance: " + nameInstance);
+ try {
+ engine = new STORKSAMLEngine(nameInstance.trim());
+ } catch (Exception e) {
+ LOG.error("Error get instance: " + nameInstance);
+ }
+ return engine;
+ }
+
+ /**
+ * Instantiate a new STORKSAML engine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKSAMLEngine(final String nameInstance)
+ throws STORKSAMLEngineException {
+ // Initialization OpenSAML.
+ super(nameInstance);
+ LOG.info("Register STORK objects provider.");
+ Configuration.registerObjectProvider(QAAAttribute.DEF_ELEMENT_NAME,
+ new QAAAttributeBuilder(), new QAAAttributeMarshaller(),
+ new QAAAttributeUnmarshaller());
+
+ Configuration.registerObjectProvider(EIDSectorShare.DEF_ELEMENT_NAME,
+ new EIDSectorShareBuilder(), new EIDSectorShareMarshaller(),
+ new EIDSectorShareUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ EIDCrossSectorShare.DEF_ELEMENT_NAME,
+ new EIDCrossSectorShareBuilder(),
+ new EIDCrossSectorShareMarshaller(),
+ new EIDCrossSectorShareUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ EIDCrossBorderShare.DEF_ELEMENT_NAME,
+ new EIDCrossBorderShareBuilder(),
+ new EIDCrossBorderShareMarshaller(),
+ new EIDCrossBorderShareUnmarshaller());
+
+ Configuration.registerObjectProvider(SPSector.DEF_ELEMENT_NAME,
+ new SPSectorBuilder(), new SPSectorMarshaller(),
+ new SPSectorUnmarshaller());
+
+ Configuration.registerObjectProvider(SPInstitution.DEF_ELEMENT_NAME,
+ new SPInstitutionBuilder(), new SPInstitutionMarshaller(),
+ new SPInstitutionUnmarshaller());
+
+ Configuration.registerObjectProvider(SPApplication.DEF_ELEMENT_NAME,
+ new SPApplicationBuilder(), new SPApplicationMarshaller(),
+ new SPApplicationUnmarshaller());
+
+ Configuration.registerObjectProvider(SPCountry.DEF_ELEMENT_NAME,
+ new SPCountryBuilder(), new SPCountryMarshaller(),
+ new SPCountryUnmarshaller());
+
+ Configuration.registerObjectProvider(XSAny.TYPE_NAME,
+ new XSAnyBuilder(), new XSAnyMarshaller(),
+ new XSAnyUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ RequestedAttribute.DEF_ELEMENT_NAME,
+ new RequestedAttributeBuilder(),
+ new RequestedAttributeMarshaller(),
+ new RequestedAttributeUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ RequestedAttributes.DEF_ELEMENT_NAME,
+ new RequestedAttributesBuilder(),
+ new RequestedAttributesMarshaller(),
+ new RequestedAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ AuthenticationAttributes.DEF_ELEMENT_NAME,
+ new AuthenticationAttributesBuilder(),
+ new AuthenticationAttributesMarshaller(),
+ new AuthenticationAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ VIDPAuthenticationAttributes.DEF_ELEMENT_NAME,
+ new VIDPAuthenticationAttributesBuilder(),
+ new VIDPAuthenticationAttributesMarshaller(),
+ new VIDPAuthenticationAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ CitizenCountryCode.DEF_ELEMENT_NAME,
+ new CitizenCountryCodeBuilder(),
+ new CitizenCountryCodeMarshaller(),
+ new CitizenCountryCodeUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ SPID.DEF_ELEMENT_NAME,
+ new SPIDBuilder(),
+ new SPIDMarshaller(),
+ new SPIDUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ SPInformation.DEF_ELEMENT_NAME,
+ new SPInformationBuilder(),
+ new SPInformationMarshaller(),
+ new SPInformationUnmarshaller());
+
+ LOG.info("Register STORK object validators.");
+ final ValidatorSuite validatorSuite = new ValidatorSuite(
+ QAAAttribute.DEF_LOCAL_NAME);
+
+ validatorSuite.registerValidator(QAAAttribute.DEF_ELEMENT_NAME,
+ new QAAAttributeSchemaValidator());
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+ validatorSuite.registerValidator(extensions.getElementQName(),
+ new ExtensionsSchemaValidator());
+
+ Configuration.registerValidatorSuite(
+ "stork:QualityAuthenticationAssuranceLevel", validatorSuite);
+
+ }
+
+ /**
+ * Generate authentication response base.
+ *
+ * @param status the status
+ * @param assertConsumerURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ *
+ * @return the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Response genAuthnRespBase(final Status status,
+ final String assertConsumerURL, final String inResponseTo)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate Authentication Response base.");
+ final Response response = SAMLEngineUtils.generateResponse(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), status);
+
+ // Set name Spaces
+ this.setNameSpaces(response);
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer");
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+ issuer.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
+
+ response.setIssuer(issuer);
+
+ // destination Mandatory Stork
+ response.setDestination(assertConsumerURL.trim());
+
+ // inResponseTo Mandatory Stork
+ response.setInResponseTo(inResponseTo.trim());
+
+ // Optional STORK
+ response.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnResponse());
+
+ return response;
+ }
+
+ /**
+ * Generate attribute query response base.
+ *
+ * @param status the status
+ * @param destinationURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ *
+ * @return the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Response genAttrQueryRespBase(final Status status,
+ final String destinationURL, final String inResponseTo)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate Attribute query Response base.");
+ final Response response = SAMLEngineUtils.generateResponse(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), status);
+
+ // Set name Spaces
+ this.setNameSpaces(response);
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer");
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+ issuer.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
+
+ response.setIssuer(issuer);
+
+ // destination Mandatory Stork
+ response.setDestination(destinationURL.trim());
+
+ // inResponseTo Mandatory Stork
+ response.setInResponseTo(inResponseTo.trim());
+
+ // Optional STORK
+ response.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnResponse());
+
+ return response;
+ }
+
+ /**
+ * Generate assertion.
+ *
+ * @param ipAddress the IP address.
+ * @param assertConsumerURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ * @param issuer the issuer
+ * @param notOnOrAfter the not on or after
+ *
+ * @return the assertion
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Assertion generateAssertion(final String ipAddress,
+ final String assertConsumerURL, final String inResponseTo,
+ final String issuer, final DateTime notOnOrAfter)
+ throws STORKSAMLEngineException {
+ LOG.info("Generate Assertion.");
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer to Assertion");
+ final Issuer issuerAssertion = SAMLEngineUtils.generateIssuer();
+ issuerAssertion.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuerAssertion.setFormat(super.getSamlCoreProperties()
+ .getFormatEntity());
+
+ final Assertion assertion = SAMLEngineUtils.generateAssertion(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), issuerAssertion);
+
+ final Subject subject = SAMLEngineUtils.generateSubject();
+
+ // Mandatory STORK verified
+ // String format = NameID.UNSPECIFIED
+ // specification: 'SAML:2.0' exist
+ // opensaml: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
+ // opensaml "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"
+ final String format = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
+
+ final String nameQualifier = "";
+
+ LOG.debug("Generate NameID");
+ final NameID nameId = SAMLEngineUtils.generateNameID(super
+ .getSamlCoreProperties().getResponder(), format, nameQualifier);
+ nameId.setValue(format);
+ subject.setNameID(nameId);
+
+ // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
+ // Optional in other case.
+ LOG.debug("Generate SubjectConfirmationData.");
+ final SubjectConfirmationData dataBearer = SAMLEngineUtils
+ .generateSubjectConfirmationData(SAMLEngineUtils
+ .getCurrentTime(), assertConsumerURL, inResponseTo);
+
+ // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
+ // Optional in other case.
+ LOG.debug("Generate SubjectConfirmation");
+ final SubjectConfirmation subjectConf = SAMLEngineUtils
+ .generateSubjectConfirmation(SubjectConfirmation.METHOD_BEARER,
+ dataBearer);
+
+ final ArrayList<SubjectConfirmation> listSubjectConf = new ArrayList<SubjectConfirmation>();
+ listSubjectConf.add(subjectConf);
+
+ for (final Iterator<SubjectConfirmation> iter = listSubjectConf
+ .iterator(); iter.hasNext();) {
+ final SubjectConfirmation element = iter.next();
+
+ if (SubjectConfirmation.METHOD_BEARER.equals(element.getMethod())) {
+ // ipAddress Mandatory if method is Bearer.
+
+ if (StringUtils.isBlank(ipAddress)) {
+ throw new STORKSAMLEngineException(
+ "ipAddress is null or empty");
+ }
+ element.getSubjectConfirmationData().setAddress(
+ ipAddress.trim());
+ }
+
+ element.getSubjectConfirmationData()
+ .setRecipient(assertConsumerURL);
+ element.getSubjectConfirmationData().setNotOnOrAfter(notOnOrAfter);
+ }
+
+ // The SAML 2.0 specification allows multiple SubjectConfirmations
+ subject.getSubjectConfirmations().addAll(listSubjectConf);
+
+ // Mandatory Stork
+ assertion.setSubject(subject);
+
+ // Conditions that MUST be evaluated when assessing the validity of
+ // and/or when using the assertion.
+ final Conditions conditions = this.generateConditions(SAMLEngineUtils
+ .getCurrentTime(), notOnOrAfter, issuer);
+
+ assertion.setConditions(conditions);
+
+ LOG.debug("Generate stork Authentication Statement.");
+ final AuthnStatement storkAuthnStat = this
+ .generateStorkAuthStatement(ipAddress);
+ assertion.getAuthnStatements().add(storkAuthnStat);
+
+ return assertion;
+ }
+
+ private String getAttributeName(final PersonalAttribute attribute) throws STORKSAMLEngineException {
+ if (StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.error("Attribute name: {} it is not known.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " it is not known.");
+ }
+ return attributeName;
+ }
+ /**
+ * Generate attribute statement.
+ *
+ * @param personalAttrList the personal attribute list
+ * @param isHashing the is hashing
+ *
+ * @return the attribute statement
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ * @throws IOException
+ */
+ private AttributeStatement generateAttributeStatement(
+ final IPersonalAttributeList personalAttrList,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute statement");
+
+ final AttributeStatement attrStatement = (AttributeStatement) SAMLEngineUtils
+ .createSamlObject(AttributeStatement.DEFAULT_ELEMENT_NAME);
+
+ for (PersonalAttribute attribute : personalAttrList) {
+
+ String attributeName = getAttributeName(attribute);
+
+ // Verification that only one value it's permitted, simple or
+ // complex, not both.
+
+ final boolean simpleNull = (attribute.getValue() == null);
+ final boolean simpleEmpty = (simpleNull || (!simpleNull && attribute
+ .getValue().isEmpty()));
+
+ final boolean complexNull = (attribute.getComplexValue() == null);
+ final boolean complexEmpty = (complexNull || (!complexNull && attribute
+ .getComplexValue().isEmpty()));
+
+ if ((!simpleEmpty && !complexEmpty)) {
+ throw new STORKSAMLEngineException(
+ "Attribute name: "
+ + attribute.getName()
+ + " must be contain one value, simple or complex value.");
+ } else {
+
+ if (!simpleEmpty) {
+ attrStatement.getAttributes().add(
+ this.generateAttrSimple(attributeName, attribute
+ .getStatus(), attribute.getValue(),
+ isHashing));
+ } else if (!complexEmpty) {
+ attrStatement.getAttributes().add(
+ SAMLEngineUtils.generateAttrComplex(attributeName,
+ attribute.getStatus(), attribute
+ .getComplexValue(), isHashing));
+ } else if (!simpleNull) {
+ attrStatement.getAttributes().add(
+ this.generateAttrSimple(attributeName, attribute
+ .getStatus(), new ArrayList<String>(),
+ isHashing));
+ } else {
+ // Add attribute complex.
+ attrStatement.getAttributes().add(
+ SAMLEngineUtils.generateAttrComplex(attributeName,
+ attribute.getStatus(),
+ new HashMap<String, String>(), isHashing));
+ }
+ }
+ }
+ return attrStatement;
+ }
+ private XSAny createAttributeValueForSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true);
+ Document document = null;
+ DocumentBuilder builder;
+
+ // Parse the signedDoc value into an XML DOM Document
+ try {
+ builder = domFactory.newDocumentBuilder();
+ InputStream is;
+ is = new ByteArrayInputStream(value.trim().getBytes("UTF-8"));
+ document = builder.parse(is);
+ is.close();
+ } catch (SAXException e1) {
+ LOG.error("SAX Error while parsing signModule attribute", e1);
+ throw new STORKSAMLEngineRuntimeException(e1);
+ } catch (ParserConfigurationException e2) {
+ LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
+ throw new STORKSAMLEngineRuntimeException(e2);
+ } catch (UnsupportedEncodingException e3) {
+ LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
+ throw new STORKSAMLEngineRuntimeException(e3);
+ } catch (IOException e4) {
+ LOG.error("IO Error while parsing signModule attribute", e4);
+ throw new STORKSAMLEngineRuntimeException(e4);
+ }
+
+ // Create the attribute statement
+ final XSAny xmlValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+
+ //Set the signedDoc XML content to this element
+ xmlValue.setDOM(document.getDocumentElement());
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+
+ //Add previous signedDocXML to the AttributeValue Element
+
+ // if it's necessary encode the information.
+ if (!isHashing) {
+ attrValue.getUnknownXMLObjects().add(xmlValue);
+ }
+ return attrValue;
+ }
+
+ private XSAny createAttributeValueForNonSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+ // if it's necessary encode the information.
+ if (isHashing) {
+ attrValue.setTextContent(SAMLEngineUtils.encode(value, SAMLEngineUtils.SHA_512));
+ } else {
+ attrValue.setTextContent(value);
+ }
+ return attrValue;
+ }
+
+ /**
+ * Generate attribute from a list of values.
+ *
+ * @param name the name of the attribute.
+ * @param values the value of the attribute.
+ * @param isHashing the is hashing with "SHA-512" algorithm.
+ * @param status the status of the parameter: "Available", "NotAvailable" or
+ * "Withheld".
+ *
+ * @return the attribute
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Attribute generateAttrSimple(final String name,
+ final String status, final List<String> values,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute simple: " + name);
+ final Attribute attribute = (Attribute) SAMLEngineUtils
+ .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
+
+ attribute.setName(name);
+ attribute.setNameFormat(Attribute.URI_REFERENCE);
+
+ attribute.getUnknownAttributes().put(
+ new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
+ SAMLCore.STORK10_PREFIX.getValue()), status);
+
+ if (values != null) {
+ LOG.debug("Add attribute values.");
+ for (int i = 0; i < values.size(); i++) {
+ final String value = values.get(i);
+ if (StringUtils.isNotBlank(value)) {
+ XSAny attrValue = null;
+ if (!name.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+ // Create the attribute statement
+ attrValue = createAttributeValueForNonSignedDoc(value, isHashing);
+
+ } else {
+ attrValue = createAttributeValueForSignedDoc(value, isHashing);
+ attribute.getAttributeValues().add(attrValue);
+ }
+ attribute.getAttributeValues().add(attrValue);
+ }
+ }
+ }
+ return attribute;
+ }
+
+ /**
+ * Generate conditions that MUST be evaluated when assessing the validity of
+ * and/or when using the assertion.
+ *
+ * @param notBefore the not before
+ * @param notOnOrAfter the not on or after
+ * @param audienceURI the audience URI.
+ *
+ * @return the conditions
+ */
+ private Conditions generateConditions(final DateTime notBefore,
+ final DateTime notOnOrAfter, final String audienceURI) {
+ LOG.debug("Generate conditions.");
+ final Conditions conditions = (Conditions) SAMLEngineUtils
+ .createSamlObject(Conditions.DEFAULT_ELEMENT_NAME);
+ conditions.setNotBefore(notBefore);
+ conditions.setNotOnOrAfter(notOnOrAfter);
+
+ final AudienceRestriction restrictions = (AudienceRestriction) SAMLEngineUtils
+ .createSamlObject(AudienceRestriction.DEFAULT_ELEMENT_NAME);
+
+ final Audience audience = (Audience) SAMLEngineUtils
+ .createSamlObject(Audience.DEFAULT_ELEMENT_NAME);
+ audience.setAudienceURI(audienceURI);
+
+ restrictions.getAudiences().add(audience);
+ conditions.getAudienceRestrictions().add(restrictions);
+
+ if (super.getSamlCoreProperties().isOneTimeUse()) {
+ final OneTimeUse oneTimeUse = (OneTimeUse) SAMLEngineUtils
+ .createSamlObject(OneTimeUse.DEFAULT_ELEMENT_NAME);
+ conditions.getConditions().add(oneTimeUse);
+ }
+ return conditions;
+ }
+
+ /**
+ * Generate personal attribute list.
+ *
+ * @param assertion the assertion
+ *
+ * @return the personal attribute list
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private IPersonalAttributeList generatePersonalAttributeList(
+ final Assertion assertion) throws STORKSAMLEngineException {
+ LOG.debug("Generate personal attribute list from XMLObject.");
+ final List<XMLObject> listExtensions = assertion.getOrderedChildren();
+
+ boolean find = false;
+ AttributeStatement requestedAttr = null;
+
+ // Search the attribute statement.
+ for (int i = 0; i < listExtensions.size() && !find; i++) {
+ final XMLObject xml = listExtensions.get(i);
+ if (xml instanceof AttributeStatement) {
+ requestedAttr = (AttributeStatement) xml;
+ find = true;
+ }
+ }
+
+ if (!find) {
+ LOG.error("Error: AttributeStatement it's not present.");
+ throw new STORKSAMLEngineException(
+ "AttributeStatement it's not present.");
+ }
+
+ final List<Attribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+ String attributeName;
+
+ // Process the attributes.
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final Attribute attribute = reqAttrs.get(nextAttribute);
+
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+
+ attributeName = attribute.getName();
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ personalAttribute.setStatus(attribute.getUnknownAttributes().get(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeStatus", SAMLCore.STORK10_PREFIX
+ .getValue())));
+
+ final ArrayList<String> simpleValues = new ArrayList<String>();
+ final HashMap<String, String> multiValues = new HashMap<String, String>();
+
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+
+ // Process the values.
+ for (int nextValue = 0; nextValue < values.size(); nextValue++) {
+
+ final XMLObject xmlObject = values.get(nextValue);
+
+ if (xmlObject instanceof XSStringImpl) {
+
+ simpleValues.add(((XSStringImpl) xmlObject).getValue());
+
+ } else if (xmlObject instanceof XSAnyImpl) {
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextValue);
+
+ TransformerFactory transFactory = TransformerFactory
+ .newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(
+ OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString
+ .getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ simpleValues.add(str);
+
+ } else if (isComplex(xmlObject))
+ {
+ LOG.info(attributeName + " found");
+ // Process complex value.
+ final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
+
+ for (int nextComplexValue = 0; nextComplexValue < complexValue
+ .getUnknownXMLObjects().size(); nextComplexValue++) {
+
+ final XSAnyImpl simple = (XSAnyImpl) complexValue
+ .getUnknownXMLObjects().get(
+ nextComplexValue);
+
+ multiValues.put(simple.getElementQName()
+ .getLocalPart(), simple.getTextContent());
+ }
+
+ }
+ else {
+ // Process simple value.
+ simpleValues.add(((XSAnyImpl) xmlObject)
+ .getTextContent());
+ }
+
+ } else {
+ LOG.error("Error: attribute value it's unknown.");
+ throw new STORKSAMLEngineException(
+ "Attribute value it's unknown.");
+ }
+ }
+
+ personalAttribute.setValue(simpleValues);
+ personalAttribute.setComplexValue(multiValues);
+ personalAttrList.add(personalAttribute);
+ }
+
+ return personalAttrList;
+ }
+
+ /**
+ * Generate stork authentication request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * authentication request.
+ *
+ * @return the STORK authentication request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnRequest generateSTORKAuthnRequest(
+ final STORKAuthnRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate SAMLAuthnRequest.");
+
+ // Validate Parameters mandatories
+ validateParamAuthnReq(request);
+
+ final AuthnRequest authnRequestAux = SAMLEngineUtils
+ .generateSAMLAuthnRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(authnRequestAux);
+
+ // Add parameter Mandatory STORK
+ authnRequestAux.setForceAuthn(Boolean.TRUE);
+
+ // Add parameter Mandatory STORK
+ authnRequestAux.setIsPassive(Boolean.FALSE);
+
+ authnRequestAux.setAssertionConsumerServiceURL(request
+ .getAssertionConsumerServiceURL());
+
+ authnRequestAux.setProviderName(request.getProviderName());
+
+ // Add protocol binding
+ authnRequestAux.setProtocolBinding(super.getSamlCoreProperties()
+ .getProtocolBinding());
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ authnRequestAux.setDestination(request.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ authnRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ authnRequestAux.setIssuer(issuer);
+
+ // Generate stork extensions.
+ final Extensions storkExtensions = this
+ .generateSTORKExtensions(request);
+ // add the extensions to the SAMLAuthnRequest
+ authnRequestAux.setExtensions(storkExtensions);
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKAuthnRequest authRequest = processExtensions(authnRequestAux
+ .getExtensions());
+
+ try {
+ authRequest.setTokenSaml(super.signAndMarshall(authnRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ authRequest.setSamlId(authnRequestAux.getID());
+ authRequest.setDestination(authnRequestAux.getDestination());
+ authRequest.setAssertionConsumerServiceURL(authnRequestAux
+ .getAssertionConsumerServiceURL());
+
+ authRequest.setProviderName(authnRequestAux.getProviderName());
+ authRequest.setIssuer(authnRequestAux.getIssuer().getValue());
+
+ return authRequest;
+ }
+
+ /**
+ * Generate stork authentication response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponse(
+ final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq, final String ipAddress,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponse");
+
+ // Validate parameters
+ validateParamResponse(request, responseAuthReq);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAuthReq
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+
+ final STORKAuthnResponse authresponse = new STORKAuthnResponse();
+
+ try {
+ authresponse.setTokenSaml(super.signAndMarshall(response));
+ authresponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return authresponse;
+ }
+
+ /**
+ * Generate stork authentication response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponseAfterQuery(
+ final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq, final String ipAddress,
+ final boolean isHashing, List<STORKAttrQueryResponse> res) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponse");
+
+ // Validate parameters
+ validateParamResponse(request, responseAuthReq);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAuthReq
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+ // Check for response queries
+ if (res != null && res.size() > 0)
+ {
+ //Iterate through them
+ for (int i = 0; i < res.size(); i++)
+ {
+ //If response contains multiple assertions iterate through them as well
+ if (res.get(i).getAssertions().size() > 1)
+ {
+ for (int j = 0; j < res.get(i).getAssertions().size(); j++)
+ {
+ Assertion tempAssertion = res.get(i).getAssertions().get(j);
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ } else {
+ Assertion tempAssertion = res.get(i).getAssertion();
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ }
+ }
+
+ final STORKAuthnResponse authresponse = new STORKAuthnResponse();
+
+ try {
+ authresponse.setTokenSaml(super.signAndMarshall(response));
+ authresponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return authresponse;
+ }
+
+ /**
+ * Generate stork authentication response fail.
+ *
+ * @param request the request
+ * @param response the response
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponseFail(
+ final STORKAuthnRequest request, final STORKAuthnResponse response,
+ final String ipAddress, final boolean isHashing)
+ throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponseFail");
+
+ validateParamResponseFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ LOG.debug("Generate Response.");
+ // RESPONSE
+ final Response responseFail = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ responseFail.getAssertions().add(assertion);
+
+ LOG.debug("Sign and Marshall ResponseFail.");
+
+ final STORKAuthnResponse storkResponse = new STORKAuthnResponse();
+
+ try {
+ storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
+ storkResponse.setSamlId(responseFail.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return storkResponse;
+ }
+
+ /**
+ * Generate stork attribute query request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * attribute query request.
+ *
+ * @return the STORK attribute query request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryRequest generateSTORKAttrQueryRequest(
+ final STORKAttrQueryRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKAttrQueryRequest.");
+
+ // Validate Parameters mandatories
+ validateParamAttrQueryReq(request);
+
+ //final AttributeQuery attrQueryRequestAux = SAMLEngineUtils
+ final CustomAttributeQuery attrQueryRequestAux = SAMLEngineUtils
+ .generateSAMLAttrQueryRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(attrQueryRequestAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ attrQueryRequestAux.setDestination(request.getDestination());
+ }
+
+ // Add parameter optional STORK
+ // Consumer URL is needed if using HTTP-Post
+ if (StringUtils.isNotBlank(request.getAssertionConsumerServiceURL())) {
+ attrQueryRequestAux.setAssertionConsumerServiceURL(request.getAssertionConsumerServiceURL());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ attrQueryRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+ //Set the subject - needed for attribute query validation
+ Subject subject = SAMLEngineUtils.generateSubject();
+ SubjectConfirmationBuilder builder = new SubjectConfirmationBuilder();
+ SubjectConfirmation subjectConfirmation = builder.buildObject();
+ subjectConfirmation.setMethod("urn:oasis:names:tc:SAML:2.0:cm:bearer");
+ subject.getSubjectConfirmations().add(subjectConfirmation);
+ attrQueryRequestAux.setSubject(subject);
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ attrQueryRequestAux.setIssuer(issuer);
+
+ // Generate stork extensions.
+ final Extensions storkExtensions = this
+ .generateSTORKAttrExtensions(request);
+ // add the extensions to the SAMLAuthnRequest
+ attrQueryRequestAux.setExtensions(storkExtensions);
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKAttrQueryRequest attrQueryRequest = processAttrExtensions(attrQueryRequestAux
+ .getExtensions());
+
+ try {
+ attrQueryRequest.setTokenSaml(super.signAndMarshall(attrQueryRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ attrQueryRequest.setSamlId(attrQueryRequestAux.getID());
+ attrQueryRequest.setDestination(attrQueryRequestAux.getDestination());
+ attrQueryRequest.setAssertionConsumerServiceURL(attrQueryRequestAux.getAssertionConsumerServiceURL());
+ attrQueryRequest.setIssuer(attrQueryRequestAux.getIssuer().getValue());
+
+ return attrQueryRequest;
+ }
+
+ /**
+ * Generate stork attribute query response.
+ *
+ * @param request the request
+ * @param responseAttrQueryRes the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the hashing of values
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponse(
+ final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse responseAttrQueryRes, final String ipAddress,
+ final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponse");
+
+ // Validate parameters
+ validateParamAttrQueryResponse(request, responseAttrQueryRes);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, ""
+ ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAttrQueryRes
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ try {
+ attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
+ attrQueryResponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return attrQueryResponse;
+ }
+
+ /**
+ * Generate stork attribute query response from multiple assertions
+ *
+ * @param request the request
+ * @param responseAttrQueryRes the response to the query request
+ * @param responses the responses to include in the response (aggregation)
+ * @param ipAddress the IP address
+ * @param isHashing the hashing of values
+ *
+ * @return the sTORK attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponseWithAssertions(
+ final STORKAttrQueryRequest request, final STORKAttrQueryResponse responseAttrQueryRes,
+ final List<STORKAttrQueryResponse> responses, final String ipAddress,
+ final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponse");
+
+ // Validate parameters
+ validateParamAttrQueryResponse(request, responseAttrQueryRes);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, ""
+ ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAttrQueryRes
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add the assertions from the former Query responses
+ response.getAssertions().add(assertion);
+ if (responses != null && responses.size() > 0)
+ {
+ for (int i = 0; i < responses.size(); i++)
+ {
+ Assertion tempAssertion = responses.get(i).getAssertion();
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ }
+
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ try {
+ attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
+ attrQueryResponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return attrQueryResponse;
+ }
+
+ /**
+ * Generate stork attribute query response fail.
+ *
+ * @param request the request
+ * @param response the response
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the STORK attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponseFail(
+ final STORKAttrQueryRequest request, final STORKAttrQueryResponse response,
+ final String ipAddress, final String destinationUrl, final boolean isHashing)
+ throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponseFail");
+
+ validateParamAttrQueryResponseFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ LOG.debug("Generate Response.");
+ // RESPONSE
+ final Response responseFail = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, "",
+ request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ responseFail.getAssertions().add(assertion);
+
+ LOG.debug("Sign and Marshall ResponseFail.");
+
+ final STORKAttrQueryResponse storkResponse = new STORKAttrQueryResponse();
+
+ try {
+ storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
+ storkResponse.setSamlId(responseFail.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return storkResponse;
+ }
+
+ /**
+ * Generate stork logout request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutRequest generateSTORKLogoutRequest(
+ final STORKLogoutRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutRequest.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutReq(request);
+
+ final LogoutRequest logoutRequestAux = SAMLEngineUtils
+ .generateSAMLLogoutRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(logoutRequestAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ logoutRequestAux.setDestination(request.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutRequestAux.setIssuer(issuer);
+
+ // Set the name ID
+ final NameID newNameID = SAMLEngineUtils.generateNameID();
+ newNameID.setValue(request.getSpProvidedId());
+ logoutRequestAux.setNameID(newNameID);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
+
+ try {
+ logoutRequest.setTokenSaml(super.signAndMarshall(logoutRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutRequest.setSamlId(logoutRequestAux.getID());
+ logoutRequest.setDestination(logoutRequestAux.getDestination());
+ logoutRequest.setIssuer(logoutRequestAux.getIssuer().getValue());
+ logoutRequest.setSpProvidedId(logoutRequestAux.getNameID().getValue());
+
+ return logoutRequest;
+ }
+
+
+ /**
+ * Generate stork logout response.
+ * @param request the request thats being responded to
+ * @param response the tesponse that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout response that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutResponse generateSTORKLogoutResponse(
+ final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutResponse.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutRes(request, response);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ final LogoutResponse logoutResponseAux= SAMLEngineUtils
+ .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime(), status, request.getSamlId());
+
+ // Set name spaces.
+ setNameSpaces(logoutResponseAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(response.getDestination())) {
+ logoutResponseAux.setDestination(response.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutResponseAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(response.getIssuer()!=null){
+ issuer.setValue(response.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutResponseAux.setIssuer(issuer);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
+
+ try {
+ logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutResponse.setSamlId(logoutResponseAux.getID());
+ logoutResponse.setDestination(logoutResponseAux.getDestination());
+ logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
+ logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
+ logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
+
+ return logoutResponse;
+ }
+
+ /**
+ * Generate failed stork logout response.
+ *
+ * @param response the response that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout response that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutResponse generateSTORKLogoutResponseFail(
+ final STORKLogoutRequest request,
+ final STORKLogoutResponse response ) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutResponse.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutResFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getStatusMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getStatusMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ final LogoutResponse logoutResponseAux= SAMLEngineUtils
+ .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime(), status, request.getSamlId());
+
+ // Set name spaces.
+ setNameSpaces(logoutResponseAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(response.getDestination())) {
+ logoutResponseAux.setDestination(response.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutResponseAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(response.getIssuer()!=null){
+ issuer.setValue(response.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutResponseAux.setIssuer(issuer);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
+
+ try {
+ logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutResponse.setSamlId(logoutResponseAux.getID());
+ logoutResponse.setDestination(logoutResponseAux.getDestination());
+ logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
+ logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
+ logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
+
+ return logoutResponse;
+ }
+
+ /**
+ * Generate stork authentication statement for the authentication statement.
+ *
+ * @param ipAddress the IP address
+ *
+ * @return the authentication statement
+ */
+ private AuthnStatement generateStorkAuthStatement(final String ipAddress) {
+ LOG.debug("Generate stork authenticate statement.");
+ final SubjectLocality subjectLocality = SAMLEngineUtils
+ .generateSubjectLocality(ipAddress);
+
+ final AuthnContext authnContext = (AuthnContext) SAMLEngineUtils
+ .createSamlObject(AuthnContext.DEFAULT_ELEMENT_NAME);
+
+ final AuthnContextDecl authnContextDecl = (AuthnContextDecl) SAMLEngineUtils
+ .createSamlObject(AuthnContextDecl.DEFAULT_ELEMENT_NAME);
+
+ authnContext.setAuthnContextDecl(authnContextDecl);
+
+ final AuthnStatement authnStatement = SAMLEngineUtils
+ .generateAthnStatement(new DateTime(), authnContext);
+
+ // Optional STORK
+ authnStatement.setSessionIndex(null);
+ authnStatement.setSubjectLocality(subjectLocality);
+
+ return authnStatement;
+ }
+
+ /**
+ * Generate stork extensions.
+ *
+ * @param request the request
+ *
+ * @return the extensions
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Extensions generateSTORKExtensions(final STORKAuthnRequest request)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate STORKExtensions");
+
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+
+ LOG.debug("Generate QAAAttribute");
+ final QAAAttribute qaaAttribute = SAMLEngineUtils
+ .generateQAAAttribute(request.getQaa());
+ extensions.getUnknownXMLObjects().add(qaaAttribute);
+
+
+ if (StringUtils.isNotEmpty(request
+ .getSpSector())) {
+ // Add information about service provider.
+ LOG.debug("Generate SPSector");
+ final SPSector sector = SAMLEngineUtils.generateSPSector(request
+ .getSpSector());
+ extensions.getUnknownXMLObjects().add(sector);
+ }
+
+ //Delete from specification. Kept for compatibility with Provider Name value
+ LOG.debug("Generate SPInstitution");
+ final SPInstitution institution = SAMLEngineUtils
+ .generateSPInstitution(request.getProviderName());
+ extensions.getUnknownXMLObjects().add(institution);
+
+
+ if (StringUtils.isNotEmpty(request.getSpApplication())) {
+ LOG.debug("Generate SPApplication");
+ final SPApplication application = SAMLEngineUtils
+ .generateSPApplication(request.getSpApplication());
+ extensions.getUnknownXMLObjects().add(application);
+ }
+
+ if (StringUtils.isNotEmpty(request.getSpCountry())) {
+ LOG.debug("Generate SPCountry");
+ final SPCountry country = SAMLEngineUtils.generateSPCountry(request
+ .getSpCountry());
+ extensions.getUnknownXMLObjects().add(country);
+ }
+
+ //eIDSectorShare: optional; default value: false.
+ String valueSectorShare = super.getSamlCoreProperties()
+ .iseIDSectorShare();
+
+ if (StringUtils.isNotEmpty(valueSectorShare)) {
+ // Add information about the use of the SAML message.
+ LOG.debug("Generate EIDSectorShare");
+ final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
+
+ eIdSectorShare.setEIDSectorShare(String.valueOf(Boolean.valueOf(valueSectorShare)));
+
+ extensions.getUnknownXMLObjects().add(eIdSectorShare);
+ }
+
+ String valueCrossSectorShare = super.getSamlCoreProperties()
+ .iseIDCrossSectorShare();
+
+ if (StringUtils.isNotEmpty(valueCrossSectorShare)) {
+ LOG.debug("Generate EIDCrossSectorShare");
+ final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(Boolean.valueOf(valueCrossSectorShare)));
+ extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
+ }
+
+
+ String valueCrossBorderShare = super.getSamlCoreProperties()
+ .iseIDCrossBorderShare();
+
+ if (StringUtils.isNotEmpty(valueCrossBorderShare)) {
+ LOG.debug("Generate EIDCrossBorderShare");
+ final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(Boolean.valueOf(valueCrossBorderShare)));
+ extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
+ }
+
+
+ // Add information about requested attributes.
+ LOG.debug("Generate RequestedAttributes.");
+ final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
+ .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
+
+ LOG.debug("SAML Engine configuration properties load.");
+ final Iterator<PersonalAttribute> iterator = request
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ if (attribute == null || StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ // Verified if exits the attribute name.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.debug("Attribute name: {} was not found.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " was not found.");
+ }
+
+ // Friendly name it's an optional attribute.
+ String friendlyName = null;
+
+ if (super.getSamlCoreProperties().isFriendlyName()) {
+ friendlyName = attribute.getName();
+ }
+
+
+ String isRequired = null;
+ if (super.getSamlCoreProperties().isRequired()) {
+ isRequired = String.valueOf(attribute.isRequired());
+ }
+
+
+ LOG.debug("Generate requested attribute: " + attributeName);
+ final RequestedAttribute requestedAttr = SAMLEngineUtils
+ .generateReqAuthnAttributeSimple(attributeName,
+ friendlyName, isRequired, attribute
+ .getValue());
+
+ // Add requested attribute.
+ reqAttributes.getAttributes().add(requestedAttr);
+ }
+
+ // Add requested attributes.
+ extensions.getUnknownXMLObjects().add(reqAttributes);
+
+ CitizenCountryCode citizenCountryCode = null;
+ if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
+ LOG.debug("Generate CitizenCountryCode");
+ citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
+ .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
+
+ citizenCountryCode.setCitizenCountryCode(request
+ .getCitizenCountryCode().toUpperCase());
+ }
+
+ SPID spid = null;
+ if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
+ LOG.debug("Generate SPID");
+ spid = (SPID) SAMLEngineUtils
+ .createSamlObject(SPID.DEF_ELEMENT_NAME);
+
+ spid.setSPID(request.getSPID().toUpperCase());
+ }
+
+ AuthenticationAttributes authenticationAttr = (AuthenticationAttributes) SAMLEngineUtils
+ .createSamlObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ final VIDPAuthenticationAttributes vIDPauthenticationAttr = (VIDPAuthenticationAttributes) SAMLEngineUtils
+ .createSamlObject(VIDPAuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ final SPInformation spInformation = (SPInformation) SAMLEngineUtils
+ .createSamlObject(SPInformation.DEF_ELEMENT_NAME);
+
+ if(citizenCountryCode!=null){
+ vIDPauthenticationAttr.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ if(spid!=null){
+ spInformation.setSPID(spid);
+ }
+
+ vIDPauthenticationAttr.setSPInformation(spInformation);
+
+ authenticationAttr
+ .setVIDPAuthenticationAttributes(vIDPauthenticationAttr);
+ extensions.getUnknownXMLObjects().add(authenticationAttr);
+
+
+ return extensions;
+
+ }
+
+ /**
+ * Generate stork extensions.
+ *
+ * @param request the attribute query request
+ *
+ * @return the extensions
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Extensions generateSTORKAttrExtensions(final STORKAttrQueryRequest request)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate STORKExtensions");
+
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+
+ LOG.debug("Generate QAAAttribute");
+ final QAAAttribute qaaAttribute = SAMLEngineUtils
+ .generateQAAAttribute(request.getQaa());
+ extensions.getUnknownXMLObjects().add(qaaAttribute);
+
+
+ if (StringUtils.isNotEmpty(request
+ .getSpSector())) {
+ // Add information about service provider.
+ LOG.debug("Generate SPSector");
+ final SPSector sector = SAMLEngineUtils.generateSPSector(request
+ .getSpSector());
+ extensions.getUnknownXMLObjects().add(sector);
+ }
+
+
+ if (StringUtils.isNotEmpty(request.getSpApplication())) {
+ LOG.debug("Generate SPApplication");
+ final SPApplication application = SAMLEngineUtils
+ .generateSPApplication(request.getSpApplication());
+ extensions.getUnknownXMLObjects().add(application);
+ }
+
+ if (StringUtils.isNotEmpty(request.getSpCountry())) {
+ LOG.debug("Generate SPCountry");
+ final SPCountry country = SAMLEngineUtils.generateSPCountry(request
+ .getSpCountry());
+ extensions.getUnknownXMLObjects().add(country);
+ }
+
+ final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
+
+ eIdSectorShare.setEIDSectorShare(String.valueOf(request.isEIDSectorShare()));
+
+ extensions.getUnknownXMLObjects().add(eIdSectorShare);
+
+ final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(request.isEIDCrossSectorShare()));
+ extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
+
+ final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(request.isEIDCrossBorderShare()));
+ extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
+
+
+ // Add information about requested attributes.
+ LOG.debug("Generate RequestedAttributes.");
+ final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
+ .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
+
+ LOG.debug("SAML Engine configuration properties load.");
+ final Iterator<PersonalAttribute> iterator = request
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ if (attribute == null || StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ // Verified if exits the attribute name.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.debug("Attribute name: {} was not found.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " was not found.");
+ }
+
+ // Friendly name it's an optional attribute.
+ String friendlyName = null;
+
+ if (super.getSamlCoreProperties().isFriendlyName()) {
+ friendlyName = attribute.getName();
+ }
+
+
+ String isRequired = null;
+ if (super.getSamlCoreProperties().isRequired()) {
+ isRequired = String.valueOf(attribute.isRequired());
+ }
+
+
+ LOG.debug("Generate requested attribute: " + attributeName);
+ final RequestedAttribute requestedAttr = SAMLEngineUtils
+ .generateReqAuthnAttributeSimple(attributeName,
+ friendlyName, isRequired, attribute
+ .getValue());
+
+ // Add requested attribute.
+ reqAttributes.getAttributes().add(requestedAttr);
+ }
+
+ // Add requested attributes.
+ extensions.getUnknownXMLObjects().add(reqAttributes);
+
+ CitizenCountryCode citizenCountryCode = null;
+ if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
+ LOG.debug("Generate CitizenCountryCode");
+ citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
+ .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
+
+ citizenCountryCode.setCitizenCountryCode(request
+ .getCitizenCountryCode().toUpperCase());
+ }
+
+ SPID spid = null;
+ if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
+ LOG.debug("Generate SPID");
+ spid = (SPID) SAMLEngineUtils
+ .createSamlObject(SPID.DEF_ELEMENT_NAME);
+
+ spid.setSPID(request.getSPID().toUpperCase());
+ }
+
+
+ return extensions;
+
+ }
+
+ /**
+ * Gets the alias from X.509 Certificate at keystore.
+ *
+ * @param keyInfo the key info
+ * @param storkOwnKeyStore
+ * @param storkOwnKeyStore
+ *
+ * @return the alias
+ */
+ private String getAlias(final KeyInfo keyInfo, KeyStore storkOwnKeyStore) {
+
+ LOG.debug("Recover alias information");
+
+ String alias = null;
+ try {
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ // Transform the KeyInfo to X509Certificate.
+ CertificateFactory certFact;
+ certFact = CertificateFactory.getInstance("X.509");
+
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ final String tokenSerialNumber = cert.getSerialNumber().toString(16);
+ final X509Principal tokenIssuerDN = new X509Principal(cert.getIssuerDN().getName());
+
+
+ String aliasCert;
+ X509Certificate certificate;
+ boolean find = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements()
+ && !find; ) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate
+ .getIssuerDN().getName());
+
+ if(serialNum.equalsIgnoreCase(tokenSerialNumber)
+ && X509PrincipalUtil.equals2(issuerDN, tokenIssuerDN)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ } catch (KeyStoreException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ } catch (CertificateException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ } catch (RuntimeException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ }
+ return alias;
+ }
+
+ /**
+ * Gets the country from X.509 Certificate.
+ *
+ * @param keyInfo the key info
+ *
+ * @return the country
+ */
+ private String getCountry(final KeyInfo keyInfo) {
+ LOG.debug("Recover country information.");
+
+ String result = "";
+ try {
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ // Transform the KeyInfo to X509Certificate.
+ CertificateFactory certFact;
+ certFact = CertificateFactory.getInstance("X.509");
+
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ String distName = cert.getSubjectDN().toString();
+
+ distName = StringUtils.deleteWhitespace(StringUtils
+ .upperCase(distName));
+
+ final String countryCode = "C=";
+ final int init = distName.indexOf(countryCode);
+
+ if (init > StringUtils.INDEX_NOT_FOUND) { // Exist country code.
+ int end = distName.indexOf(',', init);
+
+ if (end <= StringUtils.INDEX_NOT_FOUND) {
+ end = distName.length();
+ }
+
+ if (init < end && end > StringUtils.INDEX_NOT_FOUND) {
+ result = distName.substring(init + countryCode.length(),
+ end);
+ //It must be a two characters value
+ if(result.length()>2){
+ result = result.substring(0, 2);
+ }
+ }
+ }
+
+ } catch (CertificateException e) {
+ LOG.error("Procces getCountry from certificate.");
+ }
+ return result.trim();
+ }
+
+ /**
+ * Process all elements XMLObjects from the extensions.
+ *
+ * @param extensions the extensions from the authentication request.
+ *
+ * @return the STORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKAuthnRequest processExtensions(final Extensions extensions)
+ throws STORKSAMLEngineException {
+ LOG.debug("Procces the extensions.");
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ final QAAAttribute qaa = (QAAAttribute) extensions
+ .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
+ request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
+
+ List optionalElements = extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME).get(0);
+ request.setSpSector(sector.getSPSector());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPApplication application = (SPApplication) extensions
+ .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
+ request.setSpApplication(application.getSPApplication());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPCountry application = (SPCountry) extensions
+ .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
+ request.setSpCountry(application.getSPCountry());
+ }
+
+
+ List listCrossBorderShare = extensions
+ .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+
+ if (!listCrossBorderShare .isEmpty()) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
+ request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
+ .getEIDCrossBorderShare()));
+ }
+
+
+ List listCrosSectorShare = extensions
+ .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+
+ if (!listCrosSectorShare.isEmpty()) {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
+ request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
+ .getEIDCrossSectorShare()));
+ }
+
+ List listSectorShareExtension = extensions
+ .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
+ if (!listSectorShareExtension.isEmpty()) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
+ request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
+ }
+
+
+
+ List<XMLObject> authAttrs = extensions
+ .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ if (authAttrs != null && !authAttrs.isEmpty()) {
+
+ final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
+ .get(0);
+
+ VIDPAuthenticationAttributes vidpAuthnAttr = null;
+ if (authnAttr != null && !authAttrs.isEmpty()){
+ vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
+ }
+
+ CitizenCountryCode citizenCountryCodeElement = null;
+ SPInformation spInformation = null;
+ if (vidpAuthnAttr != null){
+ citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
+ spInformation = vidpAuthnAttr.getSPInformation();
+ }
+
+ String citizenCountryCode = null;
+ if(citizenCountryCodeElement!=null){
+ citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
+ }
+
+ if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
+ request.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ SPID spidElement = null;
+ if (spInformation != null){
+ spidElement = spInformation.getSPID();
+ }
+
+ String spid = null;
+ if(spidElement!=null){
+ spid = spidElement.getSPID();
+ }
+
+ if (spid != null && StringUtils.isNotBlank(spid)) {
+ request.setSPID(spid);
+ }
+ }
+
+ if (extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
+ LOG.error("Extensions not contains any requested attribute.");
+ throw new STORKSAMLEngineException(
+ "Extensions not contains any requested attribute.");
+ }
+
+ final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
+ .get(0);
+
+ final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+
+ String attributeName;
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+ personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
+ personalAttribute.setFriendlyName(attribute.getFriendlyName());
+ attributeName = attribute.getName();
+
+ // recover the last name from the string.
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ final ArrayList<String> valores = new ArrayList<String>();
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+ for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
+
+ // Process attributes simples. An AuthenticationRequest only
+ // must contains simple values.
+
+ final XMLObject xmlObject = values.get(nextSimpleValue);
+
+ if(xmlObject instanceof XSStringImpl){
+
+ final XSStringImpl xmlString = (XSStringImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getValue());
+
+ }else{
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ valores.add(str);
+
+ }else{
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getTextContent());
+ }
+
+
+
+ }
+ }
+ personalAttribute.setValue(valores);
+ personalAttrList.add(personalAttribute);
+ }
+
+ request.setPersonalAttributeList(personalAttrList);
+
+ return request;
+ }
+
+
+ /**
+ * Process all elements XMLObjects from the extensions.
+ *
+ * @param extensions the extensions from the authentication request.
+ *
+ * @return the STORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKAttrQueryRequest processAttrExtensions(final Extensions extensions)
+ throws STORKSAMLEngineException {
+ LOG.debug("Procces the atribute query extensions.");
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ final QAAAttribute qaa = (QAAAttribute) extensions
+ .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
+ request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
+
+ List optionalElements = extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME).get(0);
+ request.setSpSector(sector.getSPSector());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPApplication application = (SPApplication) extensions
+ .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
+ request.setSpApplication(application.getSPApplication());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPCountry application = (SPCountry) extensions
+ .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
+ request.setSpCountry(application.getSPCountry());
+ }
+
+
+ List listCrossBorderShare = extensions
+ .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+
+ if (!listCrossBorderShare .isEmpty()) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
+ request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
+ .getEIDCrossBorderShare()));
+ }
+
+
+ List listCrosSectorShare = extensions
+ .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+
+ if (!listCrosSectorShare.isEmpty()) {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
+ request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
+ .getEIDCrossSectorShare()));
+ }
+
+ List listSectorShareExtension = extensions
+ .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
+ if (!listSectorShareExtension.isEmpty()) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
+ request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
+ }
+
+
+
+ List<XMLObject> authAttrs = extensions
+ .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ if (authAttrs != null && !authAttrs.isEmpty()) {
+
+ final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
+ .get(0);
+
+ VIDPAuthenticationAttributes vidpAuthnAttr = null;
+ if (authnAttr != null && !authAttrs.isEmpty()){
+ vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
+ }
+
+ CitizenCountryCode citizenCountryCodeElement = null;
+ SPInformation spInformation = null;
+ if (vidpAuthnAttr != null){
+ citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
+ spInformation = vidpAuthnAttr.getSPInformation();
+ }
+
+ String citizenCountryCode = null;
+ if(citizenCountryCodeElement!=null){
+ citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
+ }
+
+ if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
+ request.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ SPID spidElement = null;
+ if (spInformation != null){
+ spidElement = spInformation.getSPID();
+ }
+
+ String spid = null;
+ if(spidElement!=null){
+ spid = spidElement.getSPID();
+ }
+
+ if (spid != null && StringUtils.isNotBlank(spid)) {
+ request.setSPID(spid);
+ }
+ }
+
+ if (extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
+ LOG.error("Extensions not contains any requested attribute.");
+ throw new STORKSAMLEngineException(
+ "Extensions not contains any requested attribute.");
+ }
+
+ final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
+ .get(0);
+
+ final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+
+ String attributeName;
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+ personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
+ personalAttribute.setFriendlyName(attribute.getFriendlyName());
+ attributeName = attribute.getName();
+
+ // recover the last name from the string.
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ final ArrayList<String> valores = new ArrayList<String>();
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+ for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
+
+ // Process attributes simples. An AuthenticationRequest only
+ // must contains simple values.
+
+ final XMLObject xmlObject = values.get(nextSimpleValue);
+
+ if(xmlObject instanceof XSStringImpl){
+
+ final XSStringImpl xmlString = (XSStringImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getValue());
+
+ }else{
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ valores.add(str);
+
+ }else{
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getTextContent());
+ }
+
+
+
+ }
+ }
+ personalAttribute.setValue(valores);
+ personalAttrList.add(personalAttribute);
+ }
+
+ request.setPersonalAttributeList(personalAttrList);
+
+ return request;
+ }
+
+ /**
+ * Sets the name spaces.
+ *
+ * @param tokenSaml the new name spaces
+ */
+ private void setNameSpaces(final XMLObject tokenSaml) {
+ LOG.debug("Set namespaces.");
+
+ final Namespace saml2 = new Namespace(SAMLConstants.SAML20_NS,
+ SAMLConstants.SAML20_PREFIX);
+ tokenSaml.addNamespace(saml2);
+
+ final Namespace digSig = new Namespace(
+ "http://www.w3.org/2000/09/xmldsig#", "ds");
+ tokenSaml.addNamespace(digSig);
+
+ final Namespace storkp = new Namespace(SAMLCore.STORK10P_NS.getValue(),
+ SAMLCore.STORK10P_PREFIX.getValue());
+ tokenSaml.addNamespace(storkp);
+
+ final Namespace stork = new Namespace(SAMLCore.STORK10_NS.getValue(),
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ tokenSaml.addNamespace(stork);
+ }
+
+ /**
+ * Validate parameters from authentication request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAuthnReq(final STORKAuthnRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from authentication request.");
+
+ // URL to which Authentication Response must be sent.
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }
+
+ // the name of the original service provider requesting the
+ // authentication.
+ if (StringUtils.isBlank(request.getProviderName())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Service Provider it's mandatory.");
+ }
+
+ // object that contain all attributes requesting.
+ if (request.getPersonalAttributeList() == null
+ || request.getPersonalAttributeList().isEmpty()) {
+ throw new STORKSAMLEngineException(
+ "attributeQueries is null or empty.");
+ }
+
+ // Quality authentication assurance level.
+ if ((request.getQaa() < QAAAttribute.MIN_VALUE)
+ || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
+ throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
+ + ", is invalid.");
+ }
+
+ }
+
+ /**
+ * Validate parameters from attribute query request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryReq(final STORKAttrQueryRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from attribute query request.");
+
+ // URL to which AP Response must be sent.
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }
+
+ // Destination of the request - not mandatory
+ /*if (StringUtils.isBlank(request.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }*/
+
+ // SP country is empty
+ if (StringUtils.isBlank(request.getSpCountry())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP country is mandatory.");
+ }
+
+ // object that contain all attributes requesting.
+ if (request.getPersonalAttributeList() == null
+ || request.getPersonalAttributeList().isEmpty()) {
+ throw new STORKSAMLEngineException(
+ "attributeQueries is null or empty.");
+ }
+
+ // Quality authentication assurance level.
+ if ((request.getQaa() < QAAAttribute.MIN_VALUE)
+ || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
+ throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
+ + ", is invalid.");
+ }
+ }
+
+ /**
+ * Validate parameters from logout request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutReq(final STORKLogoutRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from logout request.");
+
+ // URL to which AP Response must be sent.
+ /*if (StringUtils.isBlank(request.get())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }*/
+
+ // Destination of the request
+ if (StringUtils.isBlank(request.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }
+
+ // SP Provided Id
+ if (StringUtils.isBlank(request.getSpProvidedId())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP provided Id is mandatory.");
+ }
+ }
+
+ /**
+ * Validate parameters from logout response.
+ *
+ * @param response the response.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutRes(final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from logout request.");
+
+ // Issuer is mandatory
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ // Destination of the request
+ if (StringUtils.isBlank(response.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }
+
+ // SP Provided Id
+ if (StringUtils.isBlank(request.getSpProvidedId())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP provided Id is mandatory.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+
+ /**
+ * Validate parameters from response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamResponse(final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response.");
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (responseAuthReq.getPersonalAttributeList() == null
+ || responseAuthReq.getPersonalAttributeList().isEmpty()) {
+ LOG.error("PersonalAttributeList is null or empty.");
+ throw new STORKSAMLEngineException(
+ "PersonalAttributeList is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameters from response.
+ *
+ * @param request the request
+ * @param responseAttrQueryReq the response authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryResponse(final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse responseAttrQueryReq)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate attribute querey parameters response.");
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (responseAttrQueryReq.getPersonalAttributeList() == null
+ || responseAttrQueryReq.getPersonalAttributeList().isEmpty()) {
+ LOG.error("PersonalAttributeList is null or empty.");
+ throw new STORKSAMLEngineException(
+ "PersonalAttributeList is null or empty.");
+ }
+
+ /*if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }*/
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamResponseFail(final STORKAuthnRequest request,
+ final STORKAuthnResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryResponseFail(final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutResFail(final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate stork authentication request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sTORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnRequest validateSTORKAuthnRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKAuthnRequest");
+
+ final AuthnRequest samlRequest = (AuthnRequest) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKAuthnRequest.");
+ final STORKAuthnRequest authnRequest = processExtensions(samlRequest
+ .getExtensions());
+
+ authnRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ authnRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ authnRequest.setSamlId(samlRequest.getID());
+ authnRequest.setDestination(samlRequest.getDestination());
+ authnRequest.setAssertionConsumerServiceURL(samlRequest
+ .getAssertionConsumerServiceURL());
+
+ authnRequest.setProviderName(samlRequest.getProviderName());
+ authnRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ //Delete unknown elements from requested ones
+ final Iterator<PersonalAttribute> iterator = authnRequest.getPersonalAttributeList().iterator();
+ IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) authnRequest.getPersonalAttributeList();
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ // Verify if the attribute name exits.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
+ cleanPerAttrList.remove(attribute.getName());
+ }
+
+ }
+ authnRequest.setPersonalAttributeList(cleanPerAttrList);
+
+ return authnRequest;
+
+ }
+
+ /**
+ * Validate stork attribute query request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the STORK attribute query request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryRequest validateSTORKAttrQueryRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKAttrQueryRequest");
+
+ //final AttributeQuery samlRequest = (AttributeQuery) validateStorkSaml(tokenSaml);
+ final CustomRequestAbstractType samlRequest = (CustomRequestAbstractType) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKAttrQueryRequest.");
+ final STORKAttrQueryRequest attrRequest = processAttrExtensions(samlRequest
+ .getExtensions());
+
+ attrRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ attrRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ attrRequest.setSamlId(samlRequest.getID());
+ attrRequest.setDestination(samlRequest.getDestination());
+ attrRequest.setAssertionConsumerServiceURL(samlRequest
+ .getAssertionConsumerServiceURL());
+
+ /*authnRequest.setProviderName(samlRequest.getProviderName());*/
+ attrRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ //Delete unknown elements from requested ones
+ final Iterator<PersonalAttribute> iterator = attrRequest.getPersonalAttributeList().iterator();
+ IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) attrRequest.getPersonalAttributeList();
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ // Verify if the attribute name exits.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
+ cleanPerAttrList.remove(attribute.getName());
+ }
+
+ }
+ attrRequest.setPersonalAttributeList(cleanPerAttrList);
+
+ return attrRequest;
+
+ }
+
+ /**
+ * Validate stork logout request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the STORK logout request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutRequest validateSTORKLogoutRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKLogoutRequest");
+
+ final LogoutRequest samlRequest = (LogoutRequest)validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKLogoutRequest.");
+ final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
+
+ logoutRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ logoutRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ logoutRequest.setSamlId(samlRequest.getID());
+ logoutRequest.setDestination(samlRequest.getDestination());
+
+ logoutRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ logoutRequest.setSpProvidedId(samlRequest.getNameID().getValue());
+
+ return logoutRequest;
+
+ }
+
+ /**
+ * Validate stork authentication response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse validateSTORKAuthnResponse(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAuthnResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAuthResponse.");
+ final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
+
+ authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ authnResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ authnResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ authnResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ authnResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ authnResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ authnResponse.setAssertions(samlResponse.getAssertions());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ authnResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ authnResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ authnResponse.setFail(true);
+ }
+ LOG.debug("Return result.");
+ return authnResponse;
+
+ }
+
+ /**
+ * Validate stork authentication response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse validateSTORKAuthnResponseWithQuery(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAuthnResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAuthResponse.");
+ final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
+
+ authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ authnResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ authnResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ authnResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ authnResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ authnResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ authnResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ authnResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ authnResponse.setFail(true);
+ }
+
+ authnResponse.setAssertions(samlResponse.getAssertions());
+ if (samlResponse.getAssertions().size() > 1)
+ {
+ PersonalAttributeList total = new PersonalAttributeList();
+ List<IPersonalAttributeList> attrList = new ArrayList();
+ for (int i = 0; i < samlResponse.getAssertions().size(); i++)
+ {
+ Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
+ IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
+ if (temp != null)
+ {
+ attrList.add(temp);
+ for (PersonalAttribute attribute : temp) {
+ PersonalAttribute attr = (PersonalAttribute)attribute.clone();
+ attr.setName(attr.getName()+tempAssertion.getID());
+ total.add(attr);
+ }
+ }
+ }
+ authnResponse.setPersonalAttributeLists(attrList);
+ authnResponse.setTotalPersonalAttributeList(total);
+ }
+
+ LOG.debug("Return result.");
+ return authnResponse;
+
+ }
+
+ /**
+ * Validate stork attribute query response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse validateSTORKAttrQueryResponse(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAttrQueryResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAttrQueryResponse.");
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ attrQueryResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ attrQueryResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ attrQueryResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ attrQueryResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ attrQueryResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ attrQueryResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ attrQueryResponse.setAssertion(assertion);
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ attrQueryResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ attrQueryResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(attrQueryResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ attrQueryResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ attrQueryResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ attrQueryResponse.setFail(true);
+ }
+
+ attrQueryResponse.setAssertions(samlResponse.getAssertions());
+ if (samlResponse.getAssertions().size() > 1)
+ {
+ PersonalAttributeList total = new PersonalAttributeList();
+ List<IPersonalAttributeList> attrList = new ArrayList();
+ for (int i = 0; i < samlResponse.getAssertions().size(); i++)
+ {
+ Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
+ IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
+ if (temp != null)
+ {
+ attrList.add(temp);
+ for (PersonalAttribute attribute : temp) {
+ PersonalAttribute attr = (PersonalAttribute)attribute.clone();
+ attr.setName(attr.getName()+tempAssertion.getID());
+ total.add(attr);
+ }
+ }
+ }
+ attrQueryResponse.setPersonalAttributeLists(attrList);
+ attrQueryResponse.setTotalPersonalAttributeList(total);
+ }
+
+ LOG.debug("Return result.");
+ return attrQueryResponse;
+
+ }
+
+ /**
+ * Validate stork response.
+ *
+ * @param samlResponse the SAML response
+ * @param userIP the user IP
+ *
+ * @return the assertion
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Assertion validateStorkResponse(final Response samlResponse,
+ final String userIP) throws STORKSAMLEngineException {
+ // Exist only one Assertion
+
+ if (samlResponse.getAssertions() == null
+ || samlResponse.getAssertions().isEmpty()) {
+ LOG.info("Assertion is null or empty."); //in replace of throw new STORKSAMLEngineException("Assertion is null or empty.")
+ return null;
+ }
+
+ final Assertion assertion = (Assertion) samlResponse.getAssertions()
+ .get(0);
+
+ LOG.debug("Verified method Bearer");
+ for (final Iterator<SubjectConfirmation> iter = assertion.getSubject()
+ .getSubjectConfirmations().iterator(); iter.hasNext();) {
+ final SubjectConfirmation element = iter.next();
+ final boolean isBearer = SubjectConfirmation.METHOD_BEARER
+ .equals(element.getMethod());
+
+ final boolean ipValidate = super.getSamlCoreProperties()
+ .isIpValidation();
+
+ if (ipValidate) {
+ if (isBearer) {
+ if (StringUtils.isBlank(userIP)) {
+ LOG.error("browser_ip is null or empty.");
+ throw new STORKSAMLEngineException(
+ "browser_ip is null or empty.");
+ } else if (StringUtils.isBlank(element
+ .getSubjectConfirmationData().getAddress())) {
+ LOG.error("token_ip attribute is null or empty.");
+ throw new STORKSAMLEngineException(
+ "token_ip attribute is null or empty.");
+ }
+ }
+
+ final boolean ipEqual = element.getSubjectConfirmationData()
+ .getAddress().equals(userIP);
+
+ // Validation ipUser
+ if (!ipEqual && ipValidate) {
+ LOG.error("SubjectConfirmation BEARER: ");
+ throw new STORKSAMLEngineException(
+ "IPs doesn't match : token_ip ("
+ + element.getSubjectConfirmationData()
+ .getAddress() + ") browser_ip ("
+ + userIP + ")");
+ }
+ }
+
+ }
+ return assertion;
+ }
+
+ /**
+ * Validate stork SAML.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the signable SAML object
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private SignableSAMLObject validateStorkSaml(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+
+ LOG.info("Validate StorkSaml message.");
+
+ if (tokenSaml == null) {
+ LOG.error("Saml authentication request is null.");
+ throw new STORKSAMLEngineException(
+ "Saml authentication request is null.");
+ }
+
+ LOG.debug("Generate AuthnRequest from request.");
+ SignableSAMLObject samlObject;
+
+ try {
+ samlObject = (SignableSAMLObject) super.unmarshall(tokenSaml);
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException unmarshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ boolean validateSign = true;
+
+ if (StringUtils.isNotBlank(super.getSamlCoreProperties().getProperty(
+ "validateSignature"))) {
+ validateSign = Boolean.valueOf(super.getSamlCoreProperties()
+ .getProperty("validateSignature"));
+ }
+
+ if (validateSign) {
+ LOG.debug("Validate Signature.");
+ try {
+ super.validateSignature(samlObject);
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException validateSignature.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ LOG.debug("Validate Schema.");
+ final ValidatorSuite validatorSuite = Configuration
+ .getValidatorSuite("saml2-core-schema-validator");
+ try {
+ if (samlObject.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ CustomAttributeQueryValidator val =
+ new CustomAttributeQueryValidator();
+ val.validate((CustomAttributeQuery)samlObject);
+ }
+ else
+ validatorSuite.validate(samlObject);
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ return samlObject;
+ }
+
+ private boolean isComplex(XMLObject xmlObject)
+ {
+ boolean isComplex = false;
+
+ final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
+
+ for (int nextComplexValue = 0; nextComplexValue < complexValue
+ .getUnknownXMLObjects().size(); nextComplexValue++) {
+
+ final XSAnyImpl simple = (XSAnyImpl) complexValue
+ .getUnknownXMLObjects().get(
+ nextComplexValue);
+
+ if (simple.getElementQName().getLocalPart() != null)
+ {
+ isComplex = true;
+ break;
+ }
+ }
+
+ return isComplex;
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java
new file mode 100644
index 000000000..724a522d1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java
@@ -0,0 +1,69 @@
+package eu.stork.peps.auth.engine;
+
+import org.bouncycastle.asn1.DERObjectIdentifier;
+import org.bouncycastle.jce.X509Principal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility class used to decrease complexity of comparison of 2 X509principal
+ *
+ * @author vanegdi
+ * @version $Revision: 1.00 $, $Date: 2013-05-24 20:53:51 $
+ */
+public final class X509PrincipalUtil{
+
+ private static final DERObjectIdentifier[] DER_OBJECT_IDENTIFIERS_ARRAY= {
+ X509Principal.CN,
+ X509Principal.OU,
+ X509Principal.O,
+ X509Principal.L,
+ X509Principal.ST,
+ X509Principal.C,
+ X509Principal.E
+ };
+
+ private static final Logger LOG = LoggerFactory.getLogger(eu.stork.peps.auth.engine.X509PrincipalUtil.class);
+
+ /**
+ * Compares 2 X509Principals to detect if they equals
+ * @param principal1
+ * @param principal2
+ * @return true if arguments are not null and equals
+ */
+ public static boolean equals(X509Principal principal1, X509Principal principal2) {
+ boolean continueProcess = true;
+ if (principal1 == null || principal2 == null){
+ return false;
+ }
+
+ int cpt = 0;
+ while(continueProcess && cpt < DER_OBJECT_IDENTIFIERS_ARRAY.length){
+ continueProcess = continueProcess && x509ValuesByIdentifierEquals(principal1, principal2, DER_OBJECT_IDENTIFIERS_ARRAY[cpt]);
+ cpt++;
+ }
+ return continueProcess;
+ }
+
+ public static boolean equals2(X509Principal principal1, X509Principal principal2) {
+
+ if (principal1 == null || principal2 == null){
+ return false;
+ }
+
+ if (principal1.getName().equals(principal2.getName()))
+ return true;
+ else
+ return false;
+
+ }
+
+ private static boolean x509ValuesByIdentifierEquals(X509Principal principal1, X509Principal principal2, DERObjectIdentifier identifier){
+ return principal1.getValues(identifier).equals(principal2.getValues(identifier));
+ }
+
+ private X509PrincipalUtil(){
+ // default contructor
+ LOG.error("Fake X509PrincipalUtil : never be called");
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java
new file mode 100644
index 000000000..a9efe6362
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java
@@ -0,0 +1,57 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface AuthenticationAttributes.
+ * @author fjquevedo
+ */
+public interface AuthenticationAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "AuthenticationAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "AuthenticationAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ VIDPAuthenticationAttributes getVIDPAuthenticationAttributes();
+
+
+ /**
+ * Sets the vIDP authentication attributes.
+ *
+ * @param newVIDPAuthenticationAttr the new vIDP authentication attributes
+ */
+ void setVIDPAuthenticationAttributes(VIDPAuthenticationAttributes newVIDPAuthenticationAttr);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java
new file mode 100644
index 000000000..4af7524ea
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author fjquevedo
+ */
+public interface CitizenCountryCode extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "CitizenCountryCode";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "CitizenCountryCodeType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP country.
+ *
+ * @return the sP country
+ */
+ String getCitizenCountryCode();
+
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param citizenCountryCode the new citizen country code
+ */
+ void setCitizenCountryCode(String citizenCountryCode);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java
new file mode 100644
index 000000000..94dfdb0e8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java
@@ -0,0 +1,51 @@
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.Subject;
+import org.opensaml.saml2.core.SubjectQuery;
+
+public interface CustomAttributeQuery extends CustomRequestAbstractType {
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AttributeQuery";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "CustomAttributeQueryType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** AssertionConsumerServiceURL attribute name. */
+ public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME
+ = "AssertionConsumerServiceURL";
+
+ /**
+ * Gets the Attributes of this query.
+ *
+ * @return the list of Attributes of this query
+ */
+ public List<Attribute> getAttributes();
+
+ /**
+ * Gets the Subject of this request.
+ *
+ * @return the Subject of this request
+ */
+ public Subject getSubject();
+
+ /**
+ * Sets the Subject of this request.
+ *
+ * @param newSubject the Subject of this request
+ */
+ public void setSubject(Subject newSubject);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java
new file mode 100644
index 000000000..77dd8c4a5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java
@@ -0,0 +1,176 @@
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.joda.time.DateTime;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.core.Issuer;
+
+public interface CustomRequestAbstractType extends SignableSAMLObject {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "RequestAbstractType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** ID attribute name. */
+ public static final String ID_ATTRIB_NAME = "ID";
+
+ /** Version attribute name. */
+ public static final String VERSION_ATTRIB_NAME = "Version";
+
+ /** IssueInstant attribute name. */
+ public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+
+ /** Destination attribute name. */
+ public static final String DESTINATION_ATTRIB_NAME = "Destination";
+
+ /** Destination attribute name. */
+ public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME = "AssertionConsumerServiceURL";
+
+ /** Consent attribute name. */
+ public static final String CONSENT_ATTRIB_NAME = "Consent";
+
+ /** Unspecified consent URI. */
+ public static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
+
+ /** Obtained consent URI. */
+ public static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
+
+ /** Prior consent URI. */
+ public static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
+
+ /** Implicit consent URI. */
+ public static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+
+ /** Explicit consent URI. */
+ public static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+
+ /** Unavailable consent URI. */
+ public static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
+
+ /** Inapplicable consent URI. */
+ public static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
+
+ /**
+ * Gets the SAML Version of this request.
+ *
+ * @return the SAML Version of this request.
+ */
+ public SAMLVersion getVersion();
+
+ /**
+ * Sets the SAML Version of this request.
+ *
+ * @param newVersion the SAML Version of this request
+ */
+ public void setVersion(SAMLVersion newVersion);
+
+ /**
+ * Gets the unique identifier of the request.
+ *
+ * @return the unique identifier of the request
+ */
+ public String getID();
+
+ /**
+ * Sets the unique identifier of the request.
+ *
+ * @param newID the unique identifier of the request
+ */
+
+ public void setID(String newID);
+
+ /**
+ * Gets the date/time the request was issued.
+ *
+ * @return the date/time the request was issued
+ */
+
+ public DateTime getIssueInstant();
+
+ /**
+ * Sets the date/time the request was issued.
+ *
+ * @param newIssueInstant the date/time the request was issued
+ */
+ public void setIssueInstant(DateTime newIssueInstant);
+
+ /**
+ * Gets the URI of the destination of the request.
+ *
+ * @return the URI of the destination of the request
+ */
+ public String getDestination();
+
+ /**
+ * Sets the URI of the destination of the request.
+ *
+ * @param newDestination the URI of the destination of the request
+ */
+ public void setDestination(String newDestination);
+
+ /**
+ * Sets the index of the particular Assertion Consumer Service to which the response to this request should be
+ * delivered.
+ *
+ * @param newAssertionConsumerServiceIndex the new value of the AssertionConsumerServiceIndex attribute
+ */
+ public void setAssertionConsumerServiceURL(String newServiceUrl);
+
+ /**
+ * Gets the URL of the particular Assertion Consumer Service to which the response to this request should be
+ * delivered.
+ *
+ * @return the value of the AssertionConsumerServiceURL attribute
+ */
+ public String getAssertionConsumerServiceURL();
+
+ /**
+ * Gets the consent obtained from the principal for sending this request.
+ *
+ * @return the consent obtained from the principal for sending this request
+ */
+ public String getConsent();
+
+ /**
+ * Sets the consent obtained from the principal for sending this request.
+ *
+ * @param newConsent the new consent obtained from the principal for sending this request
+ */
+ public void setConsent(String newConsent);
+
+ /**
+ * Gets the issuer of this request.
+ *
+ * @return the issuer of this request
+ */
+ public Issuer getIssuer();
+
+ /**
+ * Sets the issuer of this request.
+ *
+ * @param newIssuer the issuer of this request
+ */
+ public void setIssuer(Issuer newIssuer);
+
+ /**
+ * Gets the Extensions of this request.
+ *
+ * @return the Status of this request
+ */
+ public Extensions getExtensions();
+
+ /**
+ * Sets the Extensions of this request.
+ *
+ * @param newExtensions the Extensions of this request
+ */
+ public void setExtensions(Extensions newExtensions);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java
new file mode 100644
index 000000000..03541ece1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java
@@ -0,0 +1,58 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author fjquevedo
+ */
+public interface EIDCrossBorderShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "eIDCrossBorderShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDCrossBorderShareType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the eID cross border share.
+ *
+ * @return the eID cross border share
+ */
+ String getEIDCrossBorderShare();
+
+
+ /**
+ * Sets the eID cross border share.
+ *
+ * @param eIDCrossBorderShare the new eID cross border share
+ */
+ void setEIDCrossBorderShare(String eIDCrossBorderShare);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java
new file mode 100644
index 000000000..14c504510
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossSectorShare.
+ * @author fjquevedo
+ */
+public interface EIDCrossSectorShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String ELEM_LOCAL_NAME = "eIDCrossSectorShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), ELEM_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDCrossSectorShareType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the eID cross sector share.
+ *
+ * @return the eID cross sector share
+ */
+ String getEIDCrossSectorShare();
+
+ /**
+ * Sets the eID cross sector share.
+ *
+ * @param eIDCrossSectorShare the new eID cross sector share
+ */
+ void setEIDCrossSectorShare(String eIDCrossSectorShare);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java
new file mode 100644
index 000000000..0202f000c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java
@@ -0,0 +1,57 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDSectorShare.
+ * @author fjquevedo
+ */
+public interface EIDSectorShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "eIDSectorShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDSectorShare";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the eID sector share.
+ *
+ * @return the eID sector share
+ */
+ String getEIDSectorShare();
+
+ /**
+ * Sets the eID sector share.
+ *
+ * @param eIDSectorShare the new eID sector share
+ */
+ void setEIDSectorShare(String eIDSectorShare);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java
new file mode 100644
index 000000000..d99d23896
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java
@@ -0,0 +1,63 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * STORK Quality Authentication Assurance Level Attribute Interface.
+ *
+ * @author fjquevedo
+ */
+public interface QAAAttribute extends SAMLObject {
+
+ /** Element local name. */
+ String DEF_LOCAL_NAME = "QualityAuthenticationAssuranceLevel";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "QualityAuthenticationAssuranceLevelAbstractType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The minimum value allowed. */
+ int MIN_VALUE = 1;
+
+ /** The Max value allowed. */
+ int MAX_VALUE = 4;
+
+ /**
+ * Gets the qAA level.
+ *
+ * @return the qAA level
+ */
+ String getQaaLevel();
+
+ /**
+ * Sets the qAA level.
+ *
+ * @param qaaLevel the new qAA level
+ *
+ */
+ void setQaaLevel(String qaaLevel);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java
new file mode 100644
index 000000000..ffd32b3cf
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java
@@ -0,0 +1,140 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * The Interface RequestedAttribute.
+ *
+ * @author fjquevedo
+ */
+public interface RequestedAttribute extends SAMLObject,
+ AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ String DEF_LOCAL_NAME = "RequestedAttribute";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "RequestedAttributeAbstractType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** NAME_ATTRIB_NAME attribute name. */
+ String NAME_ATTRIB_NAME = "Name";
+
+ /** NAME_FORMAT_ATTRIB_NAME attribute name. */
+ String NAME_FORMAT_ATTR = "NameFormat";
+
+ /** IS_REQUIRED_ATTRIB_NAME attribute name. */
+ String IS_REQUIRED_ATTR = "isRequired";
+
+ /** FRIENDLY_NAME_ATTRIB_NAME attribute name. */
+ String FRIENDLY_NAME_ATT = "FriendlyName";
+
+ /** Unspecified attribute format ID. */
+ String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
+
+ /** URI reference attribute format ID. */
+ String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
+
+ /** Basic attribute format ID. */
+ String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ String getName();
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ void setName(String name);
+
+ /**
+ * Gets the name format.
+ *
+ * @return the name format
+ */
+ String getNameFormat();
+
+ /**
+ * Sets the name format.
+ *
+ * @param nameFormat the new name format
+ */
+ void setNameFormat(String nameFormat);
+
+ /**
+ * Gets the friendly name.
+ *
+ * @return the friendly name
+ */
+ String getFriendlyName();
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param friendlyName the new friendly name
+ */
+ void setFriendlyName(String friendlyName);
+
+ /**
+ * Gets the checks if is required.
+ *
+ * @return the checks if is required
+ */
+ String isRequired();
+
+ /**
+ * Gets the checks if is required xs boolean.
+ *
+ * @return the checks if is required xs boolean
+ */
+ String getIsRequiredXSBoolean();
+
+ /**
+ * Sets the checks if is required.
+ *
+ * @param newIsRequired the new checks if is required
+ */
+ void setIsRequired(String newIsRequired);
+
+ /**
+ * Gets the attribute values.
+ *
+ * @return the attribute values
+ */
+ List<XMLObject> getAttributeValues();
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java
new file mode 100644
index 000000000..6e3da28c3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java
@@ -0,0 +1,51 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface RequestedAttributes.
+ *
+ * @author fjquevedo
+ */
+public interface RequestedAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "RequestedAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "RequestedAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the attributes.
+ *
+ * @return the attributes
+ */
+ List<RequestedAttribute> getAttributes();
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java
new file mode 100644
index 000000000..cbedcf7d9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java
@@ -0,0 +1,98 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+/**
+ * The Enumeration SAMLCore.
+ *
+ * @author fjquevedo
+ */
+
+public enum SAMLCore {
+
+ /** The consent authentication request. */
+ CONSENT_AUTHN_REQ("consentAuthnRequest"),
+
+ /** The consent authentication response. */
+ CONSENT_AUTHN_RES("consentAuthnResponse"),
+
+ /** The FORC e_ auth n_ tag. */
+ FORCE_AUTHN_TAG("forceAuthN"),
+
+ /** The I s_ passiv e_ tag. */
+ IS_PASSIVE_TAG("isPassive"),
+
+ /** The FORMA t_ entity. */
+ FORMAT_ENTITY("formatEntity"),
+
+ /** The FRIENDLY name. */
+ FRIENDLY_NAME("friendlyName"),
+
+ /** The IS_REQUIRED AN ATTRIBUTE */
+ IS_REQUIRED("isRequired"),
+
+ /** The PRO t_ bindin g_ tag. */
+ PROT_BINDING_TAG("protocolBinding"),
+
+ /** The ASSER t_ con s_ tag. */
+ ASSERT_CONS_TAG("assertionConsumerServiceURL"),
+
+ /** The REQUESTE r_ tag. */
+ REQUESTER_TAG("requester"),
+
+ /** The RESPONDE r_ tag. */
+ RESPONDER_TAG("responder"),
+
+ /** The STOR k10_ ns. */
+ STORK10_NS("urn:eu:stork:names:tc:STORK:1.0:assertion"),
+
+ /** The STOR k10 p_ ns. */
+ STORK10P_NS("urn:eu:stork:names:tc:STORK:1.0:protocol"),
+
+ /** The STOR k10_ prefix. */
+ STORK10_PREFIX("stork"),
+
+ /** The STOR k10 p_ prefix. */
+ STORK10P_PREFIX("storkp"),
+
+ /** The STOR k10_ bas e_ uri. */
+ STORK10_BASE_URI("http://www.stork.gov.eu/1.0/"),
+
+ /** The ON e_ tim e_ use. */
+ ONE_TIME_USE("oneTimeUse");
+
+ /** The value. */
+ private String value;
+
+ /**
+ * Instantiates a new sAML core.
+ *
+ * @param fullName the full name
+ */
+ private SAMLCore(final String fullName) {
+ this.value = fullName;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java
new file mode 100644
index 000000000..e846983d8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java
@@ -0,0 +1,88 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Interface SAMLEngineSignI.
+ *
+ * @author fjquevedo
+ */
+public interface SAMLEngineSignI {
+
+ /**
+ * Sign.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ SAMLObject sign(SignableSAMLObject tokenSaml) throws SAMLEngineException;
+
+ /**
+ * Gets the certificate.
+ *
+ * @return the certificate
+ */
+ X509Certificate getCertificate();
+
+ /**
+ * Gets the trustStore used when validating SAMLTokens
+ *
+ * @return the trustStore
+ *
+ */
+ KeyStore getTrustStore();
+
+ /**
+ * Validate signature.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ SAMLObject validateSignature(SignableSAMLObject tokenSaml)
+ throws SAMLEngineException;
+
+ /**
+ * Initialize the signature module.
+ *
+ * @param fileConf the configuration file.
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ void init(String fileConf) throws SAMLEngineException;
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ void loadCryptServiceProvider() throws SAMLEngineException;
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java
new file mode 100644
index 000000000..9510bf790
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPApplication.
+ *
+ * @author fjquevedo
+ */
+public interface SPApplication extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spApplication";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spApplicationType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return the service provider application
+ */
+ String getSPApplication();
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param spApplication the new service provider application
+ */
+ void setSPApplication(String spApplication);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java
new file mode 100644
index 000000000..829ace878
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPCountry.
+ *
+ * @author fjquevedo
+ */
+public interface SPCountry extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spCountry";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spCountryType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider country.
+ *
+ * @return the service provider country
+ */
+ String getSPCountry();
+
+ /**
+ * Sets the service provider country.
+ *
+ * @param spCountry the new service provider country
+ */
+ void setSPCountry(String spCountry);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java
new file mode 100644
index 000000000..bd13f6dbf
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author iinigo
+ */
+public interface SPID extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "SPID";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "SPIDType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return the SP ID
+ */
+ String getSPID();
+
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param SPID the new SP ID
+ */
+ void setSPID(String newSPID);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java
new file mode 100644
index 000000000..bc870c2cc
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author iinigo
+ */
+public interface SPInformation extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "SPInformation";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "SPInformationType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP Id.
+ *
+ * @return the SP Id
+ */
+ SPID getSPID();
+
+
+ /**
+ * Sets the SP Id.
+ *
+ * @param newSPId the new SP Id
+ */
+ void setSPID(SPID newSPID);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java
new file mode 100644
index 000000000..add45023c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ *
+ * @author fjquevedo
+ */
+public interface SPInstitution extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spInstitution";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spInstitutionType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return the service provider institution
+ */
+ String getSPInstitution();
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param spInstitution the new service provider institution
+ */
+ void setSPInstitution(String spInstitution);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java
new file mode 100644
index 000000000..8322a0d47
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPSector.
+ *
+ * @author fjquevedo
+ */
+public interface SPSector extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spSector";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spSectorType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return the service provider sector
+ */
+ String getSPSector();
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param spSector the new service provider sector
+ */
+ void setSPSector(String spSector);
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java
new file mode 100644
index 000000000..4c314ae68
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java
@@ -0,0 +1,508 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.NameIDType;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class SAMLCore.
+ *
+ * @author fjquevedo
+ */
+public final class STORKSAMLCore {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(STORKSAMLCore.class.getName());
+
+ /** The consent authentication request. */
+ private String consentAuthnReq = null;
+
+ /** The consent authentication response. */
+ private String consentAuthnResp = null;
+
+ /** The id cross border share. */
+ private String eIDCrossBordShare = null;
+
+ /** The e id cross sect share. */
+ private String eIDCrossSectShare = null;
+
+ /** The e id sector share. */
+ private String eIDSectorShare = null;
+
+ /** The format entity. */
+ private String formatEntity = null;
+
+ /** The friendly name. */
+ private boolean friendlyName = false;
+
+ /** The IP validation. */
+ private boolean ipValidation = false;
+
+ /** The one time use. */
+ private boolean oneTimeUse = true;
+
+ /** The protocol binding. */
+ private String protocolBinding = null;
+
+ /** The requester. */
+ private String requester = null;
+
+
+ /** The responder. */
+ private String responder = null;
+
+ /** The SAML core properties. */
+ private Properties samlCoreProp = null;
+
+ /** The time not on or after. */
+ private Integer timeNotOnOrAfter = null;
+
+ /** The is required parameter. */
+ private boolean isRequired = true;
+
+ private static final String SAML_ENGINE_LITERAL = "SamlEngine.xml: ";
+
+ /**
+ * Gets the isRequired.
+ *
+ * @return the isRequired
+ */
+ public boolean isRequired() {
+ return isRequired;
+ }
+
+ /**
+ * Sets the isRequired.
+ *
+ * @param isRequired the required.
+ */
+ public void setRequired(boolean isRequired) {
+ this.isRequired = isRequired;
+ }
+
+ /**
+ * Instantiates a new sAML core.
+ *
+ * @param instance the instance
+ */
+ public STORKSAMLCore(final Properties instance) {
+ loadConfiguration(instance);
+ }
+
+ /**
+ * Gets the consent.
+ *
+ * @return the consent
+ */
+ public String getConsentAuthnRequest() {
+ return consentAuthnReq;
+ }
+
+ /**
+ * Gets the consent authentication response.
+ *
+ * @return the consent authentication response.
+ */
+ public String getConsentAuthnResp() {
+ return consentAuthnResp;
+ }
+
+ /**
+ * Gets the consent authentication response.
+ *
+ * @return the consent authentication response
+ */
+ public String getConsentAuthnResponse() {
+ return consentAuthnResp;
+ }
+
+ /**
+ * Gets the format entity.
+ *
+ * @return the format entity
+ */
+ public String getFormatEntity() {
+ return formatEntity;
+ }
+
+ /**
+ * Gets the property.
+ *
+ * @param key the key
+ *
+ * @return the property
+ */
+ public String getProperty(final String key) {
+ return samlCoreProp.getProperty(key);
+ }
+
+ /**
+ * Gets the protocol binding.
+ *
+ * @return the protocol binding
+ */
+ public String getProtocolBinding() {
+ return protocolBinding;
+ }
+
+ /**
+ * Gets the requester.
+ *
+ * @return the requester
+ */
+ public String getRequester() {
+ return requester;
+ }
+
+ /**
+ * Gets the responder.
+ *
+ * @return the responder
+ */
+ public String getResponder() {
+ return responder;
+ }
+
+ /**
+ * Gets the time not on or after.
+ *
+ * @return the time not on or after
+ */
+ public Integer getTimeNotOnOrAfter() {
+ return timeNotOnOrAfter;
+ }
+
+ /**
+ * Checks if is e id cross border share.
+ *
+ * @return true, if is e id cross border share
+ */
+ public String iseIDCrossBorderShare() {
+ return eIDCrossBordShare;
+ }
+
+ /**
+ * Checks if is e id cross border share.
+ *
+ * @return true, if is e id cross border share
+ */
+ public String iseIDCrossBordShare() {
+ return eIDCrossBordShare;
+ }
+
+ /**
+ * Checks if is e id cross sector share.
+ *
+ * @return true, if is e id cross sector share
+ */
+ public String iseIDCrossSectorShare() {
+ return eIDCrossSectShare;
+ }
+
+ /**
+ * Checks if is e id cross sect share.
+ *
+ * @return true, if is e id cross sect share
+ */
+ public String iseIDCrossSectShare() {
+ return eIDCrossSectShare;
+ }
+
+ /**
+ * Checks if is e id sector share.
+ *
+ * @return true, if is e id sector share
+ */
+ public String iseIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Checks if is friendly name.
+ *
+ * @return true, if checks if is friendly name
+ */
+ public boolean isFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Checks if is IP validation.
+ *
+ * @return true, if is IP validation
+ */
+ public boolean isIpValidation() {
+ return ipValidation;
+ }
+
+ /**
+ * Checks if is one time use.
+ *
+ * @return true, if is one time use
+ */
+ public boolean isOneTimeUse() {
+ return oneTimeUse;
+ }
+
+ /**
+ * Method that loads the configuration file for the SAML Engine.
+ *
+ * @param instance the instance of the Engine properties.
+ */
+ private void loadConfiguration(final Properties instance) {
+
+ try {
+ LOGGER.info("SAMLCore: Loading SAMLEngine properties.");
+
+ samlCoreProp = instance;
+
+ final String parameter = samlCoreProp
+ .getProperty(SAMLCore.FORMAT_ENTITY.getValue());
+
+ if ("entity".equalsIgnoreCase(parameter)) {
+ formatEntity = NameIDType.ENTITY;
+ }
+
+ friendlyName = Boolean.valueOf(samlCoreProp
+ .getProperty(SAMLCore.FRIENDLY_NAME.getValue()));
+
+ String isRequiredValue = samlCoreProp.
+ getProperty(SAMLCore.IS_REQUIRED.getValue());
+ if (isRequiredValue != null) {
+ isRequired = Boolean.valueOf(isRequiredValue);
+ }
+
+ eIDSectorShare = samlCoreProp
+ .getProperty("eIDSectorShare");
+ eIDCrossSectShare = samlCoreProp
+ .getProperty("eIDCrossSectorShare");
+ eIDCrossBordShare = samlCoreProp
+ .getProperty("eIDCrossBorderShare");
+
+ ipValidation = Boolean.valueOf(samlCoreProp
+ .getProperty("ipAddrValidation"));
+
+ final String oneTimeUseProp = samlCoreProp
+ .getProperty(SAMLCore.ONE_TIME_USE.getValue());
+
+ if (StringUtils.isNotBlank(oneTimeUseProp)) {
+ oneTimeUse = Boolean.valueOf(oneTimeUseProp);
+ }
+
+ // Protocol Binding
+ loadProtocolBiding();
+
+ // Consent Authentication Request
+ consentAuthnReq = samlCoreProp
+ .getProperty(SAMLCore.CONSENT_AUTHN_REQ.getValue());
+
+ if ("unspecified".equalsIgnoreCase(consentAuthnReq)) {
+ consentAuthnReq = RequestAbstractType.UNSPECIFIED_CONSENT;
+ }
+
+ loadConsentAuthResp();
+
+ timeNotOnOrAfter = Integer.valueOf(samlCoreProp
+ .getProperty("timeNotOnOrAfter"));
+
+ if (timeNotOnOrAfter.intValue() < 0) {
+ LOGGER.error(SAML_ENGINE_LITERAL + "timeNotOnOrAfter"
+ + " is negative number.");
+
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + "timeNotOnOrAfter" + " is negative number.");
+ }
+
+ requester = samlCoreProp.getProperty(SAMLCore.REQUESTER_TAG.getValue());
+ responder = samlCoreProp.getProperty(SAMLCore.RESPONDER_TAG.getValue());
+
+ } catch (SAMLEngineException e) {
+ LOGGER.error("SAMLCore: error loadConfiguration. ", e);
+ throw new STORKSAMLEngineRuntimeException(e);
+ } catch (RuntimeException e) {
+ LOGGER.error("SAMLCore: error loadConfiguration. ", e);
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Load consent authentication response.
+ */
+ private void loadConsentAuthResp() {
+ // Consent Authentication Response
+ consentAuthnResp = samlCoreProp
+ .getProperty(SAMLCore.CONSENT_AUTHN_RES.getValue());
+
+ if ("obtained".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.OBTAINED_CONSENT;
+ } else if ("prior".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.PRIOR_CONSENT;
+ } else if ("curent-implicit".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp =
+ "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+ } else if ("curent-explicit".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp =
+ "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+ } else if ("unspecified".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.UNSPECIFIED_CONSENT;
+ }
+ }
+
+ /**
+ * Load protocol biding.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private void loadProtocolBiding() throws SAMLEngineException {
+ // Protocol Binding
+ protocolBinding = samlCoreProp.getProperty(SAMLCore.PROT_BINDING_TAG.getValue());
+
+ if (StringUtils.isBlank(protocolBinding)) {
+ LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
+ + " it's mandatory.");
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + SAMLCore.PROT_BINDING_TAG + " it's mandatory.");
+ } else if (protocolBinding.equalsIgnoreCase("HTTP-POST")) {
+ protocolBinding = SAMLConstants.SAML2_POST_BINDING_URI;
+ } else {
+ LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
+ + " it's not supporting.");
+
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + SAMLCore.PROT_BINDING_TAG + " it's not supporting.");
+ }
+ }
+
+ /**
+ * Sets the consent authentication response.
+ *
+ * @param newConsAuthnResp the new consent authentication response
+ */
+ public void setConsentAuthnResp(final String newConsAuthnResp) {
+ this.consentAuthnResp = newConsAuthnResp;
+ }
+
+ /**
+ * Sets an eID that can be shared outside of the Service Provider’s member state.
+ *
+ * @param newEIDCrossBord the new eid cross border share
+ */
+ public void setEIDCrossBordShare(final String newEIDCrossBord) {
+ this.eIDCrossBordShare = newEIDCrossBord;
+ }
+
+ /**
+ * Sets an eID that can be shared outside of the Service Provider’s sector.
+ *
+ * @param newEIDCrossSect the new eid cross sect share
+ */
+ public void setEIDCrossSectShare(final String newEIDCrossSect) {
+ this.eIDCrossSectShare = newEIDCrossSect;
+ }
+
+ /**
+ * Sets an eID that can be shared within the Service Provider’s sector.
+ *
+ * @param newEIDSectorShare the new eid sector share
+ */
+ public void seteIDSectorShare(final String newEIDSectorShare) {
+ this.eIDSectorShare = newEIDSectorShare;
+ }
+
+ /**
+ * Sets the format entity.
+ *
+ * @param newFormatEntity the new format entity
+ */
+ public void setFormatEntity(final String newFormatEntity) {
+ this.formatEntity = newFormatEntity;
+ }
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param newFriendlyName the new friendly name
+ */
+ public void setFriendlyName(final boolean newFriendlyName) {
+ this.friendlyName = newFriendlyName;
+ }
+
+ /**
+ * Sets the IP validation.
+ *
+ * @param newIpValidation the new IP validation
+ */
+ public void setIpValidation(final boolean newIpValidation) {
+ this.ipValidation = newIpValidation;
+ }
+
+ /**
+ * Sets the one time use.
+ *
+ * @param newOneTimeUse the new one time use
+ */
+ public void setOneTimeUse(final boolean newOneTimeUse) {
+ this.oneTimeUse = newOneTimeUse;
+ }
+
+ /**
+ * Sets the protocol binding.
+ *
+ * @param newProtBinding the new protocol binding
+ */
+ public void setProtocolBinding(final String newProtBinding) {
+ this.protocolBinding = newProtBinding;
+ }
+
+ /**
+ * Sets the requester.
+ *
+ * @param newRequester the new requester
+ */
+ public void setRequester(final String newRequester) {
+ this.requester = newRequester;
+ }
+
+ /**
+ * Sets the responder.
+ *
+ * @param newResponder the new responder
+ */
+ public void setResponder(final String newResponder) {
+ this.responder = newResponder;
+ }
+
+ /**
+ * Sets the time not on or after.
+ *
+ * @param newTimeNotOnOrAft the new time not on or after
+ */
+ public void setTimeNotOnOrAfter(final Integer newTimeNotOnOrAft) {
+ this.timeNotOnOrAfter = newTimeNotOnOrAft;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java
new file mode 100644
index 000000000..6ee9e0e1b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java
@@ -0,0 +1,72 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface VIDPAuthenticationAttributes.
+ *
+ * @author fjquevedo
+ */
+public interface VIDPAuthenticationAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "VIDPAuthenticationAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "VIDPAuthenticationAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ CitizenCountryCode getCitizenCountryCode();
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ */
+ void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode);
+
+ /**
+ * Gets the SP information
+ *
+ * @return the SP information
+ */
+ SPInformation getSPInformation();
+
+ /**
+ * Sets the SP information
+ *
+ * @param newSPInformation the new SPInformation
+ */
+ void setSPInformation(SPInformation newSPInformation);
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java
new file mode 100644
index 000000000..2d9039d4c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+
+/**
+ * The Class AuthenticationAttributesBuilder.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesBuilder extends
+ AbstractSAMLObjectBuilder<AuthenticationAttributes> {
+
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the authentication attributes
+ */
+ public final AuthenticationAttributes buildObject() {
+ return buildObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace URI
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ *
+ * @return the authentication attributes
+ */
+ public final AuthenticationAttributes buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new AuthenticationAttributesImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java
new file mode 100644
index 000000000..e0de20f7d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java
@@ -0,0 +1,109 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class AuthenticationAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public final class AuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
+AuthenticationAttributes {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationAttributesImpl.class.getName());
+
+ /** The indexed children. */
+ private VIDPAuthenticationAttributes vIDPAuthenAttr;
+
+ /**
+ * Instantiates a new authentication attributes implementation.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected AuthenticationAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(vIDPAuthenAttr);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Gets the vidp authentication attributes.
+ *
+ * @return the VIDP authentication attributes
+ *
+ */
+ public VIDPAuthenticationAttributes getVIDPAuthenticationAttributes() {
+ return vIDPAuthenAttr;
+ }
+
+ /**
+ * Sets the vidp authentication attributes.
+ *
+ * @param newVIDPAuthenAttr the new vidp authen attr
+ *
+ */
+ public void setVIDPAuthenticationAttributes(
+ final VIDPAuthenticationAttributes newVIDPAuthenAttr) {
+ vIDPAuthenAttr = prepareForAssignment(this.vIDPAuthenAttr, newVIDPAuthenAttr);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java
new file mode 100644
index 000000000..072da4edd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java
@@ -0,0 +1,30 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class AuthenticationAttributesMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+
+
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java
new file mode 100644
index 000000000..f8a58a273
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java
@@ -0,0 +1,54 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+
+/**
+ * The Class AuthenticationAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final AuthenticationAttributes attrStatement = (AuthenticationAttributes) parentObject;
+
+ if (childObject instanceof VIDPAuthenticationAttributes) {
+ attrStatement.setVIDPAuthenticationAttributes((VIDPAuthenticationAttributes) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.java
new file mode 100644
index 000000000..64651691f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+
+/**
+ * The Class CitizenCountryCodeBuilder.
+ *
+ * @author fjquevedo
+ */
+public class CitizenCountryCodeBuilder extends AbstractSAMLObjectBuilder<CitizenCountryCode> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the citizen country code
+ */
+ public final CitizenCountryCode buildObject() {
+ return buildObject(CitizenCountryCode.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the citizen country code
+ */
+ public final CitizenCountryCode buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new CitizenCountryCodeImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java
new file mode 100644
index 000000000..374398cf1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class CitizenCountryCodeImpl.
+ *
+ * @author fjquevedo
+ */
+public class CitizenCountryCodeImpl extends AbstractSAMLObject implements CitizenCountryCode {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CitizenCountryCodeImpl.class.getName());
+ /** The citizen country code. */
+ private String citizenCountryCode;
+
+ /**
+ * Instantiates a new sP country impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected CitizenCountryCodeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ public final String getCitizenCountryCode() {
+ return citizenCountryCode;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ */
+ public final void setCitizenCountryCode(final String newCitizenCountryCode) {
+ this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.java
new file mode 100644
index 000000000..decae04c5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+
+/**
+ * The Class SPCountryMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class CitizenCountryCodeMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final CitizenCountryCode citizenCountryCode = (CitizenCountryCode) samlObject;
+ XMLHelper.appendTextContent(domElement, citizenCountryCode.getCitizenCountryCode());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.java
new file mode 100644
index 000000000..93132b508
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+
+/**
+ * The Class CitizenCountryCodeUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class CitizenCountryCodeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final CitizenCountryCode citizenCountryCode = (CitizenCountryCode) samlObject;
+ citizenCountryCode.setCitizenCountryCode(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java
new file mode 100644
index 000000000..48da2a24b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java
@@ -0,0 +1,26 @@
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.common.xml.SAMLConstants;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+
+public class CustomAttributeQueryBuilder extends AbstractSAMLObjectBuilder<CustomAttributeQuery> {
+ /**
+ * Constructor.
+ */
+ public CustomAttributeQueryBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public CustomAttributeQuery buildObject() {
+ return buildObject(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public CustomAttributeQuery buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new CustomAttributeQueryImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java
new file mode 100644
index 000000000..fdd7c268d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java
@@ -0,0 +1,63 @@
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.impl.SubjectQueryImpl;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+
+
+public class CustomAttributeQueryImpl extends SubjectQueryImpl implements CustomAttributeQuery {
+ /** Attribute child elements. */
+ private final XMLObjectChildrenList<Attribute> attributes;
+ private String serviceURL;
+
+ /**
+ * 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 CustomAttributeQueryImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ attributes = new XMLObjectChildrenList<Attribute>(this);
+ }
+
+ /** {@inheritDoc} */
+ public List<Attribute> getAttributes() {
+ return attributes;
+ }
+
+ /** {@inheritDoc} */
+ public List<XMLObject> getOrderedChildren() {
+ ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ if (super.getOrderedChildren() != null) {
+ children.addAll(super.getOrderedChildren());
+ }
+ children.addAll(attributes);
+
+ if (children.size() == 0) {
+ return null;
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ public String getAssertionConsumerServiceURL() {
+ // TODO Auto-generated method stub
+ return this.serviceURL;
+ }
+
+ public void setAssertionConsumerServiceURL(String newServiceUrl) {
+ // TODO Auto-generated method stub
+ this.serviceURL = newServiceUrl;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java
new file mode 100644
index 000000000..7f2013ca8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java
@@ -0,0 +1,50 @@
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.Configuration;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.saml2.core.impl.SubjectQueryMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+
+public class CustomAttributeQueryMarshaller extends SubjectQueryMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
+ CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
+
+ if (req.getVersion() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
+ }
+
+ if (req.getID() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
+ domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
+ }
+
+ if (req.getVersion() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
+ }
+
+ if (req.getIssueInstant() != null) {
+ String iiStr = Configuration.getSAMLDateFormatter().print(req.getIssueInstant());
+ domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
+ }
+
+ if (req.getDestination() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.DESTINATION_ATTRIB_NAME, req.getDestination());
+ }
+
+ if (req.getAssertionConsumerServiceURL() != null) {
+ domElement.setAttributeNS(null, CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME, req.getAssertionConsumerServiceURL());
+ }
+
+ if (req.getConsent() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
+ }
+ }
+
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java
new file mode 100644
index 000000000..e351b65b0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java
@@ -0,0 +1,114 @@
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.saml2.core.impl.SubjectQueryUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+
+public class CustomAttributeQueryUnmarshaller extends SubjectQueryUnmarshaller {
+
+ private final Logger log = LoggerFactory.getLogger(AbstractXMLObjectUnmarshaller.class);
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
+ throws UnmarshallingException {
+ CustomAttributeQuery query = (CustomAttributeQuery) parentSAMLObject;
+
+ if (childSAMLObject instanceof Attribute) {
+ query.getAttributes().add((Attribute) childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
+ if (log.isTraceEnabled()) {
+ log.trace("Starting to unmarshall DOM element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ checkElementIsTarget(domElement);
+
+ //String namespaceURI, String elementLocalName, String namespacePrefix
+ XMLObject xmlObject = new CustomAttributeQueryImpl(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ if (log.isTraceEnabled()) {
+ log.trace("Unmarshalling attributes of DOM Element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ NamedNodeMap attributes = domElement.getAttributes();
+ Node attribute;
+ for (int i = 0; i < attributes.getLength(); i++) {
+ attribute = attributes.item(i);
+
+ // These should allows be attribute nodes, but just in case...
+ if (attribute.getNodeType() == Node.ATTRIBUTE_NODE) {
+ unmarshallAttribute(xmlObject, (Attr) attribute);
+ }
+ }
+
+ if (log.isTraceEnabled()) {
+ log.trace("Unmarshalling other child nodes of DOM Element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ Node childNode = domElement.getFirstChild();
+ while (childNode != null) {
+
+ if (childNode.getNodeType() == Node.ATTRIBUTE_NODE) {
+ unmarshallAttribute(xmlObject, (Attr) childNode);
+ } else if (childNode.getNodeType() == Node.ELEMENT_NODE) {
+ unmarshallChildElement(xmlObject, (Element) childNode);
+ } else if (childNode.getNodeType() == Node.TEXT_NODE
+ || childNode.getNodeType() == Node.CDATA_SECTION_NODE) {
+ unmarshallTextContent(xmlObject, (Text) childNode);
+ }
+
+ childNode = childNode.getNextSibling();
+ }
+
+ xmlObject.setDOM(domElement);
+ return xmlObject;
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
+ CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
+
+ if (attribute.getLocalName().equals(RequestAbstractType.VERSION_ATTRIB_NAME)) {
+ req.setVersion(SAMLVersion.valueOf(attribute.getValue()));
+ } else if (attribute.getLocalName().equals(RequestAbstractType.ID_ATTRIB_NAME)) {
+ req.setID(attribute.getValue());
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ } else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
+ && !DatatypeHelper.isEmpty(attribute.getValue())) {
+ req.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
+ } else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
+ req.setDestination(attribute.getValue());
+ } else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
+ req.setConsent(attribute.getValue());
+ } else if (attribute.getLocalName().equals(CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME)) {
+ req.setAssertionConsumerServiceURL(attribute.getValue());
+ }else {
+ super.processAttribute(samlObject, attribute);
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java
new file mode 100644
index 000000000..3f4fc633d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+/**
+ * The Class EIDCrossBorderShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareBuilder extends AbstractSAMLObjectBuilder<EIDCrossBorderShare> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the identifier cross border share
+ */
+ public final EIDCrossBorderShare buildObject() {
+ return buildObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ }
+
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID cross border share
+ */
+ public final EIDCrossBorderShare buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDCrossBorderShareImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java
new file mode 100644
index 000000000..3827f5085
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java
@@ -0,0 +1,87 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class EIDCrossBorderShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareImpl extends AbstractSAMLObject implements
+ EIDCrossBorderShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossBorderShareImpl.class.getName());
+ /** The citizen country code. */
+ private String eIDCrossBorderShare;
+
+ /**
+ * Instantiates a new eID cross border share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDCrossBorderShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+
+ /**
+ * Gets the eID cross border share.
+ *
+ * @return the eID cross border share
+ */
+ public final String getEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+
+ /**
+ * Sets the eID cross border share.
+ *
+ * @param newEIDCrossBorderShare the new eID cross border share
+ */
+ public final void setEIDCrossBorderShare(String newEIDCrossBorderShare) {
+ this.eIDCrossBorderShare = prepareForAssignment(this.eIDCrossBorderShare, newEIDCrossBorderShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ * {@inheritDoc}
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java
new file mode 100644
index 000000000..c5e113013
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java
@@ -0,0 +1,47 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+
+/**
+ * The Class EIDCrossBorderShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
+ XMLHelper.appendTextContent(domElement, crossBorderShare.getEIDCrossBorderShare());
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java
new file mode 100644
index 000000000..e74bee6ca
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java
@@ -0,0 +1,43 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+/**
+ * The Class EIDCrossBorderShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
+ crossBorderShare.setEIDCrossBorderShare(elementContent);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java
new file mode 100644
index 000000000..5e91e18fd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+/**
+ * The Class EIDCrossSectorShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareBuilder extends
+ AbstractSAMLObjectBuilder<EIDCrossSectorShare> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the eID cross sector share
+ */
+ public final EIDCrossSectorShare buildObject() {
+ return buildObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID cross sector share implementation
+ */
+ public final EIDCrossSectorShareImpl buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDCrossSectorShareImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java
new file mode 100644
index 000000000..7b2ad3dbd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java
@@ -0,0 +1,89 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The Class EIDCrossSectorShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareImpl extends AbstractSAMLObject implements
+ EIDCrossSectorShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossSectorShareImpl.class.getName());
+ /** The citizen country code. */
+ private String eIDCrossSectorShare;
+
+
+ /**
+ * Instantiates a new eID cross sector share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDCrossSectorShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+
+ /**
+ * Gets the eID cross sector share.
+ *
+ * @return the eID cross sector share
+ */
+ public final String getEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+
+ /**
+ * Sets the eID cross sector share.
+ *
+ * @param newEIDCrossSectorShare the new eID cross sector share
+ */
+ public final void setEIDCrossSectorShare(String newEIDCrossSectorShare) {
+ this.eIDCrossSectorShare = prepareForAssignment(this.eIDCrossSectorShare, newEIDCrossSectorShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java
new file mode 100644
index 000000000..3ee9df698
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java
@@ -0,0 +1,46 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+
+/**
+ * The Class EIDCrossSectorShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
+ XMLHelper.appendTextContent(domElement, crossSectorShare.getEIDCrossSectorShare());
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java
new file mode 100644
index 000000000..94c7689be
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java
@@ -0,0 +1,47 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+/**
+ * The Class EIDCrossSectorShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String domElement) {
+
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
+ crossSectorShare.setEIDCrossSectorShare(domElement);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java
new file mode 100644
index 000000000..230ff3ca4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java
@@ -0,0 +1,51 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+/**
+ * The Class EIDSectorShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareBuilder extends
+ AbstractSAMLObjectBuilder<EIDSectorShare> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the eID sector share
+ */
+ public final EIDSectorShare buildObject() {
+ return buildObject(EIDSectorShare.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID sector share
+ */
+ public final EIDSectorShare buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDSectorShareImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java
new file mode 100644
index 000000000..9ed726a32
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java
@@ -0,0 +1,85 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EIDSectorShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareImpl extends AbstractSAMLObject implements
+ EIDSectorShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDSectorShareImpl.class.getName());
+
+ /** The e id sector share. */
+ private String eIDSectorShare;
+ /**
+ * Instantiates a new eID sector share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDSectorShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * Gets the eID sector share.
+ *
+ * @return the eID sector share
+ */
+ public final String getEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eID sector share.
+ *
+ * @param newEIDSectorShare the new eID sector share
+ */
+ public final void setEIDSectorShare(String newEIDSectorShare) {
+ this.eIDSectorShare = prepareForAssignment(this.eIDSectorShare, newEIDSectorShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java
new file mode 100644
index 000000000..0ce449cd1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java
@@ -0,0 +1,46 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml2.core.impl.AbstractNameIDTypeMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+/**
+ * The Class EIDSectorShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
+ XMLHelper.appendTextContent(domElement, sectorShare.getEIDSectorShare());
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java
new file mode 100644
index 000000000..f7f00adb9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java
@@ -0,0 +1,47 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+
+/**
+ * The Class EIDSectorShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String domElement) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
+ sectorShare.setEIDSectorShare(domElement);
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.java
new file mode 100644
index 000000000..41676931b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class QAAAttributeBuilder.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeBuilder extends
+ AbstractSAMLObjectBuilder<QAAAttribute> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the quality authentication assurance object
+ */
+ public final QAAAttribute buildObject() {
+ return buildObject(QAAAttribute.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the quality authentication assurance object
+
+ */
+ public final QAAAttribute buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new QAAAttributeImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java
new file mode 100644
index 000000000..46f3bb402
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class QAAAttributeImpl.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeImpl extends AbstractSAMLObject implements
+ QAAAttribute {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(QAAAttributeImpl.class.getName());
+ /** The quality authentication assurance level. */
+ private String qaaLevel;
+
+ /**
+ * 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 QAAAttributeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the quality authentication assurance level.
+ *
+ * @return the quality authentication assurance level
+ */
+ public final String getQaaLevel() {
+ return qaaLevel;
+ }
+
+ /**
+ * Sets the quality authentication assurance level.
+ *
+ * @param newQaaLevel the new quality authentication assurance level
+ */
+ public final void setQaaLevel(final String newQaaLevel) {
+ this.qaaLevel = prepareForAssignment(this.qaaLevel, newQaaLevel);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.java
new file mode 100644
index 000000000..000879368
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class QAAAttributeMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final QAAAttribute qaaAttribute = (QAAAttribute) samlObject;
+ XMLHelper.appendTextContent(domElement, qaaAttribute.getQaaLevel());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.java
new file mode 100644
index 000000000..8445e4eeb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class QAAAttributeUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final QAAAttribute qaaLevel = (QAAAttribute) samlObject;
+ qaaLevel.setQaaLevel(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java
new file mode 100644
index 000000000..c9881c439
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java
@@ -0,0 +1,54 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+
+/**
+ * The Class RequestedAttributeBuilder.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeBuilder extends
+ AbstractSAMLObjectBuilder<RequestedAttribute> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the requested attribute
+ */
+ public final RequestedAttribute buildObject() {
+ return buildObject(RequestedAttribute.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the requested attribute
+ */
+ public final RequestedAttribute buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new RequestedAttributeImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java
new file mode 100644
index 000000000..ac2e8a3ee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java
@@ -0,0 +1,220 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.AttributeMap;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RequestedAttributeImpl.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeImpl extends AbstractSAMLObject implements
+ RequestedAttribute {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(RequestedAttributeImpl.class.getName());
+ /**
+ * The attribute values.
+ */
+ private final XMLObjectChildrenList<XMLObject> attributeValues;
+
+ /**
+ * The friendly name.
+ *
+ */
+ private String friendlyName;
+
+ /**
+ * The is required.
+ */
+ private String isRequired;
+
+ /**
+ * The name.
+ *
+ */
+ private String name;
+
+ /**
+ * The name format.
+ *
+ */
+ private String nameFormat;
+
+ /**
+ * The unknown attributes.
+ *
+ */
+ private AttributeMap unknownAttributes;
+
+ /**
+ * Instantiates a new requested attribute impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected RequestedAttributeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ unknownAttributes = new AttributeMap(this);
+ attributeValues = new XMLObjectChildrenList<XMLObject>(this);
+ }
+
+
+ /**
+ * Gets the attribute values.
+ *
+ * @return the attribute values
+ */
+ public final List<XMLObject> getAttributeValues() {
+ return attributeValues;
+ }
+
+ /**
+ * Gets the friendly name.
+ *
+ * @return the friendly name.
+ */
+ public final String getFriendlyName() {
+ return friendlyName;
+ }
+
+
+ /**
+ * Gets the checks if is required.
+ *
+ * @return the boolean if it's required.
+ */
+ public final String isRequired() {
+ return isRequired;
+ }
+
+
+ /**
+ * Gets the is required xs boolean.
+ *
+ * @return the XSBoolean if it's required.
+ */
+ public final String getIsRequiredXSBoolean() {
+ return isRequired;
+ }
+
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+
+ /**
+ * Gets the name format.
+ *
+ * @return the name format.
+ */
+ public final String getNameFormat() {
+ return nameFormat;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the list of XMLObject.
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+ children.addAll(attributeValues);
+ return Collections.unmodifiableList(children);
+ }
+
+ /**
+ * Gets the unknown attributes.
+ *
+ * @return the attribute map
+ */
+ public final AttributeMap getUnknownAttributes() {
+ return unknownAttributes;
+ }
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param newFriendlyName the new friendly name format
+ */
+ public final void setFriendlyName(final String newFriendlyName) {
+ this.friendlyName = prepareForAssignment(this.friendlyName,
+ newFriendlyName);
+ }
+
+ /**
+ * Set new boolean value isRequired.
+ * @param newIsRequired then new value
+ */
+ public final void setIsRequired(final String newIsRequired) {
+ isRequired = prepareForAssignment(this.isRequired, newIsRequired);
+
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = prepareForAssignment(this.name, newName);
+ }
+
+ /**
+ * Sets the name format.
+ *
+ * @param newNameFormat the new name format
+ */
+ public final void setNameFormat(final String newNameFormat) {
+ this.nameFormat = prepareForAssignment(this.nameFormat, newNameFormat);
+ }
+
+ /**
+ * Sets the unknown attributes.
+ *
+ * @param newUnknownAttr the new unknown attributes
+ */
+ public final void setUnknownAttributes(final AttributeMap newUnknownAttr) {
+ this.unknownAttributes = newUnknownAttr;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java
new file mode 100644
index 000000000..1a14a118a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java
@@ -0,0 +1,89 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.Configuration;
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+
+/**
+ * The Class RequestedAttributeMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall attributes.
+ *
+ * @param samlElement the SAML element
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallAttributes(final XMLObject samlElement,
+ final Element domElement) throws MarshallingException {
+ final RequestedAttribute requestedAttr = (RequestedAttribute) samlElement;
+
+ if (requestedAttr.getName() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.NAME_ATTRIB_NAME, requestedAttr
+ .getName());
+ }
+
+ if (requestedAttr.getNameFormat() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.NAME_FORMAT_ATTR, requestedAttr
+ .getNameFormat());
+ }
+
+ if (requestedAttr.getFriendlyName() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.FRIENDLY_NAME_ATT, requestedAttr
+ .getFriendlyName());
+ }
+
+ if (requestedAttr.getIsRequiredXSBoolean() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.IS_REQUIRED_ATTR, requestedAttr
+ .getIsRequiredXSBoolean().toString());
+ }
+
+ Attr attr;
+ for (Entry<QName, String> entry : requestedAttr.getUnknownAttributes()
+ .entrySet()) {
+ attr = XMLHelper.constructAttribute(domElement.getOwnerDocument(),
+ entry.getKey());
+ attr.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attr);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || requestedAttr.getUnknownAttributes().isIDAttribute(
+ entry.getKey())) {
+ attr.getOwnerElement().setIdAttributeNode(attr, true);
+ }
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
new file mode 100644
index 000000000..c07f852d9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
@@ -0,0 +1,96 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+
+/**
+ * The Class RequestedAttributeUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentSAMLObject parent SAMLObject
+ * @param childSAMLObject child SAMLObject
+ *
+ * @throws UnmarshallingException error at unmarshall XML object
+ */
+ protected final void processChildElement(final XMLObject parentSAMLObject,
+ final XMLObject childSAMLObject) throws UnmarshallingException {
+
+ final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;
+
+ final QName childQName = childSAMLObject.getElementQName();
+ if (childQName.getLocalPart().equals("AttributeValue")
+ && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
+ requestedAttr.getAttributeValues().add(childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+ /**
+ * Process attribute.
+ *
+ * @param samlObject the SAML object
+ * @param attribute the attribute
+ * @throws UnmarshallingException the unmarshalling exception
+ */
+ protected final void processAttribute(final XMLObject samlObject,
+ final Attr attribute) throws UnmarshallingException {
+
+ final RequestedAttribute requestedAttr = (RequestedAttribute) samlObject;
+
+ if (attribute.getLocalName()
+ .equals(RequestedAttribute.NAME_ATTRIB_NAME)) {
+ requestedAttr.setName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.NAME_FORMAT_ATTR)) {
+ requestedAttr.setNameFormat(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.FRIENDLY_NAME_ATT)) {
+ requestedAttr.setFriendlyName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.IS_REQUIRED_ATTR)) {
+ requestedAttr.setIsRequired(attribute
+ .getValue());
+
+ } else {
+ final QName attribQName = XMLHelper.getNodeQName(attribute);
+ if (attribute.isId()) {
+ requestedAttr.getUnknownAttributes().registerID(attribQName);
+ }
+ requestedAttr.getUnknownAttributes().put(attribQName,
+ attribute.getValue());
+ }
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java
new file mode 100644
index 000000000..d421c53d2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java
@@ -0,0 +1,54 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesBuilder.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesBuilder extends
+ AbstractSAMLObjectBuilder<RequestedAttributes> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the requested attributes
+ */
+ public final RequestedAttributes buildObject() {
+ return buildObject(RequestedAttributes.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the requested attributes
+ */
+ public final RequestedAttributes buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new RequestedAttributesImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java
new file mode 100644
index 000000000..0a5b37add
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java
@@ -0,0 +1,95 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesImpl extends AbstractSAMLObject implements
+ RequestedAttributes {
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected RequestedAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ indexedChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
+ }
+
+ /** The indexed children. */
+ private final IndexedXMLObjectChildrenList<XMLObject> indexedChildren;
+
+ /**
+ * Gets the indexed children.
+ *
+ * @return the indexed children
+ */
+ public final IndexedXMLObjectChildrenList<XMLObject> getIndexedChildren() {
+ return indexedChildren;
+ }
+
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.addAll(indexedChildren);
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the attributes.
+ *
+ * @return the attributes
+ *
+ * @see eu.stork.peps.auth.engine.core.RequestedAttributes#getAttributes()
+ */
+ @SuppressWarnings("unchecked")
+ public final List<RequestedAttribute> getAttributes() {
+ return (List<RequestedAttribute>) indexedChildren
+ .subList(RequestedAttribute.DEF_ELEMENT_NAME);
+ }
+
+ @Override
+ public int hashCode() {
+ throw new UnsupportedOperationException("hashCode method not implemented");
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java
new file mode 100644
index 000000000..dfc42adf3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java
@@ -0,0 +1,33 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class RequestedAttributesMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Instantiates a new requested attributes marshaller.
+ */
+ public RequestedAttributesMarshaller() {
+ super();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java
new file mode 100644
index 000000000..41b3afa40
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException error in unmarshall
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final RequestedAttributes attrStatement = (RequestedAttributes) parentObject;
+
+ if (childObject instanceof RequestedAttribute) {
+ attrStatement.getAttributes().add((RequestedAttribute) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.java
new file mode 100644
index 000000000..a35c77936
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.java
@@ -0,0 +1,51 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SPApplication;
+
+/**
+ * The Class SPApplicationBuilder.
+ *
+ * @author fjquevedo
+ */
+public class SPApplicationBuilder extends
+ AbstractSAMLObjectBuilder<SPApplication> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the service provider application
+ */
+ public final SPApplication buildObject() {
+ return buildObject(SPApplication.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the service provider application
+ */
+ public final SPApplication buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new SPApplicationImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java
new file mode 100644
index 000000000..0a428a521
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPApplication;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPApplicationImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPApplicationImpl extends AbstractSAMLObject implements
+ SPApplication {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPApplicationImpl.class.getName());
+ /** The service provider application. */
+ private String spApplication;
+
+ /**
+ * Instantiates a new service provider application.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPApplicationImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return the service provider application
+ */
+ public final String getSPApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param newSpApplication the new service provider application
+ */
+ public final void setSPApplication(final String newSpApplication) {
+ this.spApplication = prepareForAssignment(this.spApplication,
+ newSpApplication);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.java
new file mode 100644
index 000000000..4866c3535
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.java
@@ -0,0 +1,46 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.SPApplication;
+
+/**
+ * The Class SPApplicationMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPApplicationMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final SPApplication spApplication = (SPApplication) samlObject;
+ XMLHelper.appendTextContent(domElement, spApplication
+ .getSPApplication());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.java
new file mode 100644
index 000000000..a28432a13
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.java
@@ -0,0 +1,42 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPApplication;
+
+
+/**
+ * The Class SPApplicationUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPApplicationUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final SPApplication spApplication = (SPApplication) samlObject;
+ spApplication.setSPApplication(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.java
new file mode 100644
index 000000000..48ec92f49
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SPCountry;
+
+/**
+ * The Class SPCountryBuilder.
+ *
+ * @author fjquevedo
+ */
+public class SPCountryBuilder extends AbstractSAMLObjectBuilder<SPCountry> {
+
+
+ /**
+ * Builds the object SPCountry.
+ *
+ * @return the service provider country
+ */
+ public final SPCountry buildObject() {
+ return buildObject(SPCountry.DEF_ELEMENT_NAME);
+ }
+
+
+ /**
+ * Builds the object SPCountry.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the service provider country
+ */
+ public final SPCountry buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new SPCountryImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java
new file mode 100644
index 000000000..40a1ac86a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPCountry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPCountryImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPCountryImpl extends AbstractSAMLObject implements SPCountry {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPCountryImpl.class.getName());
+ /** The service provider country. */
+ private String spCountry;
+
+ /**
+ * Instantiates a new service provider country.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPCountryImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider country.
+ *
+ * @return the service provider country
+ */
+ public final String getSPCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the service provider country.
+ *
+ * @param newSpCountry the new service provider country
+ */
+ public final void setSPCountry(final String newSpCountry) {
+ this.spCountry = prepareForAssignment(this.spCountry, newSpCountry);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.java
new file mode 100644
index 000000000..e82634749
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.SPCountry;
+
+/**
+ * The Class SPCountryMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPCountryMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final SPCountry spCountry = (SPCountry) samlObject;
+ XMLHelper.appendTextContent(domElement, spCountry.getSPCountry());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.java
new file mode 100644
index 000000000..deb695ac6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.java
@@ -0,0 +1,42 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPCountry;
+
+
+/**
+ * The Class SPCountryUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPCountryUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final SPCountry spCountry = (SPCountry) samlObject;
+ spCountry.setSPCountry(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.java
new file mode 100644
index 000000000..b3640947b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SPID;
+
+/**
+ * The Class SPIDBuilder.
+ *
+ * @author iinigo
+ */
+public class SPIDBuilder extends AbstractSAMLObjectBuilder<SPID> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the SP ID
+ */
+ public final SPID buildObject() {
+ return buildObject(SPID.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the citizen country code
+ */
+ public final SPID buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new SPIDImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java
new file mode 100644
index 000000000..68611997b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPIDImpl.
+ *
+ * @author iinigo
+ */
+public class SPIDImpl extends AbstractSAMLObject implements SPID {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPIDImpl.class.getName());
+ /** The citizen country code. */
+ private String spId;
+
+ /**
+ * Instantiates a new sP country impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPIDImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return the SP ID
+ */
+ public final String getSPID() {
+ return spId;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param newSPID the new SP ID
+ */
+ public final void setSPID(final String newSPID) {
+ this.spId = prepareForAssignment(this.spId, newSPID);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.java
new file mode 100644
index 000000000..24389522e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.SPID;
+
+/**
+ * The Class SPIDMarshaller.
+ *
+ * @author iinigo
+ */
+public class SPIDMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final SPID spid = (SPID) samlObject;
+ XMLHelper.appendTextContent(domElement, spid.getSPID());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.java
new file mode 100644
index 000000000..e4d230b94
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPID;
+
+/**
+ * The Class SPIDUnmarshaller.
+ *
+ * @author iinigo
+ */
+public class SPIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final SPID spid = (SPID) samlObject;
+ spid.setSPID(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.java
new file mode 100644
index 000000000..a6e1fe686
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.SPInformation;
+
+/**
+ * The Class SPInformation.
+ *
+ * @author iinigo
+ */
+public final class SPInformationBuilder extends AbstractSAMLObjectBuilder<SPInformation> {
+
+
+ /** {@inheritDoc} */
+ public SPInformation buildObject() {
+ return buildObject(SAMLCore.STORK10P_NS.getValue(), SPInformation.DEF_LOCAL_NAME, SAMLCore.STORK10P_PREFIX.getValue());
+ }
+
+ /** {@inheritDoc} */
+ public SPInformation buildObject(final String namespaceURI, final String localName, final String namespacePrefix) {
+ return new SPInformationImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java
new file mode 100644
index 000000000..ff6e90999
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java
@@ -0,0 +1,110 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The Class SPInformationImpl.
+ *
+ * @author iinigo
+ */
+public final class SPInformationImpl extends AbstractSignableSAMLObject implements
+SPInformation {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPInformationImpl.class.getName());
+ /** The citizen country code. */
+ private SPID spId;
+
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPInformationImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * getSPId.
+ *
+ * @return the SP ID
+ */
+ public SPID getSPID() {
+ return spId;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(spId);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Sets the SP Id.
+ *
+ * @param newSPId the new SP Id
+ *
+ */
+ public void setSPID(SPID newSPId) {
+ this.spId = prepareForAssignment(this.spId, newSPId);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.java
new file mode 100644
index 000000000..44845948c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.java
@@ -0,0 +1,33 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class SPInformationMarshaller.
+ *
+ * @author iinigo
+ */
+public class SPInformationMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Instantiates a new SP Information marshaller.
+ */
+ public SPInformationMarshaller() {
+ super();
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java
new file mode 100644
index 000000000..414b93386
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java
@@ -0,0 +1,52 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+
+/**
+ * The Class SPInformationUnmarshaller.
+ *
+ * @author iinigo
+ */
+public class SPInformationUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final SPInformation spInformation = (SPInformation) parentObject;
+
+ if (childObject instanceof SPID) {
+ spInformation.setSPID((SPID) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.java
new file mode 100644
index 000000000..fe47cf99c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.java
@@ -0,0 +1,51 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SPInstitution;
+
+/**
+ * The Class SPInstitutionBuilder.
+ *
+ * @author fjquevedo
+ */
+public class SPInstitutionBuilder extends
+ AbstractSAMLObjectBuilder<SPInstitution> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the service provider institution
+ */
+ public final SPInstitution buildObject() {
+ return buildObject(SPInstitution.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object SPInstitution.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the service provider institution
+ */
+ public final SPInstitution buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new SPInstitutionImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java
new file mode 100644
index 000000000..38438613a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPInstitutionImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPInstitutionImpl extends AbstractSAMLObject implements
+ SPInstitution {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPInstitutionImpl.class.getName());
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /**
+ * Instantiates a new service provider institution.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPInstitutionImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return the service provider institution
+ */
+ public final String getSPInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param newSpInstitution the new service provider institution
+ */
+ public final void setSPInstitution(final String newSpInstitution) {
+ this.spInstitution = prepareForAssignment(this.spInstitution,
+ newSpInstitution);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+ }
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.java
new file mode 100644
index 000000000..504a1f035
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.java
@@ -0,0 +1,46 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.SPInstitution;
+
+/**
+ * The Class SPInstitutionMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPInstitutionMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final SPInstitution spInstitution = (SPInstitution) samlObject;
+ XMLHelper.appendTextContent(domElement, spInstitution
+ .getSPInstitution());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.java
new file mode 100644
index 000000000..103d5f2b2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPInstitution;
+
+/**
+ * The Class SPInstitutionUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPInstitutionUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final SPInstitution spInstitution = (SPInstitution) samlObject;
+ spInstitution.setSPInstitution(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.java
new file mode 100644
index 000000000..a691b9008
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.java
@@ -0,0 +1,50 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SPSector;
+
+/**
+ * The Class SPSectorBuilder.
+ *
+ * @author fjquevedo
+ */
+public class SPSectorBuilder extends AbstractSAMLObjectBuilder<SPSector> {
+
+ /**
+ * Builds the object SPSector.
+ *
+ * @return the service provider sector.
+ */
+ public final SPSector buildObject() {
+ return buildObject(SPSector.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object SPSector.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the service provider sector
+ */
+ public final SPSector buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new SPSectorImpl(namespaceURI, localName, namespacePrefix);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java
new file mode 100644
index 000000000..4ac822876
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPSector;
+
+
+/**
+ * The Class SPSectorImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPSectorImpl extends AbstractSAMLObject implements SPSector {
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /**
+ * Instantiates a new Service provider sector implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPSectorImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return the SP sector
+ *
+ * @see eu.stork.peps.auth.engine.core.SPSector#getSPSector()
+ */
+ public final String getSPSector() {
+ return spSector;
+ }
+
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param newSpSector the new service provider sector
+ */
+ public final void setSPSector(final String newSpSector) {
+ this.spSector = prepareForAssignment(this.spSector, newSpSector);
+ }
+
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ throw new UnsupportedOperationException("hashCode method not implemented");
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.java
new file mode 100644
index 000000000..c5331e8f4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.SPSector;
+
+/**
+ * The Class SPSectorMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPSectorMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final SPSector spSector = (SPSector) samlObject;
+ XMLHelper.appendTextContent(domElement, spSector.getSPSector());
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.java
new file mode 100644
index 000000000..cbb05c6e5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.java
@@ -0,0 +1,42 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPSector;
+
+/**
+ * The Class SPSectorUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class SPSectorUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final SPSector spSector = (SPSector) samlObject;
+ spSector.setSPSector(elementContent);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java
new file mode 100644
index 000000000..cdb70c7a6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java
@@ -0,0 +1,468 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.InvalidPropertiesFormatException;
+import java.util.List;
+import java.util.Properties;
+
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.KeyInfoHelper;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.SignatureValidator;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Class HWSign. Module of sign.
+ *
+ * @author fjquevedo
+ */
+public final class SignHW implements SAMLEngineSignI {
+
+ /** The Constant CONFIGURATION_FILE. */
+ private static final String CONF_FILE = "configurationFile";
+
+ /** The Constant KEYSTORE_TYPE.
+ private static final String KEYSTORE_TYPE = "keystoreType" */
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SignHW.class
+ .getName());
+
+ /** The stork own key store. */
+ private KeyStore storkOwnKeyStore = null;
+
+ /**
+ * Gets the stork own key store.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getStorkOwnKeyStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Gets the stork trustStore.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getTrustStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Sets the stork own key store.
+ *
+ * @param newkOwnKeyStore the new stork own key store
+ */
+ public void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
+ this.storkOwnKeyStore = newkOwnKeyStore;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /** The HW sign prop. */
+ private Properties properties = null;
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#init(java.lang.String)
+ * @param fileConf file of configuration
+ * @throws SAMLEngineException error in read file
+ */
+ public void init(final String fileConf)
+ throws SAMLEngineException {
+ InputStream inputStr = null;
+ try {
+ inputStr = SignHW.class.getResourceAsStream("/"
+ + fileConf);
+ properties = new Properties();
+
+ properties.loadFromXML(inputStr);
+ } catch (final InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(inputStr);
+ }
+ }
+
+
+ /**
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
+ * @return the X509Certificate.
+ */
+ public X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#sign(SignableSAMLObject tokenSaml)
+ * @param tokenSaml signable SAML Object
+ * @return the SAMLObject signed.
+ * @throws SAMLEngineException error in sign token saml
+ */
+ public SAMLObject sign(final SignableSAMLObject tokenSaml) throws SAMLEngineException {
+
+ try {
+ LOG.info("Star procces of sign");
+ final char[] pin = properties.getProperty("keyPassword")
+ .toCharArray();
+
+ storkOwnKeyStore.load(null, pin);
+
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+
+ boolean find = false;
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements() && !find;) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ // Verified serial number, issuer
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if(serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ if (!find) {
+ throw new SAMLEngineException("Certificate cannot be found in keystore ");
+ }
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
+ alias, pin);
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.info("Star procces of sign");
+ final Signature signature = (Signature) org.opensaml.xml.Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ LOG.debug("Begin signature with openSaml");
+ signature.setSigningCredential(credential);
+
+ /*signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+
+
+
+ final SecurityConfiguration securityConf =
+ org.opensaml.xml.Configuration.getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = securityConf
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+
+ LOG.debug("Set Canonicalization Algorithm");
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ }
+ else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ Response res = (Response)tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1)
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else
+ {
+ Assertion assertion = (Assertion)asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+ } catch (final MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (final NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (final KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (final SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (final SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (final CertificateException e) {
+ LOG.error("Certificate exception.");
+ throw new SAMLEngineException(e);
+ } catch (final IOException e) {
+ LOG.error("IO exception.");
+ throw new SAMLEngineException(e);
+ } catch (final UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKeyException exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(SignableSAMLObject)
+ * @param tokenSaml the token saml
+ * @return the SAMLObject validated.
+ * @throws SAMLEngineException exception in validate signature
+ */
+ public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator signProfValidator =
+ new SAMLSignatureProfileValidator();
+
+ // Indicates signature id conform to SAML Signature profile
+ signProfValidator.validate(tokenSaml.getSignature());
+
+ String aliasCert;
+ X509Certificate certificate;
+
+ final List<Credential> trustedCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements();) {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustedCred.add(credential);
+ }
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+ final List<X509Certificate> listCertificates = KeyInfoHelper
+ .getCertificates(keyInfo);
+
+ if (listCertificates.size() != 1) {
+ throw new SAMLEngineException("Only must be one certificate");
+ }
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(listCertificates.get(0));
+
+ final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustedCred)) {
+ throw new SAMLEngineException("Certificate it is not trusted.");
+ }
+
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (final ValidationException e) {
+ LOG.error("ValidationException.", e);
+ throw new SAMLEngineException(e);
+ } catch (final KeyStoreException e) {
+ LOG.error("ValidationException.", e);
+ throw new SAMLEngineException(e);
+ } catch (final CertificateException e) {
+ LOG.error("CertificateException.", e);
+ throw new SAMLEngineException(e);
+ }
+ return tokenSaml;
+ }
+
+ /**
+ * load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ * Note this class was using pkcs11Provider
+ * final Provider pkcs11Provider = new sun.security.pkcs11.SunPKCS11(inputStream)
+ * if (Security.getProperty(pkcs11Provider.getName()) == null) {
+ * Security.insertProviderAt(pkcs11Provider, Security .getProviders().length)
+ * }
+ * storkOwnKeyStore = KeyStore.getInstance(properties.getProperty(KEYSTORE_TYPE))
+ */
+ public void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+ InputStream inputStream = null;
+
+ try {
+ inputStream = SignHW.class.getResourceAsStream("/"
+ + properties.getProperty(CONF_FILE));
+
+ } catch (final Exception e) {
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java
new file mode 100644
index 000000000..c37074eab
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java
@@ -0,0 +1,64 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class ModuleSignFactory.
+ *
+ * @author fjquevedo
+ *
+ */
+
+public final class SignModuleFactory {
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(SignModuleFactory.class.getName());
+
+ /**
+ * Instantiates a new module sign factory.
+ */
+ private SignModuleFactory() {
+
+ }
+
+ /**
+ * Gets the single instance of SignModuleFactory.
+ *
+ * @param className the class name
+ *
+ * @return single instance of SignModuleFactory
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SAMLEngineSignI getInstance(final String className)
+ throws STORKSAMLEngineException {
+ LOG.info("[START]SignModuleFactory static");
+ try {
+ final Class cls = Class.forName(className);
+ return (SAMLEngineSignI) cls.newInstance();
+ } catch (Exception e) {
+ throw new STORKSAMLEngineException(e);
+ }
+
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
new file mode 100644
index 000000000..45c8c1041
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
@@ -0,0 +1,556 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.InvalidPropertiesFormatException;
+import java.util.List;
+import java.util.Properties;
+
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.SignatureValidator;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Class SWSign. Class responsible for signing and validating of messages
+ * SAML with a certificate store software.
+ *
+ * @author fjquevedo
+ */
+public final class SignP12 implements SAMLEngineSignI {
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SignP12.class
+ .getName());
+
+
+ /** The p12 store. */
+ private KeyStore p12Store = null;
+
+
+ /** The trust store. */
+ private KeyStore trustStore = null;
+
+
+ /**
+ * Gets the trust store.
+ *
+ * @return the trust store
+ */
+ public KeyStore getTrustStore() {
+ return trustStore;
+ }
+
+ /**
+ * Sets the trust store.
+ *
+ * @param newTrustStore the new trust store
+ */
+ public void setTrustStore(final KeyStore newTrustStore) {
+ this.trustStore = newTrustStore;
+ }
+
+ /**
+ * The instance.
+ *
+ * @return the properties
+ */
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+
+
+ /**
+ * Gets the p12 store.
+ *
+ * @return the p12 store
+ */
+ public KeyStore getP12Store() {
+ return p12Store;
+ }
+
+
+
+ /**
+ * Sets the p12 store.
+ *
+ * @param newP12Store the new p12 store
+ */
+ public void setP12Store(final KeyStore newP12Store) {
+ this.p12Store = newP12Store;
+ }
+
+
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /** The SW sign prop. */
+ private Properties properties = null;
+
+
+ /**
+ * Initialize the file configuration.
+ *
+ * @param fileConf name of the file configuration
+ *
+ * @throws SAMLEngineException error at the load from file configuration
+ */
+ public void init(final String fileConf) throws SAMLEngineException {
+ InputStream fileProperties = null;
+ properties = new Properties();
+ try {
+ try {
+ LOG.debug("Fichero a cargar " + fileConf);
+ fileProperties = new FileInputStream(fileConf);
+ properties.loadFromXML(fileProperties);
+ } catch (Exception e) {
+ LOG.error("Fallo al cargar el recurso externo. Se reintenta como fichero interno.");
+ fileProperties = SignP12.class.getResourceAsStream("/" + fileConf);
+ if (fileProperties == null) {
+ fileProperties = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileConf);
+ if (fileProperties == null) {
+ Enumeration<URL> files = ClassLoader.getSystemClassLoader().getResources(fileConf);
+ if (files != null && files.hasMoreElements()) {
+ LOG.info("Se han encontrado recurso/s. Se toma el primero.");
+ fileProperties = ClassLoader.getSystemClassLoader().getResourceAsStream(files.nextElement().getFile());
+ } else {
+ throw new IOException("No se pudo recuperar el fichero: " + fileConf, e);
+ }
+ }
+ }
+ LOG.debug("Recuperados " + fileProperties.available() + " bytes");
+ properties.loadFromXML(fileProperties);
+ }
+ } catch (InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileProperties);
+ }
+ }
+
+ /**
+ * Gets the certificate.
+ *
+ * @return the X509Certificate
+ *
+ */
+ public X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Sign the token SAML.
+ *
+ * @param tokenSaml token SAML
+ *
+ * @return the X509Certificate signed.
+ *
+ * @throws SAMLEngineException error at sign SAML token
+ *
+ */
+ public SAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start Sign process");
+ try {
+
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+
+ boolean find = false;
+ for (final Enumeration<String> e = p12Store.aliases(); e
+ .hasMoreElements() && !find;) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) p12Store
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if(serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ certificate = (X509Certificate) p12Store
+ .getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) p12Store.getKey(
+ alias, properties.getProperty("keyPassword").toCharArray());
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.debug("Begin signature with openSaml");
+ final Signature signature = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ signature.setSigningCredential(credential);
+
+ /*signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+
+ final SecurityConfiguration secConfiguration = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ }
+ else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ Response res = (Response)tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1)
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else
+ {
+ Assertion assertion = (Assertion)asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKey exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * Validate signature.
+ *
+ * @param tokenSaml token SAML
+ *
+ * @return the SAMLObject validated.
+ *
+ * @throws SAMLEngineException error validate signature
+ *
+ */
+ public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator sigProfValidator =
+ new SAMLSignatureProfileValidator();
+ try {
+ // Indicates signature id conform to SAML Signature profile
+ sigProfValidator.validate(tokenSaml.getSignature());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
+ throw new SAMLEngineException(e);
+ }
+
+ String aliasCert = null;
+ X509Certificate certificate;
+
+ /*final List<Credential> trustCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = trustStore.aliases(); e
+ .hasMoreElements();) {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) trustStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustCred.add(credential);
+ }*/
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ final CertificateFactory certFact = CertificateFactory
+ .getInstance("X.509");
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(cert);
+
+ boolean trusted = false;
+
+ for (final Enumeration<String> e = trustStore.aliases(); e.hasMoreElements();)
+ {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) trustStore.getCertificate(aliasCert);
+ try {
+ cert.verify(certificate.getPublicKey());
+ trusted = true;
+ break;
+ }
+ catch (Exception ex) {
+ //Do nothing - cert not trusted yet
+ }
+ }
+
+ if (!trusted)
+ throw new SAMLEngineException("Certificate is not trusted.");
+
+ /*
+ // Validate trust certificates
+ final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustCred)) {
+ throw new SAMLEngineException("Certificate it is not trusted.");
+ }*/
+
+ // Validate signature
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("KeyStoreException.", e);
+ throw new SAMLEngineException(e);
+ } catch (GeneralSecurityException e) {
+ LOG.error("GeneralSecurityException.", e);
+ throw new SAMLEngineException(e);
+ }
+ return tokenSaml;
+ }
+
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ public void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+
+ FileInputStream fis = null;
+ FileInputStream fisTrustStore = null;
+
+ try {
+ // Dynamically register Bouncy Castle provider.
+ boolean found = false;
+ // Check if BouncyCastle is already registered as a provider
+ final Provider[] providers = Security.getProviders();
+ for (int i = 0; i < providers.length; i++) {
+ if (providers[i].getName().equals(
+ BouncyCastleProvider.PROVIDER_NAME)) {
+ found = true;
+ }
+ }
+
+ // Register only if the provider has not been previously registered
+ if (!found) {
+ LOG.debug("SAMLCore: Register Bouncy Castle provider.");
+ Security.insertProviderAt(new BouncyCastleProvider(), Security
+ .getProviders().length);
+ }
+
+ p12Store = KeyStore.getInstance(properties
+ .getProperty("keystoreType"));
+
+ fis = new FileInputStream(properties
+ .getProperty("keystorePath"));
+
+ p12Store.load(fis, properties.getProperty(
+ "keyStorePassword").toCharArray());
+
+
+ trustStore = KeyStore.getInstance(properties
+ .getProperty("trustStoreType"));
+
+ fisTrustStore = new FileInputStream(properties
+ .getProperty("trustStorePath"));
+ trustStore.load(fisTrustStore, properties.getProperty(
+ "trustStorePassword").toCharArray());
+
+ } catch (Exception e) {
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ IOUtils.closeQuietly(fisTrustStore);
+ }
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
new file mode 100644
index 000000000..ef33f66f2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
@@ -0,0 +1,538 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.InvalidPropertiesFormatException;
+import java.util.List;
+import java.util.Properties;
+
+import eu.stork.peps.auth.engine.SAMLEngineUtils;
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.security.trust.ExplicitX509CertificateTrustEvaluator;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.SignatureValidator;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+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;
+
+
+/**
+ * The Class SWSign. Class responsible for signing and validating of messages
+ * SAML with a certificate store software.
+ *
+ * @author fjquevedo
+ */
+public class SignSW implements SAMLEngineSignI {
+
+ /** The Constant KEYSTORE_TYPE. */
+ private static final String KEYSTORE_TYPE = "keystoreType";
+
+ /** The Constant KEY_STORE_PASSWORD. */
+ private static final String KEY_STORE_PASS = "keyStorePassword";
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SignSW.class
+ .getName());
+
+ /** The stork own key store. */
+ private KeyStore storkOwnKeyStore = null;
+
+ /**
+ * The instance.
+ *
+ * @return the properties
+ */
+
+ public final Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Gets the stork own key store.
+ *
+ * @return the stork own key store
+ */
+ public final KeyStore getStorkOwnKeyStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Gets the stork trustStore.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getTrustStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Sets the stork own key store.
+ *
+ * @param newkOwnKeyStore the new stork own key store
+ */
+ public final void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
+ this.storkOwnKeyStore = newkOwnKeyStore;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public final void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /** The SW sign prop. */
+ private Properties properties = null;
+
+
+ /**
+ * Inits the file configuration.
+ *
+ * @param fileConf name of the file configuration
+ *
+ * @throws SAMLEngineException error at the load from file configuration
+ */
+ public final void init(final String fileConf)
+ throws SAMLEngineException {
+ InputStream fileProperties = null;
+ try {
+ // 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);
+ fileProperties.close();
+ } catch (InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileProperties);
+ }
+ }
+
+ /**
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
+ * @return the X509Certificate
+ */
+ public final X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+
+ /**
+ * Sign the token SAML.
+ *
+ * @param tokenSaml the token SAML.
+ *
+ * @return the SAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ *
+ */
+ public final SAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start Sign process.");
+ try {
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+ boolean find = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements() && !find; ) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if(serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
+ alias = aliasCert;
+ find = true;
+ }
+ }
+ if (!find) {
+ throw new SAMLEngineException("Certificate cannot be found in keystore ");
+ }
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
+ alias, properties.getProperty("keyPassword").toCharArray());
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.debug("Begin signature with openSaml");
+ final Signature signature = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ signature.setSigningCredential(credential);
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+
+
+ final SecurityConfiguration secConfiguration = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ }
+ else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ Response res = (Response)tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1)
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else
+ {
+ Assertion assertion = (Assertion)asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKey exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(org.opensaml.common.SignableSAMLObject)
+ * @param tokenSaml token SAML
+ * @return the SAMLObject validated.
+ * @throws SAMLEngineException error validate signature
+ */
+ public final SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator sigProfValidator =
+ new SAMLSignatureProfileValidator();
+ try {
+ // Indicates signature id conform to SAML Signature profile
+ sigProfValidator.validate(tokenSaml.getSignature());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
+ throw new SAMLEngineException(e);
+ }
+
+ String aliasCert = null;
+ X509Certificate certificate;
+
+ /*final List<Credential> trustCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements();) {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustCred.add(credential);
+ }*/
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ final CertificateFactory certFact = CertificateFactory
+ .getInstance("X.509");
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(cert);
+
+// try {
+// cert.checkValidity();
+// }
+// catch (CertificateExpiredException exp) {
+// throw new SAMLEngineException("Certificate expired.");
+// }
+// catch (CertificateNotYetValidException exp) {
+// throw new SAMLEngineException("Certificate not yet valid.");
+// }
+//
+ boolean trusted = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e.hasMoreElements();)
+ {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(aliasCert);
+ try {
+ cert.verify(certificate.getPublicKey());
+ trusted = true;
+ break;
+ }
+ catch (Exception ex) {
+ //Do nothing - cert not trusted yet
+ }
+ }
+
+ if (!trusted)
+ throw new SAMLEngineException("Certificate is not trusted.");
+
+ /*
+ // Validate trust certificates
+ final ExplicitX509CertificateTrustEvaluator chainTrustEvaluator = new ExplicitX509CertificateTrustEvaluator();
+
+ if (!chainTrustEvaluator.validate(entityX509Cred, trustCred)) {
+ throw new SAMLEngineException("Certificate is not trusted.");
+ }
+ /*final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustCred)) {
+ throw new SAMLEngineException("Certificate is not trusted.");
+ }*/
+
+ // Validate signature
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("KeyStoreException.", e);
+ throw new SAMLEngineException(e);
+ } catch (GeneralSecurityException e) {
+ LOG.error("GeneralSecurityException.", e);
+ throw new SAMLEngineException(e);
+ }
+ LOG.info(tokenSaml.getSignatureReferenceID());
+ LOG.info("Start signature validation - END." );
+ return tokenSaml;
+ }
+
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ public final void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+ FileInputStream fis = null;
+ try {
+ // Dynamically register Bouncy Castle provider.
+ boolean found = false;
+ // Check if BouncyCastle is already registered as a provider
+ final Provider[] providers = Security.getProviders();
+ for (int i = 0; i < providers.length; i++) {
+ if (providers[i].getName().equals(
+ BouncyCastleProvider.PROVIDER_NAME)) {
+ found = true;
+ }
+ }
+
+ // Register only if the provider has not been previously registered
+ if (!found) {
+ LOG.info("SAMLCore: Register Bouncy Castle provider.");
+ Security.insertProviderAt(new BouncyCastleProvider(), Security
+ .getProviders().length);
+ }
+
+ storkOwnKeyStore = KeyStore.getInstance(properties
+ .getProperty(KEYSTORE_TYPE));
+
+ LOG.info("Loading KeyInfo from keystore file " + properties.getProperty("keystorePath"));
+ fis = new FileInputStream(properties
+ .getProperty("keystorePath"));
+
+ storkOwnKeyStore.load(fis, properties.getProperty(
+ KEY_STORE_PASS).toCharArray());
+
+ } catch (Exception e) {
+ LOG.error("Error loading CryptographicServiceProvider", e);
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ }
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.java
new file mode 100644
index 000000000..a60515593
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.java
@@ -0,0 +1,41 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+
+/**
+ * The Class VIDPAuthenticationAttributesBuilder.
+ *
+ * @author fjquevedo
+ */
+public final class VIDPAuthenticationAttributesBuilder extends AbstractSAMLObjectBuilder<VIDPAuthenticationAttributes> {
+
+
+ /** {@inheritDoc} */
+ public VIDPAuthenticationAttributes buildObject() {
+ return buildObject(SAMLCore.STORK10P_NS.getValue(), VIDPAuthenticationAttributes.DEF_LOCAL_NAME, SAMLCore.STORK10P_PREFIX.getValue());
+ }
+
+ /** {@inheritDoc} */
+ public VIDPAuthenticationAttributes buildObject(final String namespaceURI, final String localName, final String namespacePrefix) {
+ return new VIDPAuthenticationAttributesImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java
new file mode 100644
index 000000000..25737e307
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java
@@ -0,0 +1,132 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class VIDPAuthenticationAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public final class VIDPAuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
+VIDPAuthenticationAttributes {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(VIDPAuthenticationAttributesImpl.class.getName());
+ /** The citizen country code. */
+ private CitizenCountryCode citizenCountryCode;
+
+ /** The SP information. */
+ private SPInformation spInformation;
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected VIDPAuthenticationAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * getCitizenCountryCode.
+ *
+ * @return the citizen country code
+ */
+ public CitizenCountryCode getCitizenCountryCode() {
+ return citizenCountryCode;
+ }
+
+ /**
+ * getSPInformation
+ *
+ * @return the SP information
+ */
+ public SPInformation getSPInformation() {
+ return spInformation;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(citizenCountryCode);
+ children.add(spInformation);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ *
+ */
+ public void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode) {
+ this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
+ }
+
+ /**
+ * Sets the SP information.
+ *
+ * @param newSPInformation the new SP information
+ *
+ */
+ public void setSPInformation(SPInformation newSPInformation) {
+ this.spInformation = prepareForAssignment(this.spInformation, newSPInformation);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.java
new file mode 100644
index 000000000..5635ddd6b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.java
@@ -0,0 +1,33 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class VIDPAuthenticationAttributesMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class VIDPAuthenticationAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Instantiates a new vIDP authentication attributes marshaller.
+ */
+ public VIDPAuthenticationAttributesMarshaller() {
+ super();
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java
new file mode 100644
index 000000000..ba4a4fe3a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java
@@ -0,0 +1,55 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+
+/**
+ * The Class VIDPAuthenticationAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class VIDPAuthenticationAttributesUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final VIDPAuthenticationAttributes vIDPAuthenticationAttr = (VIDPAuthenticationAttributes) parentObject;
+
+ if (childObject instanceof CitizenCountryCode) {
+ vIDPAuthenticationAttr.setCitizenCountryCode((CitizenCountryCode) childObject);
+ } else if (childObject instanceof SPInformation) {
+ vIDPAuthenticationAttr.setSPInformation((SPInformation) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java
new file mode 100644
index 000000000..07db9c9db
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Implementations of STORK 1.0 core specification types and elements.
+ */
+package eu.stork.peps.auth.engine.core.impl; \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java
new file mode 100644
index 000000000..51745d796
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Interfaces for STORK 1.0 core specification types and elements.
+ */
+package eu.stork.peps.auth.engine.core; \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java
new file mode 100644
index 000000000..a5f4202ff
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java
@@ -0,0 +1,57 @@
+package eu.stork.peps.auth.engine.core.validator;
+
+import java.util.List;
+
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.core.SubjectQuery;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+public class CustomAttributeQueryValidator implements Validator<CustomAttributeQuery> {
+
+ /*
+ * Validate action.
+ *
+ * @param qaa the quality authentication assurance level attribute
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final CustomAttributeQuery attrQuery) throws ValidationException {
+ validateAssertion(attrQuery);
+ validateSubject(attrQuery);
+ validateDestination(attrQuery);
+ }
+
+
+ /**
+ * Validate assertion.
+ *
+ * @param attrQuery the attribute query
+ *
+ * @throws ValidationException the validation exception
+ */
+ protected final void validateAssertion(final CustomAttributeQuery attrQuery)
+ throws ValidationException {
+ if (DatatypeHelper.isEmpty(attrQuery.getAssertionConsumerServiceURL())) {
+ throw new ValidationException("Consumer Service URL must be specified.");
+ }
+ }
+
+ //Validate subject
+ protected void validateSubject(CustomAttributeQuery query) throws ValidationException {
+ if (query.getSubject() == null)
+ throw new ValidationException("Subject is required");
+ }
+
+ //Validate destination
+ protected void validateDestination(CustomAttributeQuery query) throws ValidationException {
+ if (query.getDestination() == null)
+ throw new ValidationException("Destination is required");
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java
new file mode 100644
index 000000000..491549aac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java
@@ -0,0 +1,61 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.validator;
+
+import java.util.List;
+
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class ExtensionsSchemaValidator.
+ *
+ * @author fjquevedo
+ */
+public class ExtensionsSchemaValidator implements Validator<Extensions> {
+
+
+ /**
+ * validate the extensions.
+ *
+ * @param extensions the extensions
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final Extensions extensions)
+ throws ValidationException {
+ if (extensions.getUnknownXMLObjects() == null
+ || extensions.getUnknownXMLObjects().size() <= 0) {
+ throw new ValidationException("Extension element is empty or not exist.");
+ }
+
+ List<XMLObject> qaa = extensions.getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME);
+
+ if (qaa.size() == 1) {
+ final Validator<QAAAttribute> validatorQaa = new QAAAttributeSchemaValidator();
+ validatorQaa.validate((QAAAttribute) qaa.get(0));
+ } else {
+ throw new ValidationException(
+ "Extensions must contain only one element QAALevel.");
+ }
+
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java
new file mode 100644
index 000000000..44c9db380
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java
@@ -0,0 +1,65 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.validator;
+
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class QAAAttributeSchemaValidator.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeSchemaValidator implements Validator<QAAAttribute> {
+
+
+ /**
+ * Validate action.
+ *
+ * @param qaa the quality authentication assurance level attribute
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final QAAAttribute qaa) throws ValidationException {
+ validateAction(qaa);
+ }
+
+
+ /**
+ * Validate action.
+ *
+ * @param qaaAttribute the quality authentication assurance level attribute.
+ *
+ * @throws ValidationException the validation exception
+ */
+ protected final void validateAction(final QAAAttribute qaaAttribute)
+ throws ValidationException {
+ if (DatatypeHelper.isEmpty(qaaAttribute.getQaaLevel())) {
+ throw new ValidationException("QAALevel label must be specified.");
+ }
+
+ final int qaa = Integer.valueOf(qaaAttribute.getQaaLevel());
+
+ if (qaa < QAAAttribute.MIN_VALUE || qaa > QAAAttribute.MAX_VALUE) {
+ throw new ValidationException(
+ "QAALevel label must be greater than 0.");
+ }
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java
new file mode 100644
index 000000000..07b632773
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Validation rules for STORK 1.0 core types and elements.
+ */
+package eu.stork.peps.auth.engine.core.validator; \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java
new file mode 100644
index 000000000..30130b7f6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message.
+ */
+package eu.stork.peps.auth.engine; \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
new file mode 100644
index 000000000..c358f7cb7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
@@ -0,0 +1,136 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.InvalidPropertiesFormatException;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationCreator {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationCreator.class.getName());
+
+ /**
+ * Creates the configuration.
+ *
+ * @param instanceConfs the instance configuration
+ *
+ * @return the map< string, map< string, object>>
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Map<String, Map<String, Object>> createConfiguration(
+ final Map<String, InstanceEngine> instanceConfs) throws STORKSAMLEngineException {
+
+ final HashMap<String, Map<String, Object>> instances =
+ new HashMap<String, Map<String, Object>>();
+
+ LOGGER.info("Create configuration.");
+ try {
+ // Only create instances for SAMLEngine configuration.
+ // INSTANCE
+ for (Map.Entry<String, InstanceEngine> entry : instanceConfs
+ .entrySet()) {
+ final InstanceEngine iEngine = entry.getValue();
+
+ final Map<String, Object> intance = new HashMap<String, Object>();
+
+ // CONFIGURATION
+ for (ConfigurationEngine configuration : iEngine
+ .getConfiguration()) {
+ // Properties only for configuration SamlEngine.
+ if (configuration.getName().equalsIgnoreCase(
+ "SamlEngineConf")) {
+ intance.put(configuration.getName(),
+ getNewInstance(configuration.getParameters()
+ .get("fileConfiguration")));
+ } else {
+ intance.put(configuration.getName(), configuration
+ .getParameters());
+ }
+ }
+ instances.put(entry.getKey(), intance);
+ }
+ } catch (STORKSAMLEngineException ex) {
+ LOGGER.error("Can not create instance from file configuration.");
+ throw new STORKSAMLEngineException(ex);
+ }
+ return instances;
+ }
+
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine
+ * runtime exception
+ */
+ private static Properties getNewInstance(final String fileName)
+ throws STORKSAMLEngineException {
+ LOGGER.info("Create file configuration properties to Stork Saml Engine.");
+ InputStream fileEngineProp = null;
+ try {
+ // 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;
+ } catch (InvalidPropertiesFormatException e) {
+ LOGGER.error("Invalid properties format.");
+ throw new STORKSAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error read file: " + fileName);
+ throw new STORKSAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileEngineProp);
+ }
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationCreator() {
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
new file mode 100644
index 000000000..d9e7e467a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
@@ -0,0 +1,69 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+/**
+ * The Class ConfigurationEngine.
+ *
+ * @author fjquevedo
+ */
+public class ConfigurationEngine {
+
+ /** The name of the configuration file. */
+ private String name;
+
+ /** The parameters. */
+ private Map<String, String> parameters;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newParameters the parameters
+ */
+ public final void setParameters(final Map<String, String> newParameters) {
+ this.parameters = newParameters;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
new file mode 100644
index 000000000..06c2d2f94
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
@@ -0,0 +1,233 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class ConfigurationReader.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationReader {
+
+ /** The Constant SAML_ENGINE_CONFIGURATION_FILE. */
+ private static final String ENGINE_CONF_FILE = "SamlEngine.xml";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationReader.class.getName());
+
+ /** The Constant NODE_CONFIGURATION. */
+ private static final String NODE_CONF = "configuration";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_CONF_NAME = "name";
+
+ /** The Constant NODE_INSTANCE_NAME. */
+ private static final String NODE_INST_NAME = "name";
+
+ /** The Constant NODE_INSTANCE. */
+ private static final String NODE_INSTANCE = "instance";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_NAME = "name";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_VALUE = "value";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAMETER = "parameter";
+
+ /**
+ * Generate parameters.
+ *
+ * @param configurationNode the configuration node
+ *
+ * @return the map< string, string>
+ */
+ private static Map<String, String> generateParam(
+ final Element configurationNode) {
+
+ final HashMap<String, String> parameters = new HashMap<String, String>();
+
+ final NodeList parameterNodes = configurationNode
+ .getElementsByTagName(NODE_PARAMETER);
+
+ String parameterName;
+ String parameterValue;
+
+ for (int k = 0; k < parameterNodes.getLength(); ++k) {
+ // for every parameter find, process.
+ final Element parameterNode = (Element) parameterNodes.item(k);
+ parameterName = parameterNode.getAttribute(NODE_PARAM_NAME);
+ parameterValue = parameterNode.getAttribute(NODE_PARAM_VALUE);
+
+ // verified the content.
+ if (StringUtils.isBlank(parameterName)
+ || StringUtils.isBlank(parameterValue)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader parameters (name - value).");
+ } else {
+ parameters.put(parameterName.trim(), parameterValue.trim());
+ }
+ }
+ return parameters;
+ }
+
+ /**
+ * Read configuration.
+ *
+ * @return the map< string, instance engine>
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ public static Map<String, InstanceEngine> readConfiguration()
+ throws SAMLEngineException {
+
+ // 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<String, InstanceEngine> instanceConfs =
+ new HashMap<String, InstanceEngine>();
+
+ Document document = null;
+ // Load configuration file
+ final DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ DocumentBuilder builder;
+
+ InputStream engineConf = null;
+ try {
+
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ builder = factory.newDocumentBuilder();
+
+ if(null != base)
+ engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
+ else
+ engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
+
+ document = builder.parse(engineConf);
+
+ // Read instance
+ final NodeList list = document.getElementsByTagName(NODE_INSTANCE);
+
+ for (int indexElem = 0; indexElem < list.getLength(); ++indexElem) {
+ final Element element = (Element) list.item(indexElem);
+
+ final InstanceEngine instanceConf = new InstanceEngine();
+
+ // read every configuration.
+ final String instanceName = element
+ .getAttribute(NODE_INST_NAME);
+
+ if (StringUtils.isBlank(instanceName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader instance name.");
+ }
+ instanceConf.setName(instanceName.trim());
+
+ final NodeList confNodes = element
+ .getElementsByTagName(NODE_CONF);
+
+ for (int indexNode = 0; indexNode < confNodes.getLength(); ++indexNode) {
+
+ final Element configurationNode = (Element) confNodes
+ .item(indexNode);
+
+ final String configurationName = configurationNode
+ .getAttribute(NODE_CONF_NAME);
+
+ if (StringUtils.isBlank(configurationName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader configuration name.");
+ }
+
+ final ConfigurationEngine confSamlEngine =
+ new ConfigurationEngine();
+
+ // Set configuration name.
+ confSamlEngine.setName(configurationName.trim());
+
+ // Read every parameter for this configuration.
+ final Map<String, String> parameters =
+ generateParam(configurationNode);
+
+ // Set parameters
+ confSamlEngine.setParameters(parameters);
+
+ // Add parameters to the configuration.
+ instanceConf.getConfiguration().add(confSamlEngine);
+ }
+
+ // Add to the list of configurations.
+ instanceConfs.put(element.getAttribute(NODE_INST_NAME),
+ instanceConf);
+ }
+
+ } catch (SAXException e) {
+ LOGGER.error("Error: init library parser.");
+ throw new SAMLEngineException(e);
+ } catch (ParserConfigurationException e) {
+ LOGGER.error("Error: parser configuration file xml.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error: read configuration file.");
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(engineConf);
+ }
+
+ return instanceConfs;
+ }
+
+ /**
+ * Instantiates a new configuration reader.
+ */
+ private ConfigurationReader() {
+
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
new file mode 100644
index 000000000..d00607853
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
@@ -0,0 +1,74 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationSingleton {
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationSingleton.class.getName());
+
+ static {
+ LOGGER.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOGGER.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine runtime exception
+ */
+ private static Map<String, Map<String, Object>> getInstance(
+ final String fileName) throws STORKSAMLEngineException {
+ return ConfigurationCreator.createConfiguration(instanceConfigs);
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationSingleton() {
+ }
+
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
new file mode 100644
index 000000000..4d9bba8e7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
@@ -0,0 +1,70 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The Class InstanceConfiguration.
+ *
+ * @author fjquevedo
+ */
+public class InstanceEngine {
+
+ /** The configuration. */
+ private List<ConfigurationEngine> configuration = new ArrayList<ConfigurationEngine>();
+
+ /** The name. */
+ private String name;
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final List<ConfigurationEngine> getConfiguration() {
+ return this.configuration;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newConfiguration the new parameters
+ */
+ public final void setConfiguration(final List<ConfigurationEngine> newConfiguration) {
+ this.configuration = newConfiguration;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
new file mode 100644
index 000000000..344368e03
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message instance.
+ */
+package eu.stork.peps.configuration;
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java
new file mode 100644
index 000000000..ac46f73e4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java
@@ -0,0 +1,57 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.exceptions;
+
+/**
+ * The Class SAMLEngineException.
+ *
+ * @author fjquevedo
+ */
+public class SAMLEngineException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 2611361164977849837L;
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param wrappedException the wrapped exception
+ */
+ public SAMLEngineException(final Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param message the message
+ */
+ public SAMLEngineException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param message the message
+ * @param wrappedException the wrapped exception
+ */
+ public SAMLEngineException(final String message,
+ final Exception wrappedException) {
+ super(message, wrappedException);
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineException.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineException.java
new file mode 100644
index 000000000..bddcbd1b3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineException.java
@@ -0,0 +1,135 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.exceptions;
+
+/**
+ * The Class STORKSAMLEngineException.
+ *
+ * @author fjquevedo
+ */
+public class STORKSAMLEngineException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -8319723167019122930L;
+
+ /** The error code. */
+ private String errorCode;
+
+ /** The error detail. */
+ private String errorDetail;
+
+ /**
+ * Instantiates a new sTORKSAML engine exception.
+ *
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineException(final Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Instantiates a new sTORKSAML engine exception.
+ *
+ * @param errorMessage the error message
+ */
+ public STORKSAMLEngineException(final String errorMessage) {
+ super(errorMessage);
+ }
+
+ /**
+ * Instantiates a new sTORKSAML engine exception.
+ *
+ * @param message the message
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineException(final String message,
+ final Exception wrappedException) {
+ super(message, wrappedException);
+ }
+
+ /**
+ * Instantiates a new sTORKSAML engine exception.
+ *
+ * @param newErrorCode the error code
+ * @param errorMessage the error message
+ * @param newErrorDetail the error detail
+ */
+ public STORKSAMLEngineException(final String newErrorCode,
+ final String errorMessage, final String newErrorDetail) {
+ super(errorMessage);
+ this.errorCode = newErrorCode;
+ this.errorDetail = newErrorDetail;
+ }
+
+ /**
+ * Gets the error code.
+ *
+ * @return the error code
+ */
+ public final String getErrorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Gets the error detail.
+ *
+ * @return the error detail
+ */
+ public final String getErrorDetail() {
+ return errorDetail;
+ }
+
+ /**
+ * Gets the error message.
+ *
+ * @return the error message
+ */
+ public final String getErrorMessage() {
+ return super.getMessage();
+ }
+
+
+ /**
+ * Gets the message.
+ *
+ * @return the message of the exception.
+ *
+ * @see java.lang.Throwable#getMessage()
+ */
+ public final String getMessage() {
+ return "Error (no. " + errorCode + ") processing request : "
+ + super.getMessage();
+ }
+
+ /**
+ * Sets the error code.
+ *
+ * @param newErrorCode the new error code
+ */
+ public final void setErrorCode(final String newErrorCode) {
+ this.errorCode = newErrorCode;
+ }
+
+ /**
+ * Sets the error detail.
+ *
+ * @param newErrorDetail the new error detail
+ */
+ public final void setErrorDetail(final String newErrorDetail) {
+ this.errorDetail = newErrorDetail;
+ }
+
+}
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java
new file mode 100644
index 000000000..fb01fd5aa
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java
@@ -0,0 +1,56 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.exceptions;
+
+/**
+ * The Class STORKSAMLEngineRuntimeException.
+ *
+ * @author fjquevedo
+ */
+public class STORKSAMLEngineRuntimeException extends RuntimeException {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 5829810358581493517L;
+
+ /**
+ * Instantiates a new sTORKSAML engine runtime exception.
+ *
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineRuntimeException(final Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Creates a new instance of application exception.
+ *
+ * @param cause the exception cause.
+ */
+ public STORKSAMLEngineRuntimeException(final String cause) {
+ super(cause);
+ }
+
+ /**
+ * Instantiates a new sTORKSAML engine runtime exception.
+ *
+ * @param message the message
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineRuntimeException(final String message,
+ final Exception wrappedException) {
+ super(message, wrappedException);
+ }
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java
new file mode 100644
index 000000000..0c7341995
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes for STORK exceptions management.
+ */
+package eu.stork.peps.exceptions; \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SamlEngine.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SamlEngine.xml
new file mode 100644
index 000000000..563196604
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SamlEngine.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<instances>
+
+
+ <!-- Configuration name-->
+ <instance name="outgoing">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_outgoing.xml" />
+ </configuration>
+
+ <!-- Settings module signature-->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
+ </configuration>
+ </instance>
+
+</instances> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml
new file mode 100644
index 000000000..46f29b741
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=saml-demo-cert,OU=STORK2,O=Advania,L=Reykjavik,ST=Reykjavik,C=IS</entry>
+ <entry key="serialNumber">529E05C8</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml
new file mode 100644
index 000000000..fbf1bcdac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry1.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml
new file mode 100644
index 000000000..7cf336ead
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry2.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml
new file mode 100644
index 000000000..0da5143c1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry3.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_P11.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_P11.xml
new file mode 100644
index 000000000..96d06a8be
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_P11.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>HWModule sign with interface PKCS11.</comment>
+ <entry key="configurationFile">p11Config.cfg</entry>
+ <entry key="keyPassword">*******</entry>
+ <entry key="issuer">CN=XXXXXXXXX</entry>
+ <entry key="serialNumber">xxxxxxxxxxxxxx</entry>
+ <entry key="keystoreType">PKCS11</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
index c7cee3af4..7139c5a41 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SWModule sign with JKS.</comment>
- <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks</entry>
- <entry key="keyStorePassword">local-demo</entry>
- <entry key="keyPassword">local-demo</entry>
- <entry key="issuer">CN=local-demo-cert, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
- <entry key="serialNumber">4BA89DB2</entry>
- <entry key="keystoreType">JKS</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo-cert, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml
new file mode 100644
index 000000000..f45502c0c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml
new file mode 100644
index 000000000..f45502c0c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml
new file mode 100644
index 000000000..dd3768f4f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!--
+ Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml
new file mode 100644
index 000000000..5048b28a7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!--
+ Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+ <entry key="unknown">http://www.stork.gov.eu/1.0/unknown</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml
index f8fc4f91a..79c69aedb 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml
@@ -1,93 +1,93 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SAML constants for AuthnRequests and Responses.</comment>
-
- <!--
- Types of consent obtained from the user for this authentication and
- data transfer.
- Allow values: 'unspecified'.
- -->
- <entry key="consentAuthnRequest">unspecified</entry>
-
- <!--
- Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
- -->
- <entry key="consentAuthnResponse">obtained</entry>
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- -->
- <entry key="formatEntity">entity</entry>
-
- <!--Only HTTP-POST binding is only supported for inter PEPS-->
- <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
- <entry key="protocolBinding">HTTP-POST</entry>
-
-
-
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- <entry key="eIDSectorShare">true</entry>
- <entry key="eIDCrossSectorShare">true</entry>
- <entry key="eIDCrossBorderShare">true</entry>
- -->
-
-
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="friendlyName">false</entry>
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="isRequired">true</entry>
-
- <!--PEPS in the Service Provider's country-->
- <entry key="requester">http://S-PEPS.gov.xx</entry>
-
- <!--PEPS in the citizen's origin country-->
- <entry key="responder">http://C-PEPS.gov.xx</entry>
-
- <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
- <entry key="timeNotOnOrAfter">300</entry>
-
- <!--Validation IP of the response-->
- <entry key="ipAddrValidation">false</entry>
-
-
- <!--Subject Attribute Definitions-->
- <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
- <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
- <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
- <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
- <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
- <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
- <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
- <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
- <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
- <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
- <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
- <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
- <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
- <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
- <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
- <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
-
- <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
- <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
-
- <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
- <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
-
- <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
- <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
-
- <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
- <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
- <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
- <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
- <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
- <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+ <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
+ <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
+
</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
new file mode 100644
index 000000000..b318f9183
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest" ID="_939726f0a02072f40b548de378612a50" IssueInstant="2013-10-04T16:57:55.547Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_939726f0a02072f40b548de378612a50"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>BgPDTVCv7BhiWIs6HsC06jaHaag=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>dIC61bGi6Jqp1zSVojpjaVq9WaZcDtNImXgo1Dyze5/hJA07Sy4TaHu+/IuLEC99aLjM6rxh2UUNqpPaQCFlF5eVkVv/c4gHEZVyevhjJKTidqmnuhlI78PGMx2thfxFsHsPcqHqOzy1Z6w18K1ds6APQP+aXI9TNKis+pykn4nJititYuiSseD0VY0F4QnXx+U6k3raoi1CAFE5fe7EuI/KfxuhhQLAbLq90Vm8R94ITBjfSS25mXstXNe9zppTSjDB42ld1TjDovDwXAn5OxiZasIEb5m68sRlxgoQ/2/+ZdYNNINFLAwkCbb8MiCbGASd626Bme0Kx+ropeWdxw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDXjCCAkagAwIBAgIEUk1MbDANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJUzESMBAGA1UE
+CAwJUmV5a2phdmlrMRIwEAYDVQQHDAlSZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNV
+BAsMBlNUT1JLMjEXMBUGA1UEAwwOc2FtbC1kZW1vLWNlcnQwHhcNMTMxMDAzMTA1MzEyWhcNMjMx
+MDAzMTA1MzEyWjBxMQswCQYDVQQGEwJJUzESMBAGA1UECAwJUmV5a2phdmlrMRIwEAYDVQQHDAlS
+ZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNVBAsMBlNUT1JLMjEXMBUGA1UEAwwOc2Ft
+bC1kZW1vLWNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkSgTxZkNRXZTKLB0c
+4oz7/8Dh56FX+0cYg7hjw4e8vn+ITXkxzrmUH57FtsvKln4mq1H0FHXL80u3IiWX8qY+QLgNeKeB
+m85lXuyOb3wWpKAaQvpLAkejGLCx22AN2L0WZkKZV2puwRQVsRHCq6U6vToJXDZ6Ui6ltKsAl/ZS
+8qUFpiIvqD5ea4ohz4JsFE/uApRc7pbJ4VbOmAAeH/tQTayptq2kPb2vvUVk+2cH5J7UD+GCI88E
+e+mS+C33tV9NmWUHL69mYEe8FXjumbKA5e9i1ejn9i0/BLUtHFonHnL9YFMim0foI7NNc5mNg9aw
+vm0PuByVU3kuibQkqGBLAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAA9X5B4NBmVuhjECi+KOnRRX
+5oUV+jbYKhGZODDPi+F4Uo7ZtPFQ6sS3tE54+8AoDl5zQ5q5fDDVXhB42IIIjDxHKo8cBXie5FZ6
+mJtErvWZWYWdO0uV2OQAUALq2LieidqSFDJ+Pjl8w1New8oi3migwyE0jZo4Q97lJGDfJTruV0A2
+JE/Gt6QAAcWhhN2hZl92pYkIi5OeqHXyzBUp5vg8LLfNmeyziCAiXDC1Sy/aQU/cllZ3zFJMrqZM
+s2xBpmB4sF1YRbIrr2OqEVE6M6DUx+pAQOd2uogV3AMT9D5MYpckI1jx/o/Tto7ju74nIVOskDiN
+K0FR8izxcT0HixM=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjorn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
new file mode 100644
index 000000000..29db86a73
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_f6c8fc355b9f125cb5283f038e1b3cdf" IssueInstant="2013-10-03T10:28:15.449Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignatureValue>hhQXDKNrJJ3Yy/pkZNZF4GlWrA/Xsx4CH9chgVa5HK4qZQvFXvZwegdw6U7rm7qv0zmI4xaLTv/bpmqJzEPfY3sIvrDRu9EouEKwtjbMbcvVQsx7I+j0yy7/cBcQJe3lRwQwyvazfYVbnSeGFxBN6WOHPqv6uInaQO/hXkicT3tBtm8o3UgUDY6c8wIMuD5A0hWTkL6z6f893AbdN85OQYAdHItNsQWeLOIeiGC918X7qqTfhFtBAB2oGVjlsSEqWox1jNqrPl1jjA0dP76m5SIVSqF8XcDR306ZB9GLJywOHKba0lxGLsXOAzJ+8u9jeixJ6VZKFqZg2Fhl/saKbg==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjörn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:1.0:cm:sender-vouches"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
new file mode 100644
index 000000000..a912ec57c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:obtained" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_483140d440fc4eef8e949ace49669f2e" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_483140d440fc4eef8e949ace49669f2e"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>yMOVS1T/yRiVh3L6IBM9rR9Ie3w=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>d8e/RyNNPmnHRIzTIuRSnW6B60oWGBGxjRua/HvNxTuod0qSarYJxEedhY9Wl1Z9WYXlry28FuKjp3DA3HhzNaVd7A7QpFqNC4dnizSVWFjxlhmoE/Uv3Y/ha9P/fk6nbtHCSKW4kHSX7QfFLeggcLmUG0IULRF8UmRdQ0WerCl0aSZZeSp8J3LsFBPeWCRSwXgfiLn+RehggzZmQU6g0ssxrpnsYEAtjAiOli+YVQGuumsZGaJ8zHA/DgJ2FTGovNUyfuSUFLhd9nLlSqFs2Avnx0Ck7Q1dxDO5truOm6e285YLHqLaGdetFyPQAj/Z4w4RJ5u5X6d7rhBjTfRAAw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/><saml2p:StatusMessage>urn:oasis:names:tc:SAML:2.0:status:Success</saml2p:StatusMessage></saml2p:Status><saml2:Assertion ID="_9ed05849dee5c154e62fa9e3ba53e9f3" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="http://C-PEPS.gov.xx">urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml2:SubjectConfirmationData Address="111.222.333.444" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" NotOnOrAfter="2013-10-08T09:16:17.255Z"/></saml2:SubjectConfirmation></saml2:Subject><saml2:Conditions NotBefore="2013-10-08T09:11:17.255Z" NotOnOrAfter="2013-10-08T09:16:17.255Z"><saml2:AudienceRestriction><saml2:Audience>http://S-PEPS.gov.xx</saml2:Audience></saml2:AudienceRestriction><saml2:OneTimeUse/></saml2:Conditions><saml2:AuthnStatement AuthnInstant="2013-10-08T09:11:17.255Z"><saml2:SubjectLocality Address="111.222.333.444"/><saml2:AuthnContext><saml2:AuthnContextDecl/></saml2:AuthnContext></saml2:AuthnStatement><saml2:AttributeStatement><saml2:Attribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16/12/2008</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/canonicalResidenceAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:postalCode xsi:type="xs:anyType">105</stork:postalCode><stork:state xsi:type="xs:anyType">IS</stork:state><stork:streetNumber xsi:type="xs:anyType">10</stork:streetNumber><stork:streetName xsi:type="xs:anyType">Gudrunartun</stork:streetName><stork:town xsi:type="xs:anyType">Reykjavik</stork:town></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/newAttribute2" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:value3 xsi:type="xs:anyType">value3</stork:value3><stork:value4 xsi:type="xs:anyType">value4</stork:value4><stork:value1 xsi:type="xs:anyType">value1</stork:value1><stork:value2 xsi:type="xs:anyType">value2</stork:value2></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</saml2:AttributeValue><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">123456789IS</saml2:AttributeValue></saml2:Attribute></saml2:AttributeStatement></saml2:Assertion></saml2p:Response> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
new file mode 100644
index 000000000..f7bac4b61
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://S-PEPS.gov.xx/PEPS/ColleagueResponse" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ForceAuthn="true" ID="_e54eee285e7b8e2772875c406ec39674" IsPassive="false" IssueInstant="2010-06-08T07:37:54.533Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="University of Oxford" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
+<ds:Reference URI="#_e54eee285e7b8e2772875c406ec39674">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml2 saml2p stork storkp xs"/></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+<ds:DigestValue>yzsqaxBNicOrixBUno5cL0CBOpE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>
+Xycll1PF7hh3Xdykpr6nIr8Q6PQ6OxLIBBBugoGpAm/V4Hu7tKakHJp8TgtRWZ30jG5eolOXnJkC
+wiaTVUFaQz7cNn27syRJkdA+eYlz9doiwUJ5eD1cAyddZYsNPpSeAj5UK45oN0qCH+/pI9mRw8Oi
+YIN/BUEtXkoYTjPtkmA=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBmDCCAQECBEuWisIwDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UEAxMIY291bnRyeTEwHhcNMTAw
+MzA5MTc1MjAyWhcNMTAwNjA3MTc1MjAyWjATMREwDwYDVQQDEwhjb3VudHJ5MTCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAnb2gcchwxvJBclcsfCBWJnYefLJYQnDGCQ3RUtYZc26JznnLXclu
+h1XfLJlWgYk/pFKz7B9KfJztal47c6mBfisnxjhdcLqcbXOuRIm7E8TZPzdbHEd60WHPDv20jr+r
+/WkOQs12tKQMbgDX2wtBBcJODLYCDiYa1oQsnyhdOGkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBk
+3luVRc0EqEE1zZeYvRPi5a2yOZfI9H+/rXI1qNLwmICnuJX++ukUbqJHm/FV1iSPM9O9oqzifJ/K
+eKL5EcUugJ76Tu5XO8za2FoJvYr+jIZDsEkCg+OSzcp/eljiWAIh2enZcQ/ON6QxWXeSNJPH0xOq
+KAoZgbUK0Zld3Dsheg==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><stork:spSector>EDU001</stork:spSector><stork:spInstitution>OXF001</stork:spInstitution><stork:spApplication>APP001</stork:spApplication><stork:spCountry>EN</stork:spCountry><storkp:eIDSectorShare>true</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>true</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>true</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">16</stork:AttributeValue><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
new file mode 100644
index 000000000..b61a8cf41
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://locahost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignatureValue>
+S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+Xt8p8tK3EoMocZse2hw=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
new file mode 100644
index 000000000..07ff68d38
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://localhost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignatureValue>
+S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+Xt8p8tK3EoMocZse2hw=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks
index 289e952fe..289e952fe 100644
--- a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks
Binary files differ
diff --git a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks
index 5399bf689..5399bf689 100644
--- a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry1.jks
Binary files differ
diff --git a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks
index 5399bf689..5399bf689 100644
--- a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry2.jks
Binary files differ
diff --git a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks
index 5399bf689..5399bf689 100644
--- a/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/keyStoreCountry3.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/logback-test.xml b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/logback-test.xml
new file mode 100644
index 000000000..ff900e124
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/logback-test.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Basic configuration used until the IdP can load the real configuration
+ -->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </Pattern>
+ </layout>
+ </appender>
+
+ <logger name="eu.stork">
+ <level value="DEBUG" />
+ </logger>
+
+ <root>
+ <appender-ref ref="STDOUT" />
+ <level value="INFO" />
+ </root>
+
+</configuration> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/p11Conf.cfg b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/p11Conf.cfg
new file mode 100644
index 000000000..bd9f357ce
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/p11Conf.cfg
@@ -0,0 +1,24 @@
+//ATTRIBUTE VALUE
+//name name suffix of this provider instance
+//library pathname of PKCS#11 implementation
+//slotListIndex slot index
+
+//PREFIX DESCRIPTION
+//CKO_ Object class
+//CKA_ Attribute
+//CKK_ Key type
+
+//attributes(operation, keytype, keyalgorithm) = {
+// name1 = value1
+// [...]
+//}
+
+name=nameProvider
+library=library.dll
+slotListIndex=0
+attributes(*,CKO_PUBLIC_KEY,CKK_RSA)={
+ CKA_VERIFY=true
+}
+attributes(*,CKO_PRIVATE_KEY,CKK_RSA)={
+ CKA_SIGN=true
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/src/test/resources/storkDemoKeys.jks b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/storkDemoKeys.jks
new file mode 100644
index 000000000..efaeac86c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/src/test/resources/storkDemoKeys.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0-sources.jar b/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0-sources.jar
new file mode 100644
index 000000000..eba034378
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0-sources.jar
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0.jar b/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0.jar
new file mode 100644
index 000000000..3861f3825
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/SamlEngine-1.1.0.jar
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngine.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngine.class
new file mode 100644
index 000000000..d824b9c84
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngine.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngineUtils.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngineUtils.class
new file mode 100644
index 000000000..e0481e487
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/SAMLEngineUtils.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/STORKSAMLEngine.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/STORKSAMLEngine.class
new file mode 100644
index 000000000..1624e3b2a
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/STORKSAMLEngine.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/X509PrincipalUtil.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/X509PrincipalUtil.class
new file mode 100644
index 000000000..6209f6eb5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/X509PrincipalUtil.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/AuthenticationAttributes.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/AuthenticationAttributes.class
new file mode 100644
index 000000000..f9c79ca30
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/AuthenticationAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CitizenCountryCode.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CitizenCountryCode.class
new file mode 100644
index 000000000..7da2c0e42
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CitizenCountryCode.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomAttributeQuery.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomAttributeQuery.class
new file mode 100644
index 000000000..b12c0987d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomAttributeQuery.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.class
new file mode 100644
index 000000000..f6d4055fe
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.class
new file mode 100644
index 000000000..082d6024f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.class
new file mode 100644
index 000000000..72f9d84a6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDSectorShare.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDSectorShare.class
new file mode 100644
index 000000000..57778783e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/EIDSectorShare.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/QAAAttribute.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/QAAAttribute.class
new file mode 100644
index 000000000..ebe9ed6dd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/QAAAttribute.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttribute.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttribute.class
new file mode 100644
index 000000000..2a485d3b5
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttribute.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttributes.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttributes.class
new file mode 100644
index 000000000..0c2fc75ef
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/RequestedAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLCore.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLCore.class
new file mode 100644
index 000000000..25ac4c69e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLCore.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLEngineSignI.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLEngineSignI.class
new file mode 100644
index 000000000..a6c30d388
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SAMLEngineSignI.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPApplication.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPApplication.class
new file mode 100644
index 000000000..8f8939d20
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPApplication.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPCountry.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPCountry.class
new file mode 100644
index 000000000..00982e2a9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPCountry.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPID.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPID.class
new file mode 100644
index 000000000..3d686cfc2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPID.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInformation.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInformation.class
new file mode 100644
index 000000000..493bdb2de
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInformation.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInstitution.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInstitution.class
new file mode 100644
index 000000000..caf16dc7d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPInstitution.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPSector.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPSector.class
new file mode 100644
index 000000000..bcaef2a96
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/SPSector.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/STORKSAMLCore.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/STORKSAMLCore.class
new file mode 100644
index 000000000..3de661743
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/STORKSAMLCore.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.class
new file mode 100644
index 000000000..8f898214e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.class
new file mode 100644
index 000000000..38f3bc5b6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.class
new file mode 100644
index 000000000..c52b2e7db
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.class
new file mode 100644
index 000000000..8efebb5e6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.class
new file mode 100644
index 000000000..92c532e6e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.class
new file mode 100644
index 000000000..79b677b07
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.class
new file mode 100644
index 000000000..345fa960b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.class
new file mode 100644
index 000000000..8e36a67ac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.class
new file mode 100644
index 000000000..04cb2a479
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.class
new file mode 100644
index 000000000..fa1c1d3da
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.class
new file mode 100644
index 000000000..5e9602ecf
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.class
new file mode 100644
index 000000000..acffd5114
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.class
new file mode 100644
index 000000000..069e677c8
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.class
new file mode 100644
index 000000000..2e95d47c9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.class
new file mode 100644
index 000000000..2861c96fa
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.class
new file mode 100644
index 000000000..4a3efcf63
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.class
new file mode 100644
index 000000000..030b16a43
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.class
new file mode 100644
index 000000000..255c5fdb6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.class
new file mode 100644
index 000000000..01b48443b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.class
new file mode 100644
index 000000000..94d8fc317
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.class
new file mode 100644
index 000000000..f8faa5b80
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.class
new file mode 100644
index 000000000..3cef6c8c0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.class
new file mode 100644
index 000000000..1a270f4e2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.class
new file mode 100644
index 000000000..d13aee589
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.class
new file mode 100644
index 000000000..2e3019255
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.class
new file mode 100644
index 000000000..cac3037cf
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.class
new file mode 100644
index 000000000..dd88db632
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.class
new file mode 100644
index 000000000..7aef0f4fd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.class
new file mode 100644
index 000000000..013cb7e68
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/QAAAttributeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.class
new file mode 100644
index 000000000..9340a804b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.class
new file mode 100644
index 000000000..6e47992f2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.class
new file mode 100644
index 000000000..783031d78
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.class
new file mode 100644
index 000000000..06a34b622
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.class
new file mode 100644
index 000000000..ecb7104f6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.class
new file mode 100644
index 000000000..7ae6d8f45
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.class
new file mode 100644
index 000000000..2c878b0e7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.class
new file mode 100644
index 000000000..cf03e83df
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.class
new file mode 100644
index 000000000..a60f07621
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.class
new file mode 100644
index 000000000..cdf24dffc
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.class
new file mode 100644
index 000000000..ce812be90
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.class
new file mode 100644
index 000000000..ca335f0bf
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPApplicationUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.class
new file mode 100644
index 000000000..2137135e4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.class
new file mode 100644
index 000000000..d8b4e1c3f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.class
new file mode 100644
index 000000000..d1179ef11
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.class
new file mode 100644
index 000000000..79b4fed37
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPCountryUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.class
new file mode 100644
index 000000000..762681c9d
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDImpl.class
new file mode 100644
index 000000000..98285837e
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.class
new file mode 100644
index 000000000..827f8de30
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.class
new file mode 100644
index 000000000..8f5f14fe2
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPIDUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.class
new file mode 100644
index 000000000..c3bd1f9b4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.class
new file mode 100644
index 000000000..9acde181f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.class
new file mode 100644
index 000000000..09863dfee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.class
new file mode 100644
index 000000000..0b6c4d39f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.class
new file mode 100644
index 000000000..05515dd54
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.class
new file mode 100644
index 000000000..0a9807fd0
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.class
new file mode 100644
index 000000000..230330a60
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.class
new file mode 100644
index 000000000..d1897e4fd
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPInstitutionUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.class
new file mode 100644
index 000000000..e498256ae
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.class
new file mode 100644
index 000000000..58d18fe48
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.class
new file mode 100644
index 000000000..097e76b80
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.class
new file mode 100644
index 000000000..99a0c19ee
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SPSectorUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignHW.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignHW.class
new file mode 100644
index 000000000..dc7acbc35
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignHW.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.class
new file mode 100644
index 000000000..96b8cf7c7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignP12.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignP12.class
new file mode 100644
index 000000000..7be1d5f01
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignP12.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignSW.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignSW.class
new file mode 100644
index 000000000..1751aabd4
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/SignSW.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.class
new file mode 100644
index 000000000..5c62d013b
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesBuilder.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.class
new file mode 100644
index 000000000..3749dbffe
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.class
new file mode 100644
index 000000000..be892f684
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesMarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.class
new file mode 100644
index 000000000..850171df3
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.class
new file mode 100644
index 000000000..97bf40b90
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.class
new file mode 100644
index 000000000..b6db104c7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.class
new file mode 100644
index 000000000..2eda7b183
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationCreator.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationCreator.class
new file mode 100644
index 000000000..87d2375ce
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationCreator.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationEngine.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationEngine.class
new file mode 100644
index 000000000..df1854e68
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationEngine.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationReader.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationReader.class
new file mode 100644
index 000000000..0a4bf3830
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationReader.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationSingleton.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationSingleton.class
new file mode 100644
index 000000000..15f565fc9
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/ConfigurationSingleton.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/InstanceEngine.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/InstanceEngine.class
new file mode 100644
index 000000000..10ebf1a10
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/configuration/InstanceEngine.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/SAMLEngineException.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/SAMLEngineException.class
new file mode 100644
index 000000000..1fc62d91c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/SAMLEngineException.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineException.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineException.class
new file mode 100644
index 000000000..7ff0077b6
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineException.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.class b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.class
new file mode 100644
index 000000000..b19b665df
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/classes/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.class
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/maven-archiver/pom.properties b/id/server/legacy-backup/stork2-saml-engine/target/maven-archiver/pom.properties
new file mode 100644
index 000000000..d1dd33256
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/maven-archiver/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Wed Mar 05 21:42:19 CET 2014
+version=1.1.0
+groupId=eu.stork
+artifactId=SamlEngine
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SamlEngine.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SamlEngine.xml
new file mode 100644
index 000000000..563196604
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SamlEngine.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<instances>
+
+
+ <!-- Configuration name-->
+ <instance name="outgoing">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_outgoing.xml" />
+ </configuration>
+
+ <!-- Settings module signature-->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
+ </configuration>
+ </instance>
+
+</instances> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf0.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf0.xml
new file mode 100644
index 000000000..46f29b741
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf0.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=saml-demo-cert,OU=STORK2,O=Advania,L=Reykjavik,ST=Reykjavik,C=IS</entry>
+ <entry key="serialNumber">529E05C8</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf1.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf1.xml
new file mode 100644
index 000000000..fbf1bcdac
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf1.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry1.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf2.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf2.xml
new file mode 100644
index 000000000..7cf336ead
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf2.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry2.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf3.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf3.xml
new file mode 100644
index 000000000..0da5143c1
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_Conf3.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">src/test/resources/keyStoreCountry3.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">529E04FF</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_P11.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_P11.xml
new file mode 100644
index 000000000..96d06a8be
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_P11.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>HWModule sign with interface PKCS11.</comment>
+ <entry key="configurationFile">p11Config.cfg</entry>
+ <entry key="keyPassword">*******</entry>
+ <entry key="issuer">CN=XXXXXXXXX</entry>
+ <entry key="serialNumber">xxxxxxxxxxxxxx</entry>
+ <entry key="keystoreType">PKCS11</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_outgoing.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_outgoing.xml
new file mode 100644
index 000000000..7139c5a41
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/SignModule_outgoing.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo-cert, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf0.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf0.xml
new file mode 100644
index 000000000..f45502c0c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf0.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf1.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf1.xml
new file mode 100644
index 000000000..f45502c0c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf1.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf2.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf2.xml
new file mode 100644
index 000000000..dd3768f4f
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf2.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!--
+ Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf3.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf3.xml
new file mode 100644
index 000000000..5048b28a7
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_Conf3.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!--
+ Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+ <entry key="unknown">http://www.stork.gov.eu/1.0/unknown</entry>
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_outgoing.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_outgoing.xml
new file mode 100644
index 000000000..79c69aedb
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/StorkSamlEngine_outgoing.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!--
+ Types of consent obtained from the user for this authentication and
+ data transfer.
+ Allow values: 'unspecified'.
+ -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!--
+ Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
+ -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS-->
+ <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier
+ Allow values: 'entity'.
+ <entry key="eIDSectorShare">true</entry>
+ <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry>
+ -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country-->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country-->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response-->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions-->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+ <entry key="representative">http://www.stork.gov.eu/1.0/representative</entry>
+ <entry key="represented">http://www.stork.gov.eu/1.0/represented</entry>
+
+</properties> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
new file mode 100644
index 000000000..b318f9183
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest" ID="_939726f0a02072f40b548de378612a50" IssueInstant="2013-10-04T16:57:55.547Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_939726f0a02072f40b548de378612a50"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>BgPDTVCv7BhiWIs6HsC06jaHaag=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>dIC61bGi6Jqp1zSVojpjaVq9WaZcDtNImXgo1Dyze5/hJA07Sy4TaHu+/IuLEC99aLjM6rxh2UUNqpPaQCFlF5eVkVv/c4gHEZVyevhjJKTidqmnuhlI78PGMx2thfxFsHsPcqHqOzy1Z6w18K1ds6APQP+aXI9TNKis+pykn4nJititYuiSseD0VY0F4QnXx+U6k3raoi1CAFE5fe7EuI/KfxuhhQLAbLq90Vm8R94ITBjfSS25mXstXNe9zppTSjDB42ld1TjDovDwXAn5OxiZasIEb5m68sRlxgoQ/2/+ZdYNNINFLAwkCbb8MiCbGASd626Bme0Kx+ropeWdxw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDXjCCAkagAwIBAgIEUk1MbDANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJUzESMBAGA1UE
+CAwJUmV5a2phdmlrMRIwEAYDVQQHDAlSZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNV
+BAsMBlNUT1JLMjEXMBUGA1UEAwwOc2FtbC1kZW1vLWNlcnQwHhcNMTMxMDAzMTA1MzEyWhcNMjMx
+MDAzMTA1MzEyWjBxMQswCQYDVQQGEwJJUzESMBAGA1UECAwJUmV5a2phdmlrMRIwEAYDVQQHDAlS
+ZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNVBAsMBlNUT1JLMjEXMBUGA1UEAwwOc2Ft
+bC1kZW1vLWNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkSgTxZkNRXZTKLB0c
+4oz7/8Dh56FX+0cYg7hjw4e8vn+ITXkxzrmUH57FtsvKln4mq1H0FHXL80u3IiWX8qY+QLgNeKeB
+m85lXuyOb3wWpKAaQvpLAkejGLCx22AN2L0WZkKZV2puwRQVsRHCq6U6vToJXDZ6Ui6ltKsAl/ZS
+8qUFpiIvqD5ea4ohz4JsFE/uApRc7pbJ4VbOmAAeH/tQTayptq2kPb2vvUVk+2cH5J7UD+GCI88E
+e+mS+C33tV9NmWUHL69mYEe8FXjumbKA5e9i1ejn9i0/BLUtHFonHnL9YFMim0foI7NNc5mNg9aw
+vm0PuByVU3kuibQkqGBLAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAA9X5B4NBmVuhjECi+KOnRRX
+5oUV+jbYKhGZODDPi+F4Uo7ZtPFQ6sS3tE54+8AoDl5zQ5q5fDDVXhB42IIIjDxHKo8cBXie5FZ6
+mJtErvWZWYWdO0uV2OQAUALq2LieidqSFDJ+Pjl8w1New8oi3migwyE0jZo4Q97lJGDfJTruV0A2
+JE/Gt6QAAcWhhN2hZl92pYkIi5OeqHXyzBUp5vg8LLfNmeyziCAiXDC1Sy/aQU/cllZ3zFJMrqZM
+s2xBpmB4sF1YRbIrr2OqEVE6M6DUx+pAQOd2uogV3AMT9D5MYpckI1jx/o/Tto7ju74nIVOskDiN
+K0FR8izxcT0HixM=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjorn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
new file mode 100644
index 000000000..29db86a73
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_f6c8fc355b9f125cb5283f038e1b3cdf" IssueInstant="2013-10-03T10:28:15.449Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignatureValue>hhQXDKNrJJ3Yy/pkZNZF4GlWrA/Xsx4CH9chgVa5HK4qZQvFXvZwegdw6U7rm7qv0zmI4xaLTv/bpmqJzEPfY3sIvrDRu9EouEKwtjbMbcvVQsx7I+j0yy7/cBcQJe3lRwQwyvazfYVbnSeGFxBN6WOHPqv6uInaQO/hXkicT3tBtm8o3UgUDY6c8wIMuD5A0hWTkL6z6f893AbdN85OQYAdHItNsQWeLOIeiGC918X7qqTfhFtBAB2oGVjlsSEqWox1jNqrPl1jjA0dP76m5SIVSqF8XcDR306ZB9GLJywOHKba0lxGLsXOAzJ+8u9jeixJ6VZKFqZg2Fhl/saKbg==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjörn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:1.0:cm:sender-vouches"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
new file mode 100644
index 000000000..a912ec57c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:obtained" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_483140d440fc4eef8e949ace49669f2e" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_483140d440fc4eef8e949ace49669f2e"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>yMOVS1T/yRiVh3L6IBM9rR9Ie3w=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>d8e/RyNNPmnHRIzTIuRSnW6B60oWGBGxjRua/HvNxTuod0qSarYJxEedhY9Wl1Z9WYXlry28FuKjp3DA3HhzNaVd7A7QpFqNC4dnizSVWFjxlhmoE/Uv3Y/ha9P/fk6nbtHCSKW4kHSX7QfFLeggcLmUG0IULRF8UmRdQ0WerCl0aSZZeSp8J3LsFBPeWCRSwXgfiLn+RehggzZmQU6g0ssxrpnsYEAtjAiOli+YVQGuumsZGaJ8zHA/DgJ2FTGovNUyfuSUFLhd9nLlSqFs2Avnx0Ck7Q1dxDO5truOm6e285YLHqLaGdetFyPQAj/Z4w4RJ5u5X6d7rhBjTfRAAw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/><saml2p:StatusMessage>urn:oasis:names:tc:SAML:2.0:status:Success</saml2p:StatusMessage></saml2p:Status><saml2:Assertion ID="_9ed05849dee5c154e62fa9e3ba53e9f3" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="http://C-PEPS.gov.xx">urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml2:SubjectConfirmationData Address="111.222.333.444" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" NotOnOrAfter="2013-10-08T09:16:17.255Z"/></saml2:SubjectConfirmation></saml2:Subject><saml2:Conditions NotBefore="2013-10-08T09:11:17.255Z" NotOnOrAfter="2013-10-08T09:16:17.255Z"><saml2:AudienceRestriction><saml2:Audience>http://S-PEPS.gov.xx</saml2:Audience></saml2:AudienceRestriction><saml2:OneTimeUse/></saml2:Conditions><saml2:AuthnStatement AuthnInstant="2013-10-08T09:11:17.255Z"><saml2:SubjectLocality Address="111.222.333.444"/><saml2:AuthnContext><saml2:AuthnContextDecl/></saml2:AuthnContext></saml2:AuthnStatement><saml2:AttributeStatement><saml2:Attribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16/12/2008</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/canonicalResidenceAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:postalCode xsi:type="xs:anyType">105</stork:postalCode><stork:state xsi:type="xs:anyType">IS</stork:state><stork:streetNumber xsi:type="xs:anyType">10</stork:streetNumber><stork:streetName xsi:type="xs:anyType">Gudrunartun</stork:streetName><stork:town xsi:type="xs:anyType">Reykjavik</stork:town></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/newAttribute2" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:value3 xsi:type="xs:anyType">value3</stork:value3><stork:value4 xsi:type="xs:anyType">value4</stork:value4><stork:value1 xsi:type="xs:anyType">value1</stork:value1><stork:value2 xsi:type="xs:anyType">value2</stork:value2></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</saml2:AttributeValue><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">123456789IS</saml2:AttributeValue></saml2:Attribute></saml2:AttributeStatement></saml2:Assertion></saml2p:Response> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
new file mode 100644
index 000000000..f7bac4b61
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://S-PEPS.gov.xx/PEPS/ColleagueResponse" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ForceAuthn="true" ID="_e54eee285e7b8e2772875c406ec39674" IsPassive="false" IssueInstant="2010-06-08T07:37:54.533Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="University of Oxford" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignedInfo>
+<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
+<ds:Reference URI="#_e54eee285e7b8e2772875c406ec39674">
+<ds:Transforms>
+<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml2 saml2p stork storkp xs"/></ds:Transform>
+</ds:Transforms>
+<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+<ds:DigestValue>yzsqaxBNicOrixBUno5cL0CBOpE=</ds:DigestValue>
+</ds:Reference>
+</ds:SignedInfo>
+<ds:SignatureValue>
+Xycll1PF7hh3Xdykpr6nIr8Q6PQ6OxLIBBBugoGpAm/V4Hu7tKakHJp8TgtRWZ30jG5eolOXnJkC
+wiaTVUFaQz7cNn27syRJkdA+eYlz9doiwUJ5eD1cAyddZYsNPpSeAj5UK45oN0qCH+/pI9mRw8Oi
+YIN/BUEtXkoYTjPtkmA=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBmDCCAQECBEuWisIwDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UEAxMIY291bnRyeTEwHhcNMTAw
+MzA5MTc1MjAyWhcNMTAwNjA3MTc1MjAyWjATMREwDwYDVQQDEwhjb3VudHJ5MTCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAnb2gcchwxvJBclcsfCBWJnYefLJYQnDGCQ3RUtYZc26JznnLXclu
+h1XfLJlWgYk/pFKz7B9KfJztal47c6mBfisnxjhdcLqcbXOuRIm7E8TZPzdbHEd60WHPDv20jr+r
+/WkOQs12tKQMbgDX2wtBBcJODLYCDiYa1oQsnyhdOGkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBk
+3luVRc0EqEE1zZeYvRPi5a2yOZfI9H+/rXI1qNLwmICnuJX++ukUbqJHm/FV1iSPM9O9oqzifJ/K
+eKL5EcUugJ76Tu5XO8za2FoJvYr+jIZDsEkCg+OSzcp/eljiWAIh2enZcQ/ON6QxWXeSNJPH0xOq
+KAoZgbUK0Zld3Dsheg==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><stork:spSector>EDU001</stork:spSector><stork:spInstitution>OXF001</stork:spInstitution><stork:spApplication>APP001</stork:spApplication><stork:spCountry>EN</stork:spCountry><storkp:eIDSectorShare>true</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>true</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>true</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">16</stork:AttributeValue><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
new file mode 100644
index 000000000..b61a8cf41
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://locahost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignatureValue>
+S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+Xt8p8tK3EoMocZse2hw=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
new file mode 100644
index 000000000..07ff68d38
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://localhost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+<ds:SignatureValue>
+S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+Xt8p8tK3EoMocZse2hw=
+</ds:SignatureValue>
+<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry0.jks b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry0.jks
new file mode 100644
index 000000000..289e952fe
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry0.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry1.jks b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry1.jks
new file mode 100644
index 000000000..5399bf689
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry1.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry2.jks b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry2.jks
new file mode 100644
index 000000000..5399bf689
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry2.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry3.jks b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry3.jks
new file mode 100644
index 000000000..5399bf689
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/keyStoreCountry3.jks
Binary files differ
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/logback-test.xml b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/logback-test.xml
new file mode 100644
index 000000000..ff900e124
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/logback-test.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Basic configuration used until the IdP can load the real configuration
+ -->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+ </Pattern>
+ </layout>
+ </appender>
+
+ <logger name="eu.stork">
+ <level value="DEBUG" />
+ </logger>
+
+ <root>
+ <appender-ref ref="STDOUT" />
+ <level value="INFO" />
+ </root>
+
+</configuration> \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/p11Conf.cfg b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/p11Conf.cfg
new file mode 100644
index 000000000..bd9f357ce
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/p11Conf.cfg
@@ -0,0 +1,24 @@
+//ATTRIBUTE VALUE
+//name name suffix of this provider instance
+//library pathname of PKCS#11 implementation
+//slotListIndex slot index
+
+//PREFIX DESCRIPTION
+//CKO_ Object class
+//CKA_ Attribute
+//CKK_ Key type
+
+//attributes(operation, keytype, keyalgorithm) = {
+// name1 = value1
+// [...]
+//}
+
+name=nameProvider
+library=library.dll
+slotListIndex=0
+attributes(*,CKO_PUBLIC_KEY,CKK_RSA)={
+ CKA_VERIFY=true
+}
+attributes(*,CKO_PRIVATE_KEY,CKK_RSA)={
+ CKA_SIGN=true
+} \ No newline at end of file
diff --git a/id/server/legacy-backup/stork2-saml-engine/target/test-classes/storkDemoKeys.jks b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/storkDemoKeys.jks
new file mode 100644
index 000000000..efaeac86c
--- /dev/null
+++ b/id/server/legacy-backup/stork2-saml-engine/target/test-classes/storkDemoKeys.jks
Binary files differ
diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml
new file mode 100644
index 000000000..387cfa900
--- /dev/null
+++ b/id/server/moa-id-commons/moa-id-commons.iml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="hibernate" name="Hibernate">
+ <configuration>
+ <datasource-map>
+ <unit-entry name="config:hibernate_moasession.cfg.xml" />
+ <unit-entry name="config:hibernate_statistic.cfg.xml" />
+ <unit-entry name="hibernate_moasession.cfg.xml" />
+ <unit-entry name="hibernate_statistic.cfg.xml" />
+ </datasource-map>
+ <naming-strategy-map />
+ <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/src/main/resources/config/hibernate_moasession.cfg.xml" />
+ <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/src/main/resources/config/hibernate_statistic.cfg.xml" />
+ </configuration>
+ </facet>
+ <facet type="jpa" name="JPA">
+ <configuration>
+ <setting name="validation-enabled" value="true" />
+ <setting name="provider-name" value="" />
+ <datasource-mapping>
+ <factory-entry name="##generated" />
+ </datasource-mapping>
+ <deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/src/main/resources/config/persistence_template.xml" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../target/classes" />
+ <output-test url="file://$MODULE_DIR$/../../target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources/config" type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/xjc" isTestSource="false" generated="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target/apidocs" />
+ <excludeFolder url="file://$MODULE_DIR$/target/classes" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-c3p0:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:maven-hyperjaxb3-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.annox:annox:0.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-tools:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:0.5.6" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-testing:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: xmlunit:xmlunit:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-persistence:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-customizations:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring:2.0.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.org.apache.xml.internal:resolver:20050927" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-project:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-model:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:1.5.15" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.11" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
+ <orderEntry type="library" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-profile:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact-manager:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6" level="project" />
+ <orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-registry:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jfrog.maven.annomojo:maven-plugin-anno:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-xjc:2.2.4-1" level="project" />
+ <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml
index ae79990d0..0ddf06259 100644
--- a/id/server/moa-id-commons/pom.xml
+++ b/id/server/moa-id-commons/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<artifactId>moa-id-commons</artifactId>
<name>moa-id-commons</name>
@@ -63,10 +63,16 @@
<version>0.5.6</version>
</dependency>
<dependency>
- <groupId>org.jvnet.hyperjaxb3</groupId>
- <artifactId>maven-hyperjaxb3-plugin</artifactId>
- <version>0.5.6</version>
-</dependency>
+ <groupId>org.jvnet.hyperjaxb3</groupId>
+ <artifactId>maven-hyperjaxb3-plugin</artifactId>
+ <version>0.5.6</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
index e4e4ce98a..88220cded 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
@@ -22,366 +22,366 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.commons.db;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase;
-
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
+import org.apache.commons.lang.StringEscapeUtils;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
@SuppressWarnings("rawtypes")
public class ConfigurationDBRead {
- private static Map<String, String> QUERIES = new HashMap<String, String>();
- static {
- QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'");
- QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))");
- QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id");
- QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication");
- QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'");
- QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'");
- QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration");
- QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id");
- QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken");
- QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'");
- QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'");
- QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk");
- QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username");
- QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase");
- QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id");
- QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); }
-
- public static OnlineApplication getActiveOnlineApplication(String id) {
- MiscUtil.assertNotNull(id, "OnlineApplictionID");
- Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
-
- List result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID"));
- //query.setParameter("id", id+"%");
- query.setParameter("id", StringEscapeUtils.escapeHtml(id));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.debug("No entries found.");
- return null;
- }
-
- if (result.size() > 1) {
- Logger.warn("OAIdentifier match to more then one DB-entry!");
- return null;
- }
-
- return (OnlineApplication) result.get(0);
- }
-
- public static OnlineApplication getOnlineApplication(String id) {
- MiscUtil.assertNotNull(id, "OnlineApplictionID");
- Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
-
- List result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID"));
- //query.setParameter("id", id+"%");
- query.setParameter("id", id);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
-
- if (result.size() > 1) {
- Logger.warn("OAIdentifier match to more then one DB-entry!");
- return null;
- }
-
- return (OnlineApplication) result.get(0);
- }
-
- public static OnlineApplication getOnlineApplication(long dbid) {
- MiscUtil.assertNotNull(dbid, "OnlineApplictionID");
- Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database.");
-
- List result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID"));
- //query.setParameter("id", id+"%");
- query.setParameter("id", dbid);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
-
- return (OnlineApplication) result.get(0);
- }
-
- public static MOAIDConfiguration getMOAIDConfiguration() {
- Logger.trace("Load MOAID Configuration from database.");
-
- List<MOAIDConfiguration> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
-
- return (MOAIDConfiguration) result.get(0);
- }
-
- public static List<OnlineApplication> getAllOnlineApplications() {
- Logger.trace("Get All OnlineApplications from database.");
-
- List<OnlineApplication> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
-
- public static List<OnlineApplication> getAllNewOnlineApplications() {
- Logger.trace("Get All OnlineApplications from database.");
-
- List<OnlineApplication> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
-
- public static List<UserDatabase> getAllUsers() {
- Logger.trace("Get All OnlineApplications from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
-
- public static List<OnlineApplication> getAllActiveOnlineApplications() {
- Logger.trace("Get All active OnlineApplications from database.");
-
- List<OnlineApplication> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
-
- @SuppressWarnings("rawtypes")
- public static List<OnlineApplication> searchOnlineApplications(String id) {
- MiscUtil.assertNotNull(id, "OnlineApplictionID");
- Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
-
- List<OnlineApplication> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID"));
- query.setParameter("id", "%"+id+"%");
-
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
-
- return result;
- }
-
- public static UserDatabase getUserWithID(long id) {
- MiscUtil.assertNotNull(id, "UserID");
- Logger.trace("Getting Userinformation with ID " + id + " from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID"));
- query.setParameter("id", id);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return (UserDatabase) result.get(0);
- }
-
- public static UserDatabase getUsersWithOADBID(long id) {
- MiscUtil.assertNotNull(id, "OADBID");
- Logger.trace("Getting Userinformation with OADBID " + id + " from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID"));
- query.setParameter("id", id);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return (UserDatabase) result.get(0);
- }
-
- public static UserDatabase getUserWithUserName(String username) {
- MiscUtil.assertNotNull(username, "UserName");
- Logger.trace("Getting Userinformation with ID " + username + " from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername"));
- query.setParameter("username", username);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return (UserDatabase) result.get(0);
- }
-
- public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) {
- MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk");
- Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK"));
- query.setParameter("bpk", bpkwbpk);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return (UserDatabase) result.get(0);
- }
-
- public static UserDatabase getNewUserWithTokken(String tokken) {
- MiscUtil.assertNotNull(tokken, "bpk/wbpk");
- Logger.trace("Getting Userinformation with Tokken " + tokken + " from database.");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken"));
- query.setParameter("tokken", tokken);
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return (UserDatabase) result.get(0);
- }
-
- public static List<UserDatabase> getAllNewUsers() {
- Logger.trace("Get all new Users from Database");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
-
- public static List<UserDatabase> getAllOpenUsersRequests() {
- Logger.trace("Get all new Users from Database");
-
- List<UserDatabase> result;
- EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
- javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests"));
- result = query.getResultList();
-
- Logger.trace("Found entries: " + result.size());
-
- if (result.size() == 0) {
- Logger.trace("No entries found.");
- return null;
- }
- return result;
- }
+ private static Map<String, String> QUERIES = new HashMap<String, String>();
+
+ static {
+ QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'");
+ QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))");
+ QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id");
+ QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication");
+ QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'");
+ QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'");
+ QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration");
+ QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id");
+ QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken");
+ QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'");
+ QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'");
+ QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk");
+ QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username");
+ QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase");
+ QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id");
+ QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id");
+ }
+
+ public static OnlineApplication getActiveOnlineApplication(String id) {
+ MiscUtil.assertNotNull(id, "OnlineApplictionID");
+ Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
+
+ List result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID"));
+ //query.setParameter("id", id+"%");
+ query.setParameter("id", StringEscapeUtils.escapeHtml(id));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.debug("No entries found.");
+ return null;
+ }
+
+ if (result.size() > 1) {
+ Logger.warn("OAIdentifier match to more then one DB-entry!");
+ return null;
+ }
+
+ return (OnlineApplication) result.get(0);
+ }
+
+ public static OnlineApplication getOnlineApplication(String id) {
+ MiscUtil.assertNotNull(id, "OnlineApplictionID");
+ Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
+
+ List result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID"));
+ //query.setParameter("id", id+"%");
+ query.setParameter("id", id);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+
+ if (result.size() > 1) {
+ Logger.warn("OAIdentifier match to more then one DB-entry!");
+ return null;
+ }
+
+ return (OnlineApplication) result.get(0);
+ }
+
+ public static OnlineApplication getOnlineApplication(long dbid) {
+ MiscUtil.assertNotNull(dbid, "OnlineApplictionID");
+ Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database.");
+
+ List result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID"));
+ //query.setParameter("id", id+"%");
+ query.setParameter("id", dbid);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+
+ return (OnlineApplication) result.get(0);
+ }
+
+ public static MOAIDConfiguration getMOAIDConfiguration() {
+ Logger.trace("Load MOAID Configuration from database.");
+
+ List<MOAIDConfiguration> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+
+ return (MOAIDConfiguration) result.get(0);
+ }
+
+ public static List<OnlineApplication> getAllOnlineApplications() {
+ Logger.trace("Get All OnlineApplications from database.");
+
+ List<OnlineApplication> result = null;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
+
+ public static List<OnlineApplication> getAllNewOnlineApplications() {
+ Logger.trace("Get All OnlineApplications from database.");
+
+ List<OnlineApplication> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
+
+ public static List<UserDatabase> getAllUsers() {
+ Logger.trace("Get All OnlineApplications from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
+
+ public static List<OnlineApplication> getAllActiveOnlineApplications() {
+ Logger.trace("Get All active OnlineApplications from database.");
+
+ List<OnlineApplication> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static List<OnlineApplication> searchOnlineApplications(String id) {
+ MiscUtil.assertNotNull(id, "OnlineApplictionID");
+ Logger.trace("Getting OnlineApplication with ID " + id + " from database.");
+
+ List<OnlineApplication> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID"));
+ query.setParameter("id", "%" + id + "%");
+
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+
+ return result;
+ }
+
+ public static UserDatabase getUserWithID(long id) {
+ MiscUtil.assertNotNull(id, "UserID");
+ Logger.trace("Getting Userinformation with ID " + id + " from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID"));
+ query.setParameter("id", id);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return (UserDatabase) result.get(0);
+ }
+
+ public static UserDatabase getUsersWithOADBID(long id) {
+ MiscUtil.assertNotNull(id, "OADBID");
+ Logger.trace("Getting Userinformation with OADBID " + id + " from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID"));
+ query.setParameter("id", id);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return (UserDatabase) result.get(0);
+ }
+
+ public static UserDatabase getUserWithUserName(String username) {
+ MiscUtil.assertNotNull(username, "UserName");
+ Logger.trace("Getting Userinformation with ID " + username + " from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername"));
+ query.setParameter("username", username);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return (UserDatabase) result.get(0);
+ }
+
+ public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) {
+ MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk");
+ Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK"));
+ query.setParameter("bpk", bpkwbpk);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return (UserDatabase) result.get(0);
+ }
+
+ public static UserDatabase getNewUserWithTokken(String tokken) {
+ MiscUtil.assertNotNull(tokken, "bpk/wbpk");
+ Logger.trace("Getting Userinformation with Tokken " + tokken + " from database.");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken"));
+ query.setParameter("tokken", tokken);
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return (UserDatabase) result.get(0);
+ }
+
+ public static List<UserDatabase> getAllNewUsers() {
+ Logger.trace("Get all new Users from Database");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
+
+ public static List<UserDatabase> getAllOpenUsersRequests() {
+ Logger.trace("Get all new Users from Database");
+
+ List<UserDatabase> result;
+ EntityManager session = ConfigurationDBUtils.getCurrentSession();
+
+ javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests"));
+ result = query.getResultList();
+
+ Logger.trace("Found entries: " + result.size());
+
+ if (result.size() == 0) {
+ Logger.trace("No entries found.");
+ return null;
+ }
+ return result;
+ }
}
diff --git a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
index 6269e2dbc..f2701bec4 100644
--- a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
+++ b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb
@@ -1,10 +1,14 @@
<jaxb:bindings version="1.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
<jaxb:bindings schemaLocation="moaid_config_2.0.xsd" node="/xsd:schema">
<jaxb:globalBindings localScoping="toplevel">
<jaxb:serializable/>
+ <xjc:javaType name="java.lang.Boolean"
+ xmlType="xsd:boolean"
+ adapter="com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter"/>
</jaxb:globalBindings>
</jaxb:bindings>
</jaxb:bindings> \ No newline at end of file
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 e6705dbb8..af827210f 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
@@ -11,6 +11,7 @@
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="businessService"/>
<xsd:enumeration value="publicService"/>
+ <xsd:enumeration value="storkService"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
@@ -18,6 +19,7 @@
<xsd:attribute name="friendlyName" type="xsd:string" use="optional"/>
<xsd:attribute name="target" type="xsd:string" use="optional"/>
<xsd:attribute name="targetFriendlyName" type="xsd:string" use="optional"/>
+ <xsd:attribute name="storkSPTargetCountry" type="xsd:string" use="optional"/>
<xsd:attribute name="removeBPKFromAuthBlock" type="xsd:boolean" use="optional" default="false"/>
</xsd:extension>
</xsd:complexContent>
@@ -49,7 +51,7 @@
<xsd:extension base="xsd:string"/>
</xsd:simpleContent>
</xsd:complexType>
- <xsd:element name="AbstractSimpleIdentification" type="StorkAttribute">
+ <xsd:element name="AbstractSimpleIdentification" type="AttributeProviderPlugin">
<xsd:annotation>
<xsd:documentation>possibility to include common austrian primary
keys in human readable way, english translation not available
@@ -507,6 +509,7 @@
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Profiles" type="xsd:string"/>
+ <xsd:element name="ProfileName" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -881,9 +884,12 @@
<xsd:element name="OA_STORK">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="StorkLogonEnabled" type="xsd:boolean"/>
+ <xsd:element name="StorkLogonEnabled" type="xsd:boolean" default="true"/>
<xsd:element ref="Qaa" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="OAAttributes" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="VidpEnabled" type="xsd:boolean" default="false"/>
+ <xsd:element ref="AttributeProviders" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="requireConsent" type="xsd:boolean" default="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -950,6 +956,14 @@
<xsd:element name="OnlyMandateLoginAllowed" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="AttributeProviderPlugin">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="url" type="xsd:anyURI"/>
+ <xsd:element name="attributes" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="AttributeProviders" type="AttributeProviderPlugin"/>
<xsd:element name="Attributes" type="StorkAttribute"/>
<xsd:element name="Qaa" type="QualityAuthenticationAssuranceLevelType"/>
<xsd:complexType name="OAStorkAttribute">
diff --git a/id/server/moa-id.iml b/id/server/moa-id.iml
new file mode 100644
index 000000000..6e02e5944
--- /dev/null
+++ b/id/server/moa-id.iml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/pom.xml b/id/server/pom.xml
index 056accdad..53f4193a6 100644
--- a/id/server/pom.xml
+++ b/id/server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>MOA</groupId>
<artifactId>id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -19,6 +19,7 @@
<module>auth</module>
<module>moa-id-commons</module>
<module>stork2-saml-engine</module>
+ <!-- <module>stork2-commons</module> -->
</modules>
<properties>
diff --git a/id/server/proxy/moa-id-proxy.iml b/id/server/proxy/moa-id-proxy.iml
new file mode 100644
index 000000000..a1bb63801
--- /dev/null
+++ b/id/server/proxy/moa-id-proxy.iml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.6" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ <orderEntry type="module" module-name="moa-id-lib" />
+ <orderEntry type="library" name="Maven: eu.stork:oasis-dss-api:1.0.0-RELEASE" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
+ <orderEntry type="module" module-name="moa-id-commons" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.0.GA" level="project" />
+ <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.javassist:javassist:3.15.0-GA" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-c3p0:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1" level="project" />
+ <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:maven-hyperjaxb3-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-plugin:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.annox:annox:0.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-annotate:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-tools:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.7.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2_commons:jaxb2-basics-testing:0.6.2" level="project" />
+ <orderEntry type="library" name="Maven: xmlunit:xmlunit:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-persistence:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.hyperjaxb3:hyperjaxb3-ejb-schemas-customizations:0.5.6" level="project" />
+ <orderEntry type="library" name="Maven: org.springframework:spring:2.0.7" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.org.apache.xml.internal:resolver:20050927" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-api:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-project:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-settings:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-model:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-utils:1.5.15" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-interpolation:1.11" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
+ <orderEntry type="library" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-profile:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact-manager:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-repository-metadata:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-artifact:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven.wagon:wagon-provider-api:1.0-beta-6" level="project" />
+ <orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.maven:maven-plugin-registry:2.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jfrog.maven.annomojo:maven-plugin-anno:1.3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.8.0" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-xjc:2.2.4-1" level="project" />
+ <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
+ <orderEntry type="module" module-name="Commons" />
+ <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.6.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:openws:1.5.0" level="project" />
+ <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.4.0" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.46" level="project" />
+ <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
+ <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
+ <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.5.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xml-apis:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:xercesImpl:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xerces:serializer:2.10.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+ <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
+ <orderEntry type="module" module-name="SamlEngine" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-tools:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:webservices-rt:2.0.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3" level="project" />
+ <orderEntry type="library" name="Maven: dav4j:dav4j:0.1" level="project" />
+ <orderEntry type="library" name="Maven: httpsclient:httpsclient:JSSE-1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_X509TrustManager:0.3" level="project" />
+ <orderEntry type="library" name="Maven: regexp:regexp:1.3" level="project" />
+ <orderEntry type="library" name="Maven: com.googlecode.jsontoken:jsontoken:1.0" level="project" />
+ <orderEntry type="library" name="Maven: com.google.code.gson:gson:1.4" level="project" />
+ <orderEntry type="library" name="Maven: com.google.collections:google-collections:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
+ </component>
+</module>
+
diff --git a/id/server/proxy/pom.xml b/id/server/proxy/pom.xml
index e5c78ff60..3d4d8c74d 100644
--- a/id/server/proxy/pom.xml
+++ b/id/server/proxy/pom.xml
@@ -2,7 +2,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
</parent>
<properties>
@@ -20,6 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>MOA.id.server</groupId>
<artifactId>moa-id-proxy</artifactId>
+ <version>2.0.0</version>
<packaging>war</packaging>
<name>MOA ID-Proxy WebService</name>
diff --git a/id/server/stork2-commons/.svn/all-wcprops b/id/server/stork2-commons/.svn/all-wcprops
new file mode 100644
index 000000000..013d868be
--- /dev/null
+++ b/id/server/stork2-commons/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons
+END
+pom.xml
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/pom.xml
+END
+Releases
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/Releases
+END
diff --git a/id/server/stork2-commons/.svn/dir-prop-base b/id/server/stork2-commons/.svn/dir-prop-base
new file mode 100644
index 000000000..9dc541cfd
--- /dev/null
+++ b/id/server/stork2-commons/.svn/dir-prop-base
@@ -0,0 +1,10 @@
+K 10
+svn:ignore
+V 44
+.classpath
+.project
+.settings
+report
+target
+
+END
diff --git a/id/server/stork2-commons/.svn/entries b/id/server/stork2-commons/.svn/entries
new file mode 100644
index 000000000..6956e0c9c
--- /dev/null
+++ b/id/server/stork2-commons/.svn/entries
@@ -0,0 +1,99 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+Releases
+file
+
+
+
+
+2014-03-05T09:36:08.094515Z
+5013e8d011c7d67a3faac86ae0ec7aae
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2653
+
+src
+dir
+
+pom.xml
+file
+
+
+
+
+2014-03-05T09:36:08.086515Z
+c245a61144c036e0dc82e0adfed566aa
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5777
+
diff --git a/id/server/stork2-commons/.svn/text-base/Releases.svn-base b/id/server/stork2-commons/.svn/text-base/Releases.svn-base
new file mode 100644
index 000000000..6550affd0
--- /dev/null
+++ b/id/server/stork2-commons/.svn/text-base/Releases.svn-base
@@ -0,0 +1,73 @@
+Created 06-04-2011
+
+Branch : STORKCommons_0_5_UPDATE_06042011
+Date : 06-04-2011
+Changes: No changes.
+
+Branch : STORKCommons_0_5_UPDATE_07072011
+Date : 07-07-2011
+Changes: Inserted constants to HttpOnly HTTP Header.
+
+Branch : STORKCommons_0_6
+Date : 07-11-2011
+Changes: Improved error exception handling (few changes on the exception classes).
+ Improved Constansts (unused removed, others added).
+ Unit Tests include (almost all the code is cover).
+ Fix some minor bugs found on unit tests.
+ New Copyright License added.
+ PEPUtils refactored.
+ Improved error code message (three kind of messages: to citizen, admin and saml token).
+
+Branch : STORKCommons_0_6_1
+Date : 28-11-2011
+Changes: Removed unnecessary javadoc package file.
+ Updated pepsUtils.properties file (check attribute value had old error message)
+
+Branch : STORKCommons_0_9
+Date : 02-12-2011
+Changes: Updated Version to 0.9
+
+Branch : STORKCommons_1_0
+Date : 02-12-2011
+Changes: Updated Version to 1.0
+
+Branch : STORKCommons_1_1_0
+Date : 01-11-2013
+Changes: Updated Version to 1.1.0
+ Dependencies updated
+ Business Logic Part I changes
+ SAML Engine Changes merged (from SamlEngine/1.1.0/Commons branch to be easier to merge this branch with trunk)
+ Fixed some errors on Test Case
+
+Branch : STORKCommons_1_1_1
+Date : 02-12-2013
+Changes: Updated Version to 1.1.1
+ Added mandate error code
+ PMD quality code changes (some final identifier missing)
+ Added new methods to personal attribute list to get Mandatory/Optional and/or Simple/Complex attributes
+ Added new unit tests
+
+Branch : Commons_1_1_2
+Date : 13-12-2013
+Changes: Updated Version to 1.1.2
+ Added request flow of PV (incomplete)
+ Added AP mandatory attribute to get data for business attributes
+ *) based on configuration file it adds the missing attributes (eIdentifier, givenName, surname and dateOfBirth) or change isRequired to true.
+ changes original isRequired state in response
+ Added new Interface (IAttributeListProcessor) to make some operations on attribute lists
+
+Branch : Commons_1_1_3
+Date : 21-12-2013
+Changes: Updated Version to 1.1.3
+ Power Validation is complete now
+ Business Logic I and II integration (Request Complete!)
+
+Branch : Commons_1_1_4
+Date : 08-01-2014
+Changes: Updated Version to 1.1.4
+ Added new method to Personal attribute List to check if there is at least one attribute with no value.
+
+Branch : Commons_1_4_0
+Date : 28-02-2014
+Changes: Updated Version to 1.4.0
+ Removed AUB \ No newline at end of file
diff --git a/id/server/stork2-commons/.svn/text-base/pom.xml.svn-base b/id/server/stork2-commons/.svn/text-base/pom.xml.svn-base
new file mode 100644
index 000000000..04b35f5f5
--- /dev/null
+++ b/id/server/stork2-commons/.svn/text-base/pom.xml.svn-base
@@ -0,0 +1,213 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eu.stork</groupId>
+ <artifactId>Commons</artifactId>
+ <packaging>jar</packaging>
+ <name>Stork Commons</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <stork.version>1.4.0</stork.version>
+ <opensaml.version>2.6.0</opensaml.version>
+ </properties>
+ <version>${stork.version}</version>
+ <description>
+ The STORKCommons library provides beans, Java Interfaces and utility classes to integrate PEPS and SAML Engine.
+ </description>
+
+ <dependencies>
+
+ <!-- Joda -->
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.3</version>
+ </dependency>
+
+ <!-- Log4J -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jdmk</groupId>
+ <artifactId>jmxtools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>mail</artifactId>
+ <groupId>javax.mail</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>${opensaml.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Bouncy Castle -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ <version>1.46</version>
+ </dependency>
+
+ <!-- Servlet API -->
+ <!-- provided by Application Server -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>commons</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <runOrder>reversealphabetical</runOrder>
+ <skip>false</skip>
+ <includes>
+ <runOrder>reversealphabetical</runOrder>
+ <include>**/PEPSUtilTest.java</include>
+ <include>**/PersonalAttributeTestCase.java</include>
+ <include>**/PersonalAttributeListTestCase.java</include>
+ <include>**/DateUtilTestCase.java</include>
+ <include>**/AttributeUtilTest.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <configuration>
+ <links>
+ <link>http://commons.apache.org/lang/api/</link>
+ <link>http://java.sun.com/j2se/1.6.0/docs/api/</link>
+ <link>http://www.bouncycastle.org/docs/docs1.6/</link>
+ <link>http://docs.oracle.com/javase/6/docs/api/</link>
+ </links>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>log4j.xml</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+ <profiles>
+ <profile>
+ <id>embedded</id>
+ <build>
+ <resources>
+ <resource>
+ <directory> ${project.basedir}/src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory> ${project.basedir}/src/main/config/embedded</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ <profile>
+ <id>metrics</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/id/server/stork2-commons/Releases b/id/server/stork2-commons/Releases
new file mode 100644
index 000000000..6550affd0
--- /dev/null
+++ b/id/server/stork2-commons/Releases
@@ -0,0 +1,73 @@
+Created 06-04-2011
+
+Branch : STORKCommons_0_5_UPDATE_06042011
+Date : 06-04-2011
+Changes: No changes.
+
+Branch : STORKCommons_0_5_UPDATE_07072011
+Date : 07-07-2011
+Changes: Inserted constants to HttpOnly HTTP Header.
+
+Branch : STORKCommons_0_6
+Date : 07-11-2011
+Changes: Improved error exception handling (few changes on the exception classes).
+ Improved Constansts (unused removed, others added).
+ Unit Tests include (almost all the code is cover).
+ Fix some minor bugs found on unit tests.
+ New Copyright License added.
+ PEPUtils refactored.
+ Improved error code message (three kind of messages: to citizen, admin and saml token).
+
+Branch : STORKCommons_0_6_1
+Date : 28-11-2011
+Changes: Removed unnecessary javadoc package file.
+ Updated pepsUtils.properties file (check attribute value had old error message)
+
+Branch : STORKCommons_0_9
+Date : 02-12-2011
+Changes: Updated Version to 0.9
+
+Branch : STORKCommons_1_0
+Date : 02-12-2011
+Changes: Updated Version to 1.0
+
+Branch : STORKCommons_1_1_0
+Date : 01-11-2013
+Changes: Updated Version to 1.1.0
+ Dependencies updated
+ Business Logic Part I changes
+ SAML Engine Changes merged (from SamlEngine/1.1.0/Commons branch to be easier to merge this branch with trunk)
+ Fixed some errors on Test Case
+
+Branch : STORKCommons_1_1_1
+Date : 02-12-2013
+Changes: Updated Version to 1.1.1
+ Added mandate error code
+ PMD quality code changes (some final identifier missing)
+ Added new methods to personal attribute list to get Mandatory/Optional and/or Simple/Complex attributes
+ Added new unit tests
+
+Branch : Commons_1_1_2
+Date : 13-12-2013
+Changes: Updated Version to 1.1.2
+ Added request flow of PV (incomplete)
+ Added AP mandatory attribute to get data for business attributes
+ *) based on configuration file it adds the missing attributes (eIdentifier, givenName, surname and dateOfBirth) or change isRequired to true.
+ changes original isRequired state in response
+ Added new Interface (IAttributeListProcessor) to make some operations on attribute lists
+
+Branch : Commons_1_1_3
+Date : 21-12-2013
+Changes: Updated Version to 1.1.3
+ Power Validation is complete now
+ Business Logic I and II integration (Request Complete!)
+
+Branch : Commons_1_1_4
+Date : 08-01-2014
+Changes: Updated Version to 1.1.4
+ Added new method to Personal attribute List to check if there is at least one attribute with no value.
+
+Branch : Commons_1_4_0
+Date : 28-02-2014
+Changes: Updated Version to 1.4.0
+ Removed AUB \ No newline at end of file
diff --git a/id/server/stork2-commons/pom.xml b/id/server/stork2-commons/pom.xml
new file mode 100644
index 000000000..04b35f5f5
--- /dev/null
+++ b/id/server/stork2-commons/pom.xml
@@ -0,0 +1,213 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>eu.stork</groupId>
+ <artifactId>Commons</artifactId>
+ <packaging>jar</packaging>
+ <name>Stork Commons</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <stork.version>1.4.0</stork.version>
+ <opensaml.version>2.6.0</opensaml.version>
+ </properties>
+ <version>${stork.version}</version>
+ <description>
+ The STORKCommons library provides beans, Java Interfaces and utility classes to integrate PEPS and SAML Engine.
+ </description>
+
+ <dependencies>
+
+ <!-- Joda -->
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.3</version>
+ </dependency>
+
+ <!-- Log4J -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jdmk</groupId>
+ <artifactId>jmxtools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>mail</artifactId>
+ <groupId>javax.mail</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>${opensaml.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Bouncy Castle -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ <version>1.46</version>
+ </dependency>
+
+ <!-- Servlet API -->
+ <!-- provided by Application Server -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>commons</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <runOrder>reversealphabetical</runOrder>
+ <skip>false</skip>
+ <includes>
+ <runOrder>reversealphabetical</runOrder>
+ <include>**/PEPSUtilTest.java</include>
+ <include>**/PersonalAttributeTestCase.java</include>
+ <include>**/PersonalAttributeListTestCase.java</include>
+ <include>**/DateUtilTestCase.java</include>
+ <include>**/AttributeUtilTest.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <configuration>
+ <links>
+ <link>http://commons.apache.org/lang/api/</link>
+ <link>http://java.sun.com/j2se/1.6.0/docs/api/</link>
+ <link>http://www.bouncycastle.org/docs/docs1.6/</link>
+ <link>http://docs.oracle.com/javase/6/docs/api/</link>
+ </links>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>log4j.xml</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+ <profiles>
+ <profile>
+ <id>embedded</id>
+ <build>
+ <resources>
+ <resource>
+ <directory> ${project.basedir}/src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory> ${project.basedir}/src/main/config/embedded</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ <profile>
+ <id>metrics</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/id/server/stork2-commons/src/.svn/all-wcprops b/id/server/stork2-commons/src/.svn/all-wcprops
new file mode 100644
index 000000000..b2a57db4c
--- /dev/null
+++ b/id/server/stork2-commons/src/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src
+END
diff --git a/id/server/stork2-commons/src/.svn/entries b/id/server/stork2-commons/src/.svn/entries
new file mode 100644
index 000000000..35f74102a
--- /dev/null
+++ b/id/server/stork2-commons/src/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+test
+dir
+
+main
+dir
+
diff --git a/id/server/stork2-commons/src/main/.svn/all-wcprops b/id/server/stork2-commons/src/main/.svn/all-wcprops
new file mode 100644
index 000000000..ca1ee03bd
--- /dev/null
+++ b/id/server/stork2-commons/src/main/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main
+END
diff --git a/id/server/stork2-commons/src/main/.svn/entries b/id/server/stork2-commons/src/main/.svn/entries
new file mode 100644
index 000000000..76ff91c7b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/.svn/entries
@@ -0,0 +1,37 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+resources
+dir
+
+java
+dir
+
+config
+dir
+
diff --git a/id/server/stork2-commons/src/main/config/.svn/all-wcprops b/id/server/stork2-commons/src/main/config/.svn/all-wcprops
new file mode 100644
index 000000000..e39a1da21
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/config
+END
diff --git a/id/server/stork2-commons/src/main/config/.svn/entries b/id/server/stork2-commons/src/main/config/.svn/entries
new file mode 100644
index 000000000..9a3950062
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/config
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+embedded
+dir
+
diff --git a/id/server/stork2-commons/src/main/config/embedded/.svn/all-wcprops b/id/server/stork2-commons/src/main/config/embedded/.svn/all-wcprops
new file mode 100644
index 000000000..61c832a4b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/embedded/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/config/embedded
+END
+pepsUtil.properties
+K 25
+svn:wc:ra_dav:version-url
+V 90
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/config/embedded/pepsUtil.properties
+END
diff --git a/id/server/stork2-commons/src/main/config/embedded/.svn/entries b/id/server/stork2-commons/src/main/config/embedded/.svn/entries
new file mode 100644
index 000000000..3dcc1bccf
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/embedded/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/config/embedded
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+pepsUtil.properties
+file
+
+
+
+
+2014-03-05T09:36:08.010515Z
+2d984e7eb1a7f6c6ba7048f46b85920b
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7885
+
diff --git a/id/server/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base b/id/server/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base
new file mode 100644
index 000000000..ae811dda7
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/embedded/.svn/text-base/pepsUtil.properties.svn-base
@@ -0,0 +1,269 @@
+#Max allowed params size
+validation.active=true
+max.spUrl.size=150
+max.attrList.size=20000
+max.invalidAttributeList.size=20000
+max.attrName.size=100
+max.callback.size=300
+max.idp.url.size=300
+max.atp.url.size=300
+max.cpepsURL.size=300
+max.attrValue.size=20000
+max.attrType.size=25
+max.spId.size=40
+max.providerName.size=128
+max.spName.size=25
+max.country.size=150
+max.qaaLevel.size=1
+max.spQaaLevel.size=1
+max.errorCode.size=5
+max.errorMessage.size=300
+max.username.size=30
+max.spepsRedirectUrl.size=300
+max.speps.redirectUrl.size=300
+max.cpeps.redirectUrl.size=300
+max.cpepsRedirectUrl.size=300
+max.spepsAssertionUrl.size=300
+max.SAMLRequest.size=131072
+max.SAMLResponse.size=131072
+max.RelayState.size=80
+max.remoteAddr.size=300
+max.remoteHost.size=300
+max.localAddr.size=300
+max.localName.size=300
+max.apepsUrl.size=300
+max.apeps.callbackUrl.size=300
+
+dtl.url=http://localhost:8080/DocumentService/DocumentService
+
+#ERROR codes/messages (accordingly to specification)
+
+#CountrySelector Interface errors
+spCountrySelector.invalidSPQAA.code=0000001
+spCountrySelector.invalidSPQAA.message=invalid.spQAA.parameter
+
+spCountrySelector.invalidQaaSPid.code=0000001
+spCountrySelector.invalidQaaSPid.message=invalid.spQAAId.parameter
+
+spCountrySelector.invalidSpId.code=000002
+spCountrySelector.invalidSpId.message=invalid.spId.parameter
+
+spCountrySelector.invalidSpURL.code=000003
+spCountrySelector.invalidSpURL.message=invalid.spUrl.parameter
+
+domain.CountrySelectorAction.code=000003
+domain.CountrySelectorAction.message=invalid.cs.domain
+
+requests.CountrySelectorAction.code=000004
+requests.CountrySelectorAction.message=reached.max.requests.cs
+
+spCountrySelector.spNotAllowed.code=000006
+spCountrySelector.spNotAllowed.message=attr.access.deny
+
+spCountrySelector.invalidAttr.code=000007
+spCountrySelector.invalidAttr.message=invalid.spAttr.parameter
+
+spCountrySelector.invalidProviderName.code=000008
+spCountrySelector.invalidProviderName.message=invalid.spProvidername.parameter
+
+spCountrySelector.errorCreatingSAML.code=203001
+spCountrySelector.errorCreatingSAML.message=error.create.sp.saml
+
+spepsSAMLRequest.code=203001
+spepsSAMLRequest.message=error.create.saml.speps
+
+#ServiceProvider Interface errors
+sProviderAction.invalidSPQAA.code=200001
+sProviderAction.invalidSPQAA.message=invalid.sp.qaa
+
+sProviderAction.invalidSPQAAId.code=200001
+sProviderAction.invalidSPQAAId.message=invalid.sp.qaaid
+
+sProviderAction.invalidSPId.code=200002
+sProviderAction.invalidSPId.message=invalid.sp.id
+
+domain.ServiceProviderAction.code=200003
+domain.ServiceProviderAction.message=invalid.sp.domain
+
+sProviderAction.invalidSPDomain.code=200003
+sProviderAction.invalidSPDomain.message=invalid.sp.domain
+
+sProviderAction.invalidCountry.code=200004
+sProviderAction.invalidCountry.message=invalid.sp.country
+
+sProviderAction.spNotAllowed.code=200005
+sProviderAction.spNotAllowed.message=sp.not.allowed
+
+sProviderAction.invalidSaml.code=200006
+sProviderAction.invalidSaml.message=invalid.sp.samlrequest
+
+sProviderAction.invalidSPProviderName.code=200007
+sProviderAction.invalidSPProviderName.message=sp.not.identified
+
+sProviderAction.invalidSPRedirect.code=200008
+sProviderAction.invalidSPRedirect.message=invalid.sp.redirectUrl
+
+sProviderAction.invalidRelayState.code=200009
+sProviderAction.invalidRelayState.message=invalid.sp.relaystate
+
+sProviderAction.invalidAttr.code=200011
+sProviderAction.invalidAttr.message=invalid.sp.attr
+
+requests.ServiceProviderAction.code=200012
+requests.ServiceProviderAction.message=reached.max.requests.sp
+
+sPPowerValidationAction.invalidSPPVAttrList.code=200013
+sPPowerValidationAction.invalidSPPVAttrList.message=invalid.sp.pv.attrlist
+
+invalid.sp.pv.attrlist.code=200013
+invalid.sp.pv.attrlist.message=invalid.sp.pv.attrlist
+
+sProviderAction.invalidSPAlias.code=203003
+sProviderAction.invalidSPAlias.message=invalid.sp.alias
+
+sProviderAction.errorCreatingSAML.code=203001
+sProviderAction.errorCreatingSAML.message=error.create.saml.speps
+
+#Internal Error
+internalError.code=203001
+internalError.message=internalError
+
+attrList.code=202005
+attrList.message=invalid.attrList.parameter
+
+missing.sessionId.code=203010
+missing.sessionId.message=missing.session.id
+
+sessionError.code=203011
+sessionError.message=invalid.session.id
+
+invalid.sessionId.code=203011
+invalid.sessionId.message=invalid.session.id
+
+missing.mandate.code=203013
+missing.mandate.message=missing.mandate
+
+invalid.session.code=203012
+invalid.session.message=invalid.session
+
+callback.code=203006
+callback.message=invalid.callback.url
+
+idp.url.code=203006
+idp.url.message=invalid.idp.url
+
+IdPSAMLResponse.code=002001
+IdPSAMLResponse.message=invalid.idp.response
+
+authenticationFailed.code=003002
+authenticationFailed.message=authentication.failed
+
+username.code=003002
+username.message=authentication.failed
+
+invalidAttributeList.code=203001
+invalidAttributeList.message=invalid.attrlist
+
+invalidAttributeValue.code=203001
+invalidAttributeValue.message=invalid.attr.value
+
+attVerification.mandatory.code=202010
+attVerification.mandatory.message=missing.mandatory.attr
+
+attrValue.verification.code=203008
+attrValue.verification.message=invalid.stork.attrValue
+
+cpepsSAMLResponse.code=202012
+cpepsSAMLResponse.message=error.gen.cpeps.saml
+
+AtPSAMLResponse.code=202009
+AtPSAMLResponse.message=error.gen.atp.saml
+
+atp.url.code=203006
+atp.url.message=invalid.atp.url
+
+hash.error.code=203001
+hash.error.message=error.hash
+
+qaaLevel.code=203006
+qaaLevel.message=invalid.cpeps.qaalevel
+
+SAMLRequest.code=203001
+SAMLRequest.message=invalid.SAMLRequest
+
+atp.response.error.code=202011
+atp.response.error.message=atp.response.error
+
+#Colleague Request Interface errors
+
+colleagueRequest.invalidSAML.code=201002
+colleagueRequest.invalidSAML.message=invalid.speps.samlrequest
+
+colleagueRequest.invalidCountryCode.code=002001
+colleagueRequest.invalidCountryCode.message=country.cpeps.nomatch
+
+colleagueRequest.errorCreatingSAML.code=203001
+colleagueRequest.errorCreatingSAML.message=error.create.saml.cpeps
+
+colleagueRequest.invalidQaa.code=202004
+colleagueRequest.invalidQaa.message=invalid.requested.cpeps.qaalevel
+
+colleagueRequest.attrNull.code=202005
+colleagueRequest.attrNull.message=invalid.requested.attrlist.cpeps
+
+colleaguePVRequest.invalidPVAttrList.code=202013
+colleaguePVRequest.invalidPVAttrList.message=invalid.speps.pv.attrlist
+
+colleagueRequest.invalidRedirect.code=202001
+colleagueRequest.invalidRedirect.message=invalid.redirecturl.cpeps
+
+colleagueRequest.invalidDestUrl.code=203006
+colleagueRequest.invalidDestUrl.message=invalid.cpeps.destUrl
+
+cpepsRedirectUrl.code=203006
+cpepsRedirectUrl.message=invalid.cpeps.redirectUrl
+
+#Citizen Consent Interfaces errors
+
+citizenResponse.mandatory.code=202007
+citizenResponse.mandatory.message=no.consent.mand.attr
+
+cPeps.attrNull.code=202005
+cPeps.attrNull.message=invalid.attrList.cpeps
+
+citizenNoConsent.mandatory.code=202012
+citizenNoConsent.mandatory.message=no.consent.val.mand.attr
+
+#Colleague Response Interface errors
+
+colleagueResponse.invalidSAML.code=202002
+colleagueResponse.invalidSAML.message=invalid.cpeps.samlresp
+
+auRequestIdError.code=201005
+auRequestIdError.message=invalid.speps.saml.id
+
+audienceRestrictionError.code=201004
+audienceRestrictionError.message=speps.saml.condition.notmet
+
+spepsSAMLResponse.code=200010
+spepsSAMLResponse.message=error.gen.speps.saml
+
+
+invalid.apepsRedirectUrl.code=001001
+invalid.apepsRedirectUrl.message=invalid.apeps.redirectUrl
+
+apepsSAMLRequest.code=001002
+apepsSAMLRequest.message=invalid.apeps.saml.request
+
+apepsSAMLResponse.code=001003
+apepsSAMLResponse.message=invalid.apeps.saml.response
+
+invalid.apepsCallbackUrl.code=001004
+invalid.apepsCallbackUrl.message=invalid.apeps.callback.url
+
+colleagueAttributeRequest.invalidSAML.code=001005
+colleagueAttributeRequest.invalidSAML.message=invalid.attr.request.saml
+
+
+#Hash Digests
+hashDigest.className=org.bouncycastle.crypto.digests.SHA512Digest
diff --git a/id/server/stork2-commons/src/main/config/embedded/pepsUtil.properties b/id/server/stork2-commons/src/main/config/embedded/pepsUtil.properties
new file mode 100644
index 000000000..ae811dda7
--- /dev/null
+++ b/id/server/stork2-commons/src/main/config/embedded/pepsUtil.properties
@@ -0,0 +1,269 @@
+#Max allowed params size
+validation.active=true
+max.spUrl.size=150
+max.attrList.size=20000
+max.invalidAttributeList.size=20000
+max.attrName.size=100
+max.callback.size=300
+max.idp.url.size=300
+max.atp.url.size=300
+max.cpepsURL.size=300
+max.attrValue.size=20000
+max.attrType.size=25
+max.spId.size=40
+max.providerName.size=128
+max.spName.size=25
+max.country.size=150
+max.qaaLevel.size=1
+max.spQaaLevel.size=1
+max.errorCode.size=5
+max.errorMessage.size=300
+max.username.size=30
+max.spepsRedirectUrl.size=300
+max.speps.redirectUrl.size=300
+max.cpeps.redirectUrl.size=300
+max.cpepsRedirectUrl.size=300
+max.spepsAssertionUrl.size=300
+max.SAMLRequest.size=131072
+max.SAMLResponse.size=131072
+max.RelayState.size=80
+max.remoteAddr.size=300
+max.remoteHost.size=300
+max.localAddr.size=300
+max.localName.size=300
+max.apepsUrl.size=300
+max.apeps.callbackUrl.size=300
+
+dtl.url=http://localhost:8080/DocumentService/DocumentService
+
+#ERROR codes/messages (accordingly to specification)
+
+#CountrySelector Interface errors
+spCountrySelector.invalidSPQAA.code=0000001
+spCountrySelector.invalidSPQAA.message=invalid.spQAA.parameter
+
+spCountrySelector.invalidQaaSPid.code=0000001
+spCountrySelector.invalidQaaSPid.message=invalid.spQAAId.parameter
+
+spCountrySelector.invalidSpId.code=000002
+spCountrySelector.invalidSpId.message=invalid.spId.parameter
+
+spCountrySelector.invalidSpURL.code=000003
+spCountrySelector.invalidSpURL.message=invalid.spUrl.parameter
+
+domain.CountrySelectorAction.code=000003
+domain.CountrySelectorAction.message=invalid.cs.domain
+
+requests.CountrySelectorAction.code=000004
+requests.CountrySelectorAction.message=reached.max.requests.cs
+
+spCountrySelector.spNotAllowed.code=000006
+spCountrySelector.spNotAllowed.message=attr.access.deny
+
+spCountrySelector.invalidAttr.code=000007
+spCountrySelector.invalidAttr.message=invalid.spAttr.parameter
+
+spCountrySelector.invalidProviderName.code=000008
+spCountrySelector.invalidProviderName.message=invalid.spProvidername.parameter
+
+spCountrySelector.errorCreatingSAML.code=203001
+spCountrySelector.errorCreatingSAML.message=error.create.sp.saml
+
+spepsSAMLRequest.code=203001
+spepsSAMLRequest.message=error.create.saml.speps
+
+#ServiceProvider Interface errors
+sProviderAction.invalidSPQAA.code=200001
+sProviderAction.invalidSPQAA.message=invalid.sp.qaa
+
+sProviderAction.invalidSPQAAId.code=200001
+sProviderAction.invalidSPQAAId.message=invalid.sp.qaaid
+
+sProviderAction.invalidSPId.code=200002
+sProviderAction.invalidSPId.message=invalid.sp.id
+
+domain.ServiceProviderAction.code=200003
+domain.ServiceProviderAction.message=invalid.sp.domain
+
+sProviderAction.invalidSPDomain.code=200003
+sProviderAction.invalidSPDomain.message=invalid.sp.domain
+
+sProviderAction.invalidCountry.code=200004
+sProviderAction.invalidCountry.message=invalid.sp.country
+
+sProviderAction.spNotAllowed.code=200005
+sProviderAction.spNotAllowed.message=sp.not.allowed
+
+sProviderAction.invalidSaml.code=200006
+sProviderAction.invalidSaml.message=invalid.sp.samlrequest
+
+sProviderAction.invalidSPProviderName.code=200007
+sProviderAction.invalidSPProviderName.message=sp.not.identified
+
+sProviderAction.invalidSPRedirect.code=200008
+sProviderAction.invalidSPRedirect.message=invalid.sp.redirectUrl
+
+sProviderAction.invalidRelayState.code=200009
+sProviderAction.invalidRelayState.message=invalid.sp.relaystate
+
+sProviderAction.invalidAttr.code=200011
+sProviderAction.invalidAttr.message=invalid.sp.attr
+
+requests.ServiceProviderAction.code=200012
+requests.ServiceProviderAction.message=reached.max.requests.sp
+
+sPPowerValidationAction.invalidSPPVAttrList.code=200013
+sPPowerValidationAction.invalidSPPVAttrList.message=invalid.sp.pv.attrlist
+
+invalid.sp.pv.attrlist.code=200013
+invalid.sp.pv.attrlist.message=invalid.sp.pv.attrlist
+
+sProviderAction.invalidSPAlias.code=203003
+sProviderAction.invalidSPAlias.message=invalid.sp.alias
+
+sProviderAction.errorCreatingSAML.code=203001
+sProviderAction.errorCreatingSAML.message=error.create.saml.speps
+
+#Internal Error
+internalError.code=203001
+internalError.message=internalError
+
+attrList.code=202005
+attrList.message=invalid.attrList.parameter
+
+missing.sessionId.code=203010
+missing.sessionId.message=missing.session.id
+
+sessionError.code=203011
+sessionError.message=invalid.session.id
+
+invalid.sessionId.code=203011
+invalid.sessionId.message=invalid.session.id
+
+missing.mandate.code=203013
+missing.mandate.message=missing.mandate
+
+invalid.session.code=203012
+invalid.session.message=invalid.session
+
+callback.code=203006
+callback.message=invalid.callback.url
+
+idp.url.code=203006
+idp.url.message=invalid.idp.url
+
+IdPSAMLResponse.code=002001
+IdPSAMLResponse.message=invalid.idp.response
+
+authenticationFailed.code=003002
+authenticationFailed.message=authentication.failed
+
+username.code=003002
+username.message=authentication.failed
+
+invalidAttributeList.code=203001
+invalidAttributeList.message=invalid.attrlist
+
+invalidAttributeValue.code=203001
+invalidAttributeValue.message=invalid.attr.value
+
+attVerification.mandatory.code=202010
+attVerification.mandatory.message=missing.mandatory.attr
+
+attrValue.verification.code=203008
+attrValue.verification.message=invalid.stork.attrValue
+
+cpepsSAMLResponse.code=202012
+cpepsSAMLResponse.message=error.gen.cpeps.saml
+
+AtPSAMLResponse.code=202009
+AtPSAMLResponse.message=error.gen.atp.saml
+
+atp.url.code=203006
+atp.url.message=invalid.atp.url
+
+hash.error.code=203001
+hash.error.message=error.hash
+
+qaaLevel.code=203006
+qaaLevel.message=invalid.cpeps.qaalevel
+
+SAMLRequest.code=203001
+SAMLRequest.message=invalid.SAMLRequest
+
+atp.response.error.code=202011
+atp.response.error.message=atp.response.error
+
+#Colleague Request Interface errors
+
+colleagueRequest.invalidSAML.code=201002
+colleagueRequest.invalidSAML.message=invalid.speps.samlrequest
+
+colleagueRequest.invalidCountryCode.code=002001
+colleagueRequest.invalidCountryCode.message=country.cpeps.nomatch
+
+colleagueRequest.errorCreatingSAML.code=203001
+colleagueRequest.errorCreatingSAML.message=error.create.saml.cpeps
+
+colleagueRequest.invalidQaa.code=202004
+colleagueRequest.invalidQaa.message=invalid.requested.cpeps.qaalevel
+
+colleagueRequest.attrNull.code=202005
+colleagueRequest.attrNull.message=invalid.requested.attrlist.cpeps
+
+colleaguePVRequest.invalidPVAttrList.code=202013
+colleaguePVRequest.invalidPVAttrList.message=invalid.speps.pv.attrlist
+
+colleagueRequest.invalidRedirect.code=202001
+colleagueRequest.invalidRedirect.message=invalid.redirecturl.cpeps
+
+colleagueRequest.invalidDestUrl.code=203006
+colleagueRequest.invalidDestUrl.message=invalid.cpeps.destUrl
+
+cpepsRedirectUrl.code=203006
+cpepsRedirectUrl.message=invalid.cpeps.redirectUrl
+
+#Citizen Consent Interfaces errors
+
+citizenResponse.mandatory.code=202007
+citizenResponse.mandatory.message=no.consent.mand.attr
+
+cPeps.attrNull.code=202005
+cPeps.attrNull.message=invalid.attrList.cpeps
+
+citizenNoConsent.mandatory.code=202012
+citizenNoConsent.mandatory.message=no.consent.val.mand.attr
+
+#Colleague Response Interface errors
+
+colleagueResponse.invalidSAML.code=202002
+colleagueResponse.invalidSAML.message=invalid.cpeps.samlresp
+
+auRequestIdError.code=201005
+auRequestIdError.message=invalid.speps.saml.id
+
+audienceRestrictionError.code=201004
+audienceRestrictionError.message=speps.saml.condition.notmet
+
+spepsSAMLResponse.code=200010
+spepsSAMLResponse.message=error.gen.speps.saml
+
+
+invalid.apepsRedirectUrl.code=001001
+invalid.apepsRedirectUrl.message=invalid.apeps.redirectUrl
+
+apepsSAMLRequest.code=001002
+apepsSAMLRequest.message=invalid.apeps.saml.request
+
+apepsSAMLResponse.code=001003
+apepsSAMLResponse.message=invalid.apeps.saml.response
+
+invalid.apepsCallbackUrl.code=001004
+invalid.apepsCallbackUrl.message=invalid.apeps.callback.url
+
+colleagueAttributeRequest.invalidSAML.code=001005
+colleagueAttributeRequest.invalidSAML.message=invalid.attr.request.saml
+
+
+#Hash Digests
+hashDigest.className=org.bouncycastle.crypto.digests.SHA512Digest
diff --git a/id/server/stork2-commons/src/main/java/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/.svn/all-wcprops
new file mode 100644
index 000000000..ca59ad1e3
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java
+END
diff --git a/id/server/stork2-commons/src/main/java/.svn/entries b/id/server/stork2-commons/src/main/java/.svn/entries
new file mode 100644
index 000000000..ff9dfce64
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+eu
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/.svn/all-wcprops
new file mode 100644
index 000000000..30e4698c0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/.svn/entries b/id/server/stork2-commons/src/main/java/eu/.svn/entries
new file mode 100644
index 000000000..4c0ceff03
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+stork
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops
new file mode 100644
index 000000000..8e248afa5
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/.svn/entries
new file mode 100644
index 000000000..ff2fa64d7
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+peps
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops
new file mode 100644
index 000000000..da872cf08
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/entries
new file mode 100644
index 000000000..f0c47a6d2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+auth
+dir
+
+complex
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops
new file mode 100644
index 000000000..78e9d344c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 78
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries
new file mode 100644
index 000000000..253bfd218
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+specific
+dir
+
+commons
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops
new file mode 100644
index 000000000..edb1120b5
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/all-wcprops
@@ -0,0 +1,191 @@
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth/commons
+END
+AttributeSource.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
+END
+PEPSValues.java
+K 25
+svn:wc:ra_dav:version-url
+V 102
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
+END
+STORKAttrQueryRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
+END
+CitizenConsent.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
+END
+AttributeProvidersMap.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
+END
+STORKAttrQueryResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
+END
+PersonalAttributeList.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
+END
+AttributeName.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
+END
+PEPSUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
+END
+PersonalAttribute.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
+END
+IAttributeListProcessor.java
+K 25
+svn:wc:ra_dav:version-url
+V 115
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
+END
+STORKAuthnRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/56/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
+END
+STORKLogoutResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
+END
+IStorkLogger.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
+END
+DateUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 99
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
+END
+AttributeProvider.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
+END
+IStorkSession.java
+K 25
+svn:wc:ra_dav:version-url
+V 104
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
+END
+Linker.java
+K 25
+svn:wc:ra_dav:version-url
+V 98
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
+END
+PEPSParameters.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
+END
+AttributeConstants.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
+END
+STORKStatusCode.java
+K 25
+svn:wc:ra_dav:version-url
+V 106
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
+END
+AttributeUtil.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
+END
+Country.java
+K 25
+svn:wc:ra_dav:version-url
+V 98
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/Country.java
+END
+PEPSErrors.java
+K 25
+svn:wc:ra_dav:version-url
+V 102
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
+END
+STORKLogoutRequest.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
+END
+IAttributeProvidersMap.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/31/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
+END
+STORKSubStatusCode.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
+END
+IPersonalAttributeList.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
+END
+CountryCodes.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
+END
+STORKAuthnResponse.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries
new file mode 100644
index 000000000..0b8070876
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/entries
@@ -0,0 +1,1085 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/commons
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+AttributeConstants.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+940dcb9e93ede62e221f4b25abd6576b
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1831
+
+STORKStatusCode.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+771689c75a8263c7e3966e820d59025e
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1906
+
+AttributeUtil.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+2859d3335dfe719ca04258fae54e69a3
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7927
+
+exceptions
+dir
+
+Country.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+9cbde5f25b646d02dae7ccf424906b4a
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2208
+
+PEPSErrors.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+bfe69afce772675187fdd637453ed12f
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12165
+
+STORKLogoutRequest.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+af445a2013f21ffecd3db7773ae3236e
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4343
+
+IAttributeProvidersMap.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+225257e8d6d7b9e6bcc4bea2463c33be
+2013-10-10T17:38:31.956327Z
+31
+emlelisst
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2534
+
+STORKSubStatusCode.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+65e615e0119d4125d5f4f58af8bcd18b
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2181
+
+IPersonalAttributeList.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+b441a2c6c3eddcf1043c55e55f48faa6
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6598
+
+STORKAuthnResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+f2247f9a89e8ad01f9a24ad716f993ca
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8724
+
+CountryCodes.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+f91b0f8df0b2a68fe1b900d425257c23
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3527
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.638475Z
+8d8068e217f10425f76a8d37192ccd80
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+277
+
+AttributeSource.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+a0555599193656bc17e02c3ce23043be
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4501
+
+PEPSValues.java
+file
+
+
+
+
+2014-03-05T09:36:07.946515Z
+4a94fe7623d8d6b679efddecd8d49009
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7899
+
+STORKAttrQueryRequest.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+2d4ac505f71020c482ebbefa10484552
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10617
+
+CitizenConsent.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+39e236d6888f266d9b4967f19726126c
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3445
+
+AttributeProvidersMap.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+b487da35df5353c8b2aba47ab3cdb68d
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2608
+
+STORKAttrQueryResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+93fc508be2bc0fd29ae453b0868e1d2b
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9080
+
+PersonalAttributeList.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+0036d26679cc31fe7d1bdea1b8b3555a
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12041
+
+AttributeName.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+164e63d1f4e5aeb47d371caff534eaab
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1504
+
+PEPSUtil.java
+file
+
+
+
+
+2014-03-05T09:36:07.946515Z
+9aa5d40e80a49d19293f42db68feca97
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+12702
+
+PersonalAttribute.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+ce98ef39a754869644b5516cdcfcb40d
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8914
+
+IAttributeListProcessor.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+07efc5b742cc9e4b80a2f8b17fe4b946
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4713
+
+DateUtil.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+59f9cd2a3d1169a0f1a797b28719921a
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5702
+
+IStorkLogger.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+f15979b29f52d1674103528aed914ae7
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4766
+
+STORKLogoutResponse.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+880a05076cf8412311766aa40cf6a63f
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5474
+
+STORKAuthnRequest.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+3f36e65f0c4f1c7df753784b2e64f00b
+2013-10-24T15:44:04.704923Z
+56
+emgrtargr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11269
+
+AttributeProvider.java
+file
+
+
+
+
+2014-03-05T09:36:07.946515Z
+54177f09aad369707021fb3c0f5b2b1e
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2914
+
+IStorkSession.java
+file
+
+
+
+
+2013-12-20T12:27:56.634475Z
+5a8701b1fd27998d5cf3280a5c99bcb0
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2745
+
+Linker.java
+file
+
+
+
+
+2014-01-21T08:38:55.336702Z
+98f46baee16310e3dc59ef224ba5b5ab
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8950
+
+PEPSParameters.java
+file
+
+
+
+
+2014-03-05T09:36:07.946515Z
+ba1718cf8c1a52eae81aa6b182315b95
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+15394
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base
new file mode 100644
index 000000000..09769641c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeConstants.java.svn-base
@@ -0,0 +1,72 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum AttributeConstants {
+
+ /**
+ * Represents the attribute's name index.
+ */
+ ATTR_NAME_INDEX(0),
+ /**
+ * Represents the attribute's type index.
+ */
+ ATTR_TYPE_INDEX(1),
+ /**
+ * Represents the attribute's value index.
+ */
+ ATTR_VALUE_INDEX(2),
+ /**
+ * Represents the attribute's status index.
+ */
+ ATTR_STATUS_INDEX(3),
+ /**
+ * Represents the number of allowed tuples.
+ */
+ NUMBER_TUPLES(4);
+
+ /**
+ * Represents the constant's value.
+ */
+ private int attribute;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param attr The Attribute Constant value.
+ */
+ AttributeConstants(final int attr) {
+
+ this.attribute = attr;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public int intValue() {
+
+ return attribute;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base
new file mode 100644
index 000000000..a44768c7e
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeName.java.svn-base
@@ -0,0 +1,74 @@
+package eu.stork.peps.auth.commons;
+
+/**
+ * This class is a bean used to store information relative to Attribute Names.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-11-26 $
+ */
+public final class AttributeName {
+
+ /**
+ * Attribute Id.
+ */
+ private String attributeId;
+
+ /**
+ * Attribute Name.
+ */
+ private String attributeName;
+
+ /**
+ * Attribute Name Constructor.
+ *
+ * @param aId Id of the Attribute Name.
+ * @param aName Name of the Attribute Name.
+ */
+ public AttributeName(final String aId, final String aName) {
+
+ this.attributeId = aId;
+ this.attributeName = aName;
+ }
+
+ /**
+ * Getter for the attributeId value.
+ *
+ * @return The attributeId value.
+ */
+ public String getAttributeId() {
+
+ return attributeId;
+ }
+
+ /**
+ * Setter for the attributeId value.
+ *
+ * @param aId Id of the Attribute Name.
+ */
+ public void setAttributeId(final String aId) {
+
+ this.attributeId = aId;
+ }
+
+ /**
+ * Getter for the attributeName value.
+ *
+ * @return The attributeName value.
+ */
+ public String getAttributeName() {
+
+ return attributeName;
+ }
+
+ /**
+ * Setter for the attributeName value.
+ *
+ * @param name Name of the Attribute Name.
+ */
+ public void setAttributeName(final String name) {
+
+ this.attributeName = name;
+ }
+
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base
new file mode 100644
index 000000000..575732e27
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvider.java.svn-base
@@ -0,0 +1,123 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Provider.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2014-01-13 $
+ */
+public final class AttributeProvider implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7210186241917444559L;
+
+ /**
+ * Provider Id.
+ */
+ private String providerId;
+
+ /**
+ * Provider Name.
+ */
+ private String providerName;
+
+ /**
+ * Allowed groups of attribute names.
+ */
+ private List<String> allowedGroups;
+
+ /**
+ * Attribute Provider Constructor.
+ *
+ * @param pId Id of the Attribute Provider.
+ * @param pName Name of the Attribute Provider.
+ */
+ public AttributeProvider(final String pId, final String pName, final List<String> pAllowedGroups) {
+
+ this.providerId = pId;
+ this.providerName = pName;
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Getter for the providerId value.
+ *
+ * @return The providerId value.
+ */
+ public String getProviderId() {
+
+ return providerId;
+ }
+
+ /**
+ * Setter for the providerId value.
+ *
+ * @param pId Id of the Attribute Provider.
+ */
+ public void setProviderId(final String pId) {
+
+ this.providerId = pId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The providerName value.
+ */
+ public String getProviderName() {
+
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param name Name of the Attribute Provider.
+ */
+ public void setProviderName(final String name) {
+
+ this.providerName = name;
+ }
+
+ /**
+ * Getter for the allowedGroups value.
+ *
+ * @return The allowedGroups value.
+ */
+ public List<String> getAllowedGroups() {
+
+ return allowedGroups;
+ }
+
+ /**
+ * Setter for the allowedGroups value.
+ *
+ * @param name AllowedGroups of the Attribute Provider.
+ */
+ public void setAllowedGroups(final List<String> pAllowedGroups) {
+
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Check if an attribute name is allowed for this Attribute Provider
+ *
+ * @param pAttrName the Attribute Name to check
+ * @return true if the name is allowed, false otherwise
+ */
+ public boolean isAttributeNameAllowed(final String pAttrName) {
+ if ( allowedGroups==null || pAttrName==null )
+ return false;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_ALL.toString()) )
+ return true;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_NONE.toString()) )
+ return false;
+ else
+ return allowedGroups.contains(pAttrName);
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base
new file mode 100644
index 000000000..85aec2625
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeProvidersMap.java.svn-base
@@ -0,0 +1,96 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of the AttributeProviderMap using a LinkedHashMap.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-09-20 $
+ *
+ * @see LinkedHashMap
+ */
+public class AttributeProvidersMap extends LinkedHashMap<AttributeSource, IPersonalAttributeList>
+ implements IAttributeProvidersMap {
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeProvidersMap.class.getName());
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8949081185106296122L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList get(final AttributeSource key) {
+ return this.get((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList remove(final AttributeSource key) {
+ return this.remove((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean containsKey(final AttributeSource key) {
+ return this.containsKey((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<AttributeSource> keyIterator() {
+ return this.keySet().iterator();
+ }
+
+ public void trace() {
+ Iterator<AttributeSource> iterator;
+ Iterator<PersonalAttribute> iterator2;
+ AttributeSource source;
+ IPersonalAttributeList pal;
+ PersonalAttribute pa;
+
+ iterator = this.keyIterator();
+ LOG.trace("Start dumping of AttributeProvidersMap\n=======================");
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ LOG.trace("Source details: type [" + source.getSourceType() + "], URL [" + source.getProviderURL() + "]");
+
+ if(source.getSourceType() == AttributeSource.SOURCE_LOCAL_APROVIDER) {
+ LOG.trace("-> Attribute Provider: ID [" + source.getProvider().getProviderId() + "], name [" + source.getProvider().getProviderName() + "]");
+ }
+ else {
+ LOG.trace("-> Country: ID [" + source.getCountry().getCountryId() + "], name [" + source.getCountry().getCountryName() + "]");
+ }
+
+ pal = this.get(source);
+ LOG.trace("++++++++=>");
+ iterator2 = pal.iterator();
+ while (iterator2.hasNext()) {
+ pa = iterator2.next();
+
+ LOG.trace("-> Citizen Attribute: name [" + pa.getName() + "], required [" + pa.isRequired() + "]");
+ }
+ LOG.trace("<=++++++++");
+
+ LOG.trace("-----------------------");
+ }
+ LOG.trace("END\n=======================");
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base
new file mode 100644
index 000000000..846f54f67
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeSource.java.svn-base
@@ -0,0 +1,188 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Source (either AttributeProvider or Country).
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.10 $, $Date: 2013-11-29 $
+ */
+public final class AttributeSource implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 432243595968469014L;
+
+ public static final int SOURCE_LOCAL_APROVIDER = 1;
+ public static final int SOURCE_REMOTE_COUNTRY = 2;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeSource.class.getName());
+
+ /**
+ * Provider source.
+ */
+ private int sourceType;
+
+ /**
+ * Provider URL.
+ */
+ private String providerURL;
+
+ /**
+ * The local Attribute Provider.
+ */
+ private AttributeProvider provider;
+
+ /**
+ * The remote Country.
+ */
+ private Country country;
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param provider The local Attribute Provider.
+ * @param pURL URL of the Attribute Provider.
+ */
+ public AttributeSource(final AttributeProvider provider, final String pURL) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.setProvider(provider);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param country The remote Country.
+ * @param pURL URL of the Country.
+ */
+ public AttributeSource(final Country country, final String pURL) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.setCountry(country);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * @param sourceType the sourceType to set
+ */
+ public void setSourceType(final int sourceType) {
+ this.sourceType = sourceType;
+ }
+
+ /**
+ * @return the sourceType
+ */
+ public int getSourceType() {
+ return sourceType;
+ }
+
+ /**
+ * @param providerURL the providerURL to set
+ */
+ public void setProviderURL(final String providerURL) {
+ this.providerURL = providerURL;
+ }
+
+ /**
+ * @return the providerURL
+ */
+ public String getProviderURL() {
+ return providerURL;
+ }
+
+ /**
+ * @param provider the provider to set
+ */
+ public void setProvider(final AttributeProvider provider) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.provider = provider;
+ }
+
+ /**
+ * @return the provider
+ */
+ public AttributeProvider getProvider() {
+ return provider;
+ }
+
+ /**
+ * @param country the country to set
+ */
+ public void setCountry(final Country country) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.country = country;
+ }
+
+ /**
+ * @return the country
+ */
+ public Country getCountry() {
+ return country;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+ boolean outcome = false;
+
+ LOG.debug("Calling equals with Object.");
+ if ( obj instanceof AttributeSource ) {
+ LOG.debug("Calling equals with AttributeSource.");
+ outcome = this.equals((AttributeSource)obj);
+ }
+
+ LOG.debug("Object equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * Compare the given AttributeSource with the current object in order to determinine
+ * if they are equal.
+ *
+ * @param obj The AttributeSource to compare to
+ *
+ * @return true if the two objects are equal
+ */
+ public boolean equals(AttributeSource obj) {
+ boolean outcome = false;
+
+ if ( this.sourceType==obj.getSourceType() ) {
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( this.provider.getProviderId().equals(obj.getProvider().getProviderId()) )
+ outcome = true;
+ }
+ else if ( this.sourceType==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( this.country.getCountryId().equals(obj.getCountry().getCountryId()) )
+ outcome = true;
+ }
+ }
+
+ LOG.debug("AttributeSource equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hash = 1;
+ hash = hash * 17 + this.sourceType;
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER )
+ hash = hash * 31 + this.provider.getProviderName().hashCode();
+ else
+ hash = hash * 31 + this.country.getCountryName().hashCode();
+ return hash;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base
new file mode 100644
index 000000000..af7ab6cf3
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/AttributeUtil.java.svn-base
@@ -0,0 +1,231 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-12-15 23:19:59 $
+ */
+public final class AttributeUtil {
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private AttributeUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Safe escape any given string.
+ *
+ * @param value The HTTP Value to escaped.
+ *
+ * @return The value escaped value.
+ */
+ public static String escape(final String value) {
+
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(attrSep, escAttrSep)
+ .replace(attrTupleSep, escAttrTupleSep)
+ .replace(attrValueSep, escAttrValueSep);
+ }
+
+ /**
+ * Unescape any given string.
+ *
+ * @param value The HTTP Value to be unescaped.
+ *
+ * @return The value unescaped value.
+ */
+ public static String unescape(final String value) {
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(escAttrSep, attrSep)
+ .replace(escAttrTupleSep, attrTupleSep)
+ .replace(escAttrValueSep, attrValueSep);
+ }
+
+ /**
+ * Appends the string representation of an object to a StringBuilder.
+ *
+ * @param strBuilder The StringBuilder to append to.
+ * @param val The string representation of an object.
+ */
+ public static void appendIfNotNull(final StringBuilder strBuilder,
+ final Object val) {
+
+ if (val != null) {
+ strBuilder.append(val);
+ }
+ }
+
+ /**
+ * Given a separator and a list of strings, joins the list, as a string,
+ * separated by the separator string.
+ *
+ * @param list The list of strings to join.
+ * @param separator The separator string.
+ * @return the list, as a string, separated by the separator string.
+ */
+ public static String listToString(final List<String> list,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ for (final String s : list) {
+ if (!StringUtils.isEmpty(s)) {
+ strBuilder.append(AttributeUtil.escape(s) + separator);
+ }
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Given a separator and a map of strings to strings, joins the map, as a
+ * string, separated by the separator string with the pair key/value
+ * concatenated with a '='.
+ *
+ * @param map The map of strings to join.
+ * @param separator The separator string.
+ *
+ * @return the map of strings, as a string, separated by the separator string
+ * with the pair key/value concatenated with a '='.
+ */
+ public static String mapToString(final Map<String, String> map,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ final Iterator<Entry<String, String>> valuesIt = map.entrySet().iterator();
+ while (valuesIt.hasNext()) {
+ final Entry<String, String> entry = valuesIt.next();
+ strBuilder.append(entry.getKey());
+ strBuilder.append('=');
+ strBuilder.append(AttributeUtil.escape(entry.getValue()));
+ strBuilder.append(separator);
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates the attribute value format.
+ *
+ * @param value The attribute value to validate.
+ *
+ * @return true if value has a valid format.
+ */
+ public static boolean isValidValue(final String value) {
+ boolean retVal = false;
+ if (value != null && value.charAt(0) == '[' && value.endsWith("]")) {
+ final String tmpAttrValue = value.substring(1, value.length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ if (tmpAttrValue.length() >= 0
+ || (vals.length > 0 && vals[0].length() > 0)) {
+ retVal = true;
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the attribute type value. It's case insensitive. E.g. return true
+ * value to: a) "true", "TRUE", "True", ... b) "false", "FALSE", "False", ...
+ *
+ * @param type The attribute type value.
+ *
+ * @return true if type has a true or false (case insensitive) value.
+ */
+ public static boolean isValidType(final String type) {
+ return StringUtils.isNotEmpty(type) && (PEPSValues.TRUE.toString().equalsIgnoreCase(type) || PEPSValues.FALSE.toString().equalsIgnoreCase(type)) ;
+ }
+
+ /**
+ * Validates the Personal attribute tuple. E.g. name:type:[value]:status
+ *
+ * @param tuples The Personal attribute's tuple.
+ *
+ * @return true if the tuples' format is valid.
+ *
+ * @see PEPSUtil#validateParameter(String, String, String)
+ * @see String#equalsIgnoreCase(String)
+ */
+ public static boolean hasValidTuples(final String[] tuples) {
+ boolean retVal = false;
+
+ final int numberTuples = AttributeConstants.NUMBER_TUPLES.intValue();
+ if (tuples != null && tuples.length == numberTuples) {
+ // validate attrName
+ final int attrNameIndex = AttributeConstants.ATTR_NAME_INDEX.intValue();
+ final int attrTypeIndex = AttributeConstants.ATTR_TYPE_INDEX.intValue();
+ final int attrValueIndex = AttributeConstants.ATTR_VALUE_INDEX.intValue();
+
+ retVal =
+ StringUtils.isNotEmpty(tuples[attrNameIndex])
+ && StringUtils.isNotEmpty(tuples[attrTypeIndex])
+ && StringUtils.isNotEmpty(tuples[attrValueIndex])
+ && AttributeUtil.isValidType(tuples[attrTypeIndex])
+ && AttributeUtil.isValidValue(tuples[attrValueIndex]);
+ }
+ return retVal;
+ }
+
+ /**
+ * Check if all mandatory attributes have values.
+ *
+ * @param personalAttrList The Personal Attributes List.
+ *
+ * @return true if all mandatory attributes have values, false if at least one
+ * attribute doesn't have value.
+ */
+ public static boolean checkMandatoryAttributes(
+ final IPersonalAttributeList personalAttrList) {
+
+ final Iterator<PersonalAttribute> itAttributes =
+ personalAttrList.values().iterator();
+ boolean retVal = true;
+ while (itAttributes.hasNext() && retVal) {
+ final PersonalAttribute attr = itAttributes.next();
+ if (attr.isRequired()
+ && !STORKStatusCode.STATUS_AVAILABLE.toString()
+ .equals(attr.getStatus())) {
+ retVal = false;
+ }
+ }
+ return retVal;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base
new file mode 100644
index 000000000..9ebcfbd5a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CitizenConsent.java.svn-base
@@ -0,0 +1,123 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Citizen
+ * Consent.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CitizenConsent {
+
+ /**
+ * Mandatory attributes list.
+ */
+ private List<String> mandatoryList;
+
+ /**
+ * Optional attributes list.
+ */
+ private List<String> optionalList;
+
+ /**
+ * Citizen Consent default Constructor.
+ */
+ public CitizenConsent() {
+ this.mandatoryList = new ArrayList<String>();
+ this.optionalList = new ArrayList<String>();
+ }
+
+ /**
+ * Getter for the mandatoryList value.
+ *
+ * @return The mandatoryList value.
+ */
+ public List<String> getMandatoryList() {
+ return this.mandatoryList;
+ }
+
+ /**
+ * Setter for the mandatoryList value.
+ *
+ * @param mandatoryAttrList Mandatory parameters list.
+ */
+ public void setMandatoryList(final List<String> mandatoryAttrList) {
+ this.mandatoryList = mandatoryAttrList;
+ }
+
+ /**
+ * Setter for some mandatoryAttribute. Adds the input parameter to the
+ * mandatoryList.
+ *
+ * @param mandatoryAttr Attribute to add to the mandatoryList.
+ */
+ public void setMandatoryAttribute(final String mandatoryAttr) {
+ this.mandatoryList.add(mandatoryAttr);
+ }
+
+ /**
+ * Getter for the optionalList value.
+ *
+ * @return The optionalList value.
+ */
+ public List<String> getOptionalList() {
+ return optionalList;
+ }
+
+ /**
+ * Setter for the optionalList value.
+ *
+ * @param optAttrList Optional parameters list.
+ */
+ public void setOptionalList(final List<String> optAttrList) {
+ this.optionalList = optAttrList;
+ }
+
+ /**
+ * Setter for some optionalAttr. Adds the input parameter to the optionalList.
+ *
+ * @param optionalAttr Attribute to add to the optionalList.
+ */
+ public void setOptionalAttribute(final String optionalAttr) {
+ this.optionalList.add(optionalAttr);
+ }
+
+ /**
+ * Returns a string in the following format. "Mandatory attributes:
+ * mandatoryAttr1;mandatoryAttr2;mandatoryAttrN Optional attributes:
+ * optionalAttr1;optionalAttr2;optionalAttrN"
+ *
+ * @return {@inheritDoc}
+ */
+ public String toString() {
+ final StringBuilder strbldr = new StringBuilder(46);
+ strbldr.append("Mandatory attributes: ");
+ for (final String str : mandatoryList) {
+ strbldr.append(str).append(';');
+ }
+ strbldr.append(" Optional attributes: ");
+ for (final String str : optionalList) {
+ strbldr.append(str).append(';');
+ }
+ return strbldr.toString();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base
new file mode 100644
index 000000000..001f9317a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Country.java.svn-base
@@ -0,0 +1,95 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Country.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class Country implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1135994036496370993L;
+
+/**
+ * Country Id.
+ */
+ private String countryId;
+
+ /**
+ * Country Name.
+ */
+ private String countryName;
+
+ /**
+ * Country Constructor.
+ *
+ * @param cId Id of the Country.
+ * @param cName Name of the Country.
+ */
+ public Country(final String cId, final String cName) {
+
+ this.countryId = cId;
+ this.countryName = cName;
+ }
+
+ /**
+ * Getter for the countryId value.
+ *
+ * @return The countryId value.
+ */
+ public String getCountryId() {
+
+ return countryId;
+ }
+
+ /**
+ * Setter for the countryId value.
+ *
+ * @param cId Id of the Country.
+ */
+ public void setCountryId(final String cId) {
+
+ this.countryId = cId;
+ }
+
+ /**
+ * Getter for the countryName value.
+ *
+ * @return The countryName value.
+ */
+ public String getCountryName() {
+
+ return countryName;
+ }
+
+ /**
+ * Setter for the countryName value.
+ *
+ * @param name Name of the Country.
+ */
+ public void setCountryName(final String name) {
+
+ this.countryName = name;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base
new file mode 100644
index 000000000..54345f3ea
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/CountryCodes.java.svn-base
@@ -0,0 +1,79 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This class contains all the ISO 3166-1 Alpha 3 Country Codes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2011-04-14 00:24:56 $
+ */
+public final class CountryCodes {
+
+ /**
+ * Private Constructor.
+ */
+ private CountryCodes() {
+
+ }
+
+ /**
+ * ISO 3166-1 Alpha 3 Country Codes.
+ */
+ private static List<String> countrysAlpha3 = Arrays.asList("ABW", "AFG",
+ "AGO", "AIA", "ALA", "ALB", "AND", "ANT", "ARE", "ARG", "ARM", "ASM",
+ "ATA", "ATF", "ATG", "AUS", "AUT", "AZE", "BDI", "BEL", "BEN", "BES",
+ "BFA", "BGD", "BGR", "BHR", "BHS", "BIH", "BLM", "BLR", "BLZ", "BMU",
+ "BOL", "BRA", "BRB", "BRN", "BTN", "BUR", "BVT", "BWA", "BYS", "CAF",
+ "CAN", "CCK", "CHE", "CHL", "CHN", "CIV", "CMR", "COD", "COG", "COK",
+ "COL", "COM", "CPV", "CRI", "CSK", "CUB", "CUW", "CXR", "CYM", "CYP",
+ "CZE", "DEU", "DJI", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "ERI",
+ "ESH", "ESP", "EST", "ETH", "FIN", "FJI", "FLK", "FRA", "FRO", "FSM",
+ "GAB", "GBR", "GEO", "GGY", "GHA", "GIB", "GIN", "GLP", "GMB", "GNB",
+ "GNQ", "GRC", "GRD", "GRL", "GTM", "GUF", "GUM", "GUY", "HKG", "HMD",
+ "HND", "HRV", "HTI", "HUN", "IDN", "IMN", "IND", "IOT", "IRL", "IRN",
+ "IRQ", "ISL", "ISR", "ITA", "JAM", "JEY", "JOR", "JPN", "KAZ", "KEN",
+ "KGZ", "KHM", "KIR", "KNA", "KOR", "KWT", "LAO", "LBN", "LBR", "LBY",
+ "LCA", "LIE", "LKA", "LSO", "LTU", "LUX", "LVA", "MAC", "MAF", "MAR",
+ "MCO", "MDA", "MDG", "MDV", "MEX", "MHL", "MKD", "MLI", "MLT", "MMR",
+ "MNE", "MNG", "MNP", "MOZ", "MRT", "MSR", "MTQ", "MUS", "MWI", "MYS",
+ "MYT", "NAM", "NCL", "NER", "NFK", "NGA", "NIC", "NIU", "NLD", "NOR",
+ "NPL", "NRU", "NZL", "OMN", "PAK", "PAN", "PCN", "PER", "PHL", "PLW",
+ "PNG", "POL", "PRI", "PRK", "PRT", "PRY", "PSE", "PYF", "QAT", "REU",
+ "ROM", "ROU", "RUS", "RWA", "SAU", "SCG", "SDN", "SEN", "SGP", "SGS",
+ "SHN", "SJM", "SLB", "SLE", "SLV", "SMR", "SOM", "SPM", "SRB", "STP",
+ "SUR", "SVK", "SVN", "SXW", "SWE", "SWZ", "SYC", "SYR", "TCA", "TCD",
+ "TGO", "THA", "TJK", "TKL", "TKM", "TLS", "TMP", "TON", "TTO", "TUN",
+ "TUR", "TUV", "TWN", "TZA", "UGA", "UKR", "UMI", "URY", "USA", "UZB",
+ "VAT", "VCT", "VEN", "VGB", "VIR", "VNM", "VUT", "WLF", "WSM", "YEM",
+ "YUG", "ZAF", "ZAR", "ZMB", "ZWE");
+
+ /**
+ * Searches the CountryCode (3166-1 alpha3 format) an return true if it
+ * exists.
+ *
+ * @param countryCode The Country code to search.
+ *
+ * @return true if the CountryCode exists, false otherwise.
+ */
+ public static boolean hasCountryCodeAlpha3(final String countryCode) {
+
+ return CountryCodes.countrysAlpha3.contains(countryCode);
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base
new file mode 100644
index 000000000..9c0bd6775
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/DateUtil.java.svn-base
@@ -0,0 +1,169 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.sql.Timestamp;
+import java.util.GregorianCalendar;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.joda.time.Years;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * This class holds static helper methods for Date Operations.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class DateUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(DateUtil.class.getName());
+
+ /**
+ * yyyy Date format size.
+ */
+ private static final int YEAR_DATE_SIZE = 4;
+
+ /**
+ * yyyyMM Date format size.
+ */
+ private static final int MONTH_DATE_SIZE = 6;
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private DateUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Fulfils dateValue with a valid date. The following roles are applied: a) If
+ * the dateValue only contains the year then fulfils with last year's day.
+ * e.g. this method returns 19951231 to the 1995 dateValue. b) If the
+ * dateValue contains the year and the month then fulfils with last month's
+ * day. e.g. this method returns 19950630 to the 199505 dateValue.
+ *
+ * @param dateValue The date to be fulfilled.
+ *
+ * @return The dateValue fulfilled.
+ */
+ private static String fulfilDate(final String dateValue) {
+
+ final StringBuffer strBuf = new StringBuffer();
+ strBuf.append(dateValue);
+ // if the IdP just provides the year then we must fullfil the date.
+ if (dateValue.length() == YEAR_DATE_SIZE) {
+ strBuf.append(PEPSValues.LAST_MONTH.toString());
+ }
+ // if the IdP provides the year and the month then we must fullfil the
+ // date.
+ if (dateValue.length() == MONTH_DATE_SIZE
+ || strBuf.length() == MONTH_DATE_SIZE) {
+ // IdP doesn't provide the day, so we will use DateTime to
+ // calculate it.
+ final String noDayCons = PEPSValues.NO_DAY_DATE_FORMAT.toString();
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(noDayCons);
+ final DateTime dateTime = fmt.parseDateTime(strBuf.toString());
+ // Append the last month's day.
+ strBuf.append(dateTime.dayOfMonth().withMaximumValue().getDayOfMonth());
+ }
+
+ return strBuf.toString();
+ }
+
+ /**
+ * Validates the dateValue format: a) if has a valid size; b) if has a numeric
+ * value; Note: dateValue must have the format yyyyMMdd.
+ *
+ * @param dateValueTmp The date to be validated.
+ * @param pattern The accepted date format.
+ *
+ * @return true if the date has a valid format.
+ */
+ public static boolean isValidFormatDate(final String dateValueTmp,
+ final String pattern) {
+
+ boolean retVal = true;
+ try {
+ final String dateValue = DateUtil.fulfilDate(dateValueTmp);
+
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ fmt.parseDateTime(dateValue);
+ } catch (final Exception e) {
+ // We catch Exception because we only have to return false
+ // value!
+ retVal = false;
+ }
+ return retVal;
+ }
+
+ /**
+ * Calculates the age for a given date string.
+ *
+ * @param dateVal The date to be validated.
+ * @param now The current date.
+ * @param pattern The date pattern.
+ *
+ * @return The age value.
+ */
+ public static int calculateAge(final String dateVal, final DateTime now,
+ final String pattern) {
+
+ if (DateUtil.isValidFormatDate(dateVal, pattern)) {
+ try {
+ final String dateValueTemp = DateUtil.fulfilDate(dateVal);
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ final DateTime dateTime = fmt.parseDateTime(dateValueTemp);
+ // Calculating age
+ final Years age = Years.yearsBetween(dateTime, now);
+
+ return age.getYears();
+ } catch (final IllegalArgumentException e) {
+ LOG.warn("Invalid date format (" + pattern
+ + ") or an invalid dateValue.");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()),
+ e);
+ }
+ } else {
+ LOG.warn("Couldn't calculate Age, invalid date!");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()));
+ }
+
+ }
+
+ /**
+ * Generates the current timestamp.
+ *
+ * @return timestamp The current timestamp
+ */
+ public static Timestamp currentTimeStamp() {
+ final GregorianCalendar cal = new GregorianCalendar();
+ final long millis = cal.getTimeInMillis();
+ return new Timestamp(millis);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base
new file mode 100644
index 000000000..b13c70f04
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeListProcessor.java.svn-base
@@ -0,0 +1,148 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface for {@link AttributeListProcessor}.
+ *
+ * @author ricardo.ferreira@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ *
+ * @see IPersonalAttributeList
+ */
+public interface IAttributeListProcessor {
+
+ /**
+ * Checks if attribute list only contains allowed attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the allowed attributes
+ *
+ * @return true is all the attributes are allowed.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAllowedAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Lookup for business attribute.
+ *
+ * @param attrList the requested attribute list
+ * @param normalAttributes the normal attributes
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList, final List<String> normalAttributes);
+
+ /**
+ * Lookup for business attribute in normal attribute list (loaded by
+ * implementation).
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes to get business
+ * attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to add (eIdentifier, name,
+ * surname, and DateOfBirth).
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes, loaded by
+ * implementation, to get business attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Removes from attribute list the given list of attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to remove.
+ *
+ * @return the requested attribute list and the attributes removed.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Removes from attribute list the given list of attributes and change
+ * attributes status if attribute was optional in the request.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the map of attributes (attribute name, mandatory/optional) to remove.
+ *
+ * @return the requested attribute list and the attributes removed
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(IPersonalAttributeList attrList, Map<String, Boolean> attributes);
+
+ /**
+ * Checks if mandate attribute exist in the requested Attribute List. Power
+ * attribute name to lookup is loaded by implementation.
+ *
+ * @param attrList the requested attribute list.
+ *
+ * @return true if mandate attribute exists or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasPowerAttribute(final IPersonalAttributeList attrList);
+
+ /**
+ * Checks if attribute name was requested and has value.
+ *
+ * @param attrList the requested attribute list.
+ * @param attrName the attribute name to lookup for .
+ *
+ * @return true if attribute was requested and has value or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAttributeValue(final IPersonalAttributeList attrList, final String attrName);
+
+ /**
+ * Checks if attribute has value.
+ *
+ * @param attr the attribute to check.
+ *
+ * @return true if has value;
+ *
+ * @see PersonalAttribute
+ */
+ boolean hasAttributeValue(final PersonalAttribute attr);
+
+ /**
+ * Gets a map (attribute name, attribute isRequired) of attributes added to attribute list.
+ *
+ * @return the Map of attributes added and if is required to attribute list.
+ */
+ Map<String, Boolean> getNormalAttributesAdded();
+
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base
new file mode 100644
index 000000000..733399ca3
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IAttributeProvidersMap.java.svn-base
@@ -0,0 +1,82 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+
+/**
+ * Interface for Attributes Providers map.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-09-20 $
+ */
+public interface IAttributeProvidersMap {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ IPersonalAttributeList get(AttributeSource key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(AttributeSource key, IPersonalAttributeList value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ IPersonalAttributeList remove(AttributeSource key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(AttributeSource key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns an Iterator of the keys contained in this map. The implementation must
+ * take care in order for the Iterator to have predictable order of the returned
+ * keys.
+ *
+ * @return an iterator of the keys contained in this map
+ */
+ Iterator<AttributeSource> keyIterator();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base
new file mode 100644
index 000000000..b24c915c0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IPersonalAttributeList.java.svn-base
@@ -0,0 +1,194 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Interface for {@link PersonalAttributeList}.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.16 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD.CloneMethodMustImplementCloneable")
+public interface IPersonalAttributeList extends Iterable<PersonalAttribute>,
+ Cloneable {
+
+ /**
+ * Associates the specified value with the specified key in this Personal
+ * Attribute List.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return the previous value associated with key, or null if there was no
+ * mapping for key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute put(String key, PersonalAttribute value);
+
+ /**
+ * Returns the value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @param key whose associated value is to be returned.
+ *
+ * @return The value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute get(Object key);
+
+ /**
+ * Adds to the PersonalAttributeList the given PersonalAttribute. It sets the
+ * attribute name as the key to the attribute value.
+ *
+ * @param value PersonalAttribute to add to the PersonalAttributeList
+ */
+ void add(PersonalAttribute value);
+
+ /**
+ * Get the size of the Personal Attribute List.
+ *
+ * @return size of the Personal Attribute List.
+ */
+ int size();
+
+ /**
+ * Checks if the Personal Attribute List contains the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if the Personal Attribute List contains the given key, false
+ * otherwise.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Getter for the iterator of the Personal Attribute List values.
+ *
+ * @return The iterator for the Personal Attribute List values.
+ *
+ * @see PersonalAttribute
+ */
+ Iterator<PersonalAttribute> iterator();
+
+ /**
+ * Creates a Personal Attribute List from a String representing an Attribute
+ * List.
+ *
+ * @param attrList String Object representing the attribute list.
+ */
+ void populate(String attrList);
+
+ /**
+ * Removes the mapping for this key from this map if present.
+ *
+ * @param key key whose mapping is to be removed from the map.
+ * @return previous value associated with specified key, or <tt>null</tt> if
+ * there was no mapping for key. A <tt>null</tt> return can also
+ * indicate that the map previously associated <tt>null</tt> with the
+ * specified key.
+ */
+ PersonalAttribute remove(Object key);
+
+ /**
+ * Returns a collection view of the values contained in this map. The
+ * collection is backed by the map, so changes to the map are reflected in the
+ * collection, and vice-versa. The collection supports element removal, which
+ * removes the corresponding mapping from this map, via the
+ * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>clear</tt> operations. It does not support the
+ * <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * @return a collection view of the values contained in this map.
+ */
+ Collection<PersonalAttribute> values();
+
+ /**
+ * Returns a {@link Set} view of the keys contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. If the map is modified
+ * while an iteration over the set is in progress (except through
+ * the iterator's own <tt>remove</tt> operation), the results of
+ * the iteration are undefined. The set supports element removal,
+ * which removes the corresponding mapping from the map, via the
+ * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or <tt>addAll</tt>
+ * operations.
+ *
+ * @return a set view of the keys contained in this map
+ */
+ Set<String> keySet();
+
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes.
+ *
+ * @return an IPersonalAttributeList of the complex attributes.
+ */
+ IPersonalAttributeList getComplexAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the simple value attributes.
+ *
+ * @return an IPersonalAttributeList of the simple value attributes.
+ */
+ IPersonalAttributeList getSimpleValueAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ IPersonalAttributeList getMandatoryAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ IPersonalAttributeList getOptionalAttributes();
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ *
+ * @return <tt>true</tt> if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns <tt>true</tt> if this map contains at least one element that doesn't have value.
+ *
+ * @return <tt>true</tt> if this map contains at least one element that doesn't have value.
+ */
+ boolean hasMissingValues();
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ Object clone() throws CloneNotSupportedException;
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base
new file mode 100644
index 000000000..33eb618f0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkLogger.java.svn-base
@@ -0,0 +1,239 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork logging.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public interface IStorkLogger {
+
+ /**
+ * Getter for SpApplication.
+ *
+ * @return The SpApplication value.
+ */
+ String getSpApplication();
+
+ /**
+ * Setter for SpApplication.
+ *
+ * @param spApplication The SP Application.
+ */
+ void setSpApplication(String spApplication);
+
+ /**
+ * Getter for ProviderName.
+ *
+ * @return The ProviderName value.
+ */
+ String getProviderName();
+
+ /**
+ * Setter for ProviderName.
+ *
+ * @param providerName The provider name.
+ */
+ void setProviderName(String providerName);
+
+ /**
+ *
+ * Getter for Origin.
+ *
+ * @return The Origin value.
+ *
+ */
+ String getOrigin();
+
+ /**
+ * Setter for Origin.
+ *
+ * @param origin The origin.
+ */
+ void setOrigin(String origin);
+
+ /**
+ *
+ * Getter for QAA Level.
+ *
+ * @return The QAA Level value.
+ *
+ */
+ int getQaaLevel();
+
+ /**
+ * Setter for QAA Level.
+ *
+ * @param qaaLevel The qaa level.
+ */
+ void setQaaLevel(int qaaLevel);
+
+ /**
+ *
+ * Getter for timestamp.
+ *
+ * @return The timestamp value.
+ *
+ */
+ String getTimestamp();
+
+ /**
+ * Setter for timestamp.
+ *
+ * @param timestamp The request's timestamp.
+ */
+ void setTimestamp(String timestamp);
+
+ /**
+ * Getter for InResponseTo.
+ *
+ * @return The InResponseTo value.
+ */
+ String getInResponseTo();
+
+ /**
+ * Setter for InResponseTo.
+ *
+ * @param inResponseTo The Saml's response id.
+ */
+ void setInResponseTo(String inResponseTo);
+
+ /**
+ * Getter for InResponseToSPReq.
+ *
+ * @return The InResponseToSPReq value.
+ */
+ String getInResponseToSPReq();
+
+ /**
+ * Setter for InResponseToSPRequ.
+ *
+ * @param inResponseToSPReq The Saml's response id.
+ */
+ void setInResponseToSPReq(String inResponseToSPReq);
+
+ /**
+ * Getter for opType.
+ *
+ * @return The opType value.
+ */
+ String getOpType();
+
+ /**
+ * Setter for opType.
+ *
+ * @param opType The operation type.
+ */
+ void setOpType(String opType);
+
+ /**
+ * Getter for destination.
+ *
+ * @return The destination value.
+ */
+ String getDestination();
+
+ /**
+ * Setter for destinationIp.
+ *
+ * @param destination The remote IP.
+ */
+ void setDestination(String destination);
+
+ /**
+ * Getter for message or assertion consumer.
+ *
+ * @return The message or assertion consumer.
+ */
+ String getMessage();
+
+ /**
+ * Setter for message or assertion consumer.
+ *
+ * @param message or assertion consumer.
+ */
+ void setMessage(String message);
+
+ /**
+ * Getter for country.
+ *
+ * @return The country value.
+ */
+ String getCountry();
+
+ /**
+ * Setter for country.
+ *
+ * @param country The country.
+ */
+ void setCountry(String country);
+
+ /**
+ * Getter for samlHash.
+ *
+ * @return The samlHash value.
+ */
+ byte[] getSamlHash();
+
+ /**
+ * Setter for samlHash.
+ *
+ * @param samlHash the encrypted SAML token
+ */
+ void setSamlHash(byte[] samlHash);
+
+ /**
+ * Getter for msgId.
+ *
+ * @return the msgId
+ */
+ String getMsgId();
+
+ /**
+ * Setter for msgId.
+ *
+ * @param msgId the ID of the originator of this message
+ */
+ void setMsgId(String msgId);
+
+ /**
+ * Getter for sPMsgId.
+ *
+ * @return the sPMsgId
+ */
+ String getSPMsgId();
+
+ /**
+ * Setter for sPMsgId.
+ *
+ * @param sPMsgId the ID of the originator of this message
+ */
+ void setSPMsgId(String sPMsgId);
+
+ /**
+ * The format of the returned String must be the following:
+ * "requestCounter#ddMMMyyyykk:mm:ss#opType#originIp#originName
+ * #destinationIp#destinationName#samlHash#[originatorName#msgId#]"
+ *
+ * The values enclosed in '[]' only apply when logging responses.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ String toString();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base
new file mode 100644
index 000000000..f38b41838
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/IStorkSession.java.svn-base
@@ -0,0 +1,85 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork session.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public interface IStorkSession {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ Object get(Object key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(String key, Object value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object remove(Object key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base
new file mode 100644
index 000000000..6e7c891da
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/Linker.java.svn-base
@@ -0,0 +1,316 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information of Attribute Providers, the Attribute
+ * List to be requested, the Assertions returned by the Attribute Providers and the values
+ * that each Attribute has. This information along with the current status of the Linker (the
+ * attribute providers that were queried and the remaining providers) is used by the PEPS
+ * actions in order to complete the Attribute gathering.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.50 $, $Date: 2013-11-28 $
+ */
+public final class Linker implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -3268006381745987237L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(Linker.class.getName());
+
+ /**
+ * Attributes Providers map.
+ */
+ private IAttributeProvidersMap attributeProvidersMap;
+
+ /**
+ * Assertion map.
+ */
+ private LinkedHashMap<AttributeSource, STORKAttrQueryResponse> assertions;
+
+ /**
+ * The current index of local (domestic) Attribute Providers.
+ */
+ private int localIndex;
+
+ /**
+ * The current index of remote (foreign) Attribute Providers - countries.
+ */
+ private int remoteIndex;
+
+ /**
+ * Constructs an empty Linker object.
+ */
+ public Linker() {
+ localIndex = 0;
+ remoteIndex = 0;
+
+ assertions = new LinkedHashMap<AttributeSource, STORKAttrQueryResponse>();
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next local Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextLocalProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap!=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( curIndex>=localIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next remote Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextRemoteProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( curIndex>=remoteIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * It updates the Linker with the values returned by the Attribute Source. It also advances
+ * to the next index in order to mark this attribute source as completed.
+ *
+ * @param source The Attribute Source that was queried for attribute values.
+ * @param attrResponse The attrResponse returned by the Attribute Source that contains the attribute values.
+ *
+ * @see AttributeSource, STORKAttrQueryResponse
+ */
+ public void setProviderReponse(AttributeSource source, STORKAttrQueryResponse attrResponse) {
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ //Assertion storage
+ this.assertions.put(source, attrResponse);
+
+ this.attributeProvidersMap.put(source, attrResponse.getPersonalAttributeList());
+ //this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
+ }
+
+ /**
+ * Reset the internal state of the local Attribute Source in order to start over.
+ */
+ public void resetLocalIndex() {
+ localIndex = 0;
+ }
+
+ /**
+ * Reset the internal state of the remote Attribute Source in order to start over.
+ */
+ public void resetRemoteIndex() {
+ remoteIndex = 0;
+ }
+
+ /**
+ * Setter for attributeProvidersMap.
+ *
+ * @param attributeProvidersMap The attributeProvidersMap to set.
+ */
+ public void setAttributeProvidersMap(IAttributeProvidersMap attributeProvidersMap) {
+ this.attributeProvidersMap = attributeProvidersMap;
+ }
+
+ /**
+ * Getter for attributeProvidersMap.
+ *
+ * @return attributeProvidersMap
+ */
+ public IAttributeProvidersMap getAttributeProvidersMap() {
+ return attributeProvidersMap;
+ }
+
+ /**
+ * Returns the Personal Attribute list of the provided Attribute Source.
+ *
+ * @param source The attributeSource in reference
+ *
+ * @return The IPersonalAttributeList assosiated with this source or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getProviderAttributes(AttributeSource source) {
+ if ( attributeProvidersMap.containsKey(source) )
+ return attributeProvidersMap.get(source);
+ else
+ return null;
+ }
+
+ /**
+ * Returns the merged Personal Attribute list from all the Attribute Sources.
+ *
+ * @return The IPersonalAttributeList merged Personal Attribute list or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getAllAttributes() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source;
+ IPersonalAttributeList list, merged;
+
+ merged = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+
+ merged = new PersonalAttributeList();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+ list = this.getProviderAttributes(source);
+
+ for (final PersonalAttribute pa : list) {
+ merged.add(pa);
+ }
+ }
+ }
+
+ return merged;
+ }
+
+ /**
+ * Returns a List with all the assertions gathered by the AAS-PEPS module
+ * returned both by local APs or remote A-PEPS.
+ *
+ * @return The assertions returned from the APs and A-PEPS
+ */
+ public List<STORKAttrQueryResponse> getAttrQueryResponseList() {
+ List<STORKAttrQueryResponse> originalAssertions;
+
+ originalAssertions = new ArrayList<STORKAttrQueryResponse>();
+
+ //Gather all assertions
+ for (STORKAttrQueryResponse element : this.assertions.values()) {
+ originalAssertions.add(element);
+ }
+
+ return originalAssertions;
+ }
+
+ /**
+ * Checks the internal state of the Linker and if all Attribute Sources where visited
+ * returns true, otherwise it returns false. So if you go directly from AtPLinkerAction
+ * to MoreAttributesAction the call will have, since the method setProviderReponse
+ * was not executed from every Attribute Source.
+ *
+ * @return true if everything is OK, false otherwise
+ */
+ public boolean isComplete() {
+ boolean outcome = false;
+
+ LOG.debug("Check if linkder is complete: R[" + remoteIndex + "], L[" + localIndex + "], S[" + attributeProvidersMap.size() + "]");
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ if ( (remoteIndex + localIndex)==attributeProvidersMap.size() )
+ outcome = true;
+ }
+ else {
+ outcome = true;
+ }
+
+ return outcome;
+ }
+
+ /**
+ * Merge the two Linker objects.
+ *
+ * @param previous The other Linker object to merge with this one.
+ */
+ public void mergeWith(Linker previous) {
+ //BEFORE
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap from the current object.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ LOG.debug("The attributeProvidersMap from the provided object.");
+ ((AttributeProvidersMap)previous.getAttributeProvidersMap()).trace();
+ }
+
+ IAttributeProvidersMap map = previous.getAttributeProvidersMap();
+ Iterator<AttributeSource> items = map.keyIterator();
+ while( items.hasNext() ) {
+ AttributeSource item = items.next();
+ IPersonalAttributeList pal = map.get(item);
+
+ if ( this.attributeProvidersMap.containsKey(item) ) {
+ IPersonalAttributeList new_pal = this.attributeProvidersMap.get(item);
+
+ for(PersonalAttribute pa : pal)
+ new_pal.add(pa);
+ }
+ else {
+ if ( item.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ this.attributeProvidersMap.put(item, pal);
+ }
+ }
+
+ //AFTER
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap after the merge.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ }
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base
new file mode 100644
index 000000000..5da9ba494
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSErrors.java.svn-base
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public enum PEPSErrors {
+
+ /**
+ * Represents the 'authenticationFailed' constant error identifier.
+ */
+ AUTHENTICATION_FAILED_ERROR("authenticationFailed"),
+ /**
+ * Represents the 'spCountrySelector.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_ERROR_CREATE_SAML("spCountrySelector.errorCreatingSAML"),
+ /**
+ * Represents the 'spCountrySelector.destNull' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_DESTNULL("spCountrySelector.destNull"),
+ /**
+ * Represents the 'spCountrySelector.invalidAttr' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_ATTR("spCountrySelector.invalidAttr"),
+ /**
+ * Represents the 'spCountrySelector.invalidProviderName' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_PROVIDER_NAME(
+ "spCountrySelector.invalidProviderName"),
+ /**
+ * Represents the 'spCountrySelector.invalidQaaSPid' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_QAASPID("spCountrySelector.invalidQaaSPid"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpId' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPID("spCountrySelector.invalidSpId"),
+ /**
+ * Represents the 'spCountrySelector.invalidSPQAA' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPQAA("spCountrySelector.invalidSPQAA"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpURL' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPURL("spCountrySelector.invalidSpURL"),
+ /**
+ * Represents the 'spCountrySelector.spNotAllowed' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_SPNOTALLOWED("spCountrySelector.spNotAllowed"),
+
+ /**
+ * Represents the 'sProviderAction.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_ERROR_CREATE_SAML("sProviderAction.errorCreatingSAML"),
+ /**
+ * Represents the 'sProviderAction.attr' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_ATTR("sProviderAction.invalidAttr"),
+ /**
+ * Represents the 'sProviderAction.country' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_COUNTRY("sProviderAction.invalidCountry"),
+ /**
+ * Represents the 'sProviderAction.relayState' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_RELAY_STATE("sProviderAction.invalidRelayState"),
+ /**
+ * Represents the 'sProviderAction.saml' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SAML("sProviderAction.invalidSaml"),
+ /**
+ * Represents the 'sProviderAction.spAlias' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPALIAS("sProviderAction.invalidSPAlias"),
+ /**
+ * Represents the 'sProviderAction.spDomain' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPDOMAIN("sProviderAction.invalidSPDomain"),
+ /**
+ * Represents the 'sProviderAction.spId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPID("sProviderAction.invalidSPId"),
+ /**
+ * Represents the 'sProviderAction.spQAA' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAA("sProviderAction.invalidSPQAA"),
+ /**
+ * Represents the 'sProviderAction.spQAAId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAAID("sProviderAction.invalidSPQAAId"),
+ /**
+ * Represents the 'sProviderAction.spRedirect' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPREDIRECT("sProviderAction.invalidSPRedirect"),
+ /**
+ * Represents the 'sPPowerValidationAction.invalidSPPVAttrList' constant error identifier.
+ */
+ SPPOWERVALIDATION_SELECTOR_INVALID_SP_PV_ATTR_LIST("sPPowerValidationAction.invalidSPPVAttrList"),
+
+ /**
+ * Represents the 'sProviderAction.invalidSPProviderName' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SP_PROVIDERNAME(
+ "sProviderAction.invalidSPProviderName"),
+ /**
+ * Represents the 'sProviderAction.spNotAllowed' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_SPNOTALLOWED("sProviderAction.spNotAllowed"),
+
+
+ /**
+ * Represents the 'internalError' constant error identifier.
+ */
+ INTERNAL_ERROR("internalError"),
+
+ /**
+ * Represents the 'colleagueRequest.attrNull' constant error identifier.
+ */
+ COLLEAGUE_REQ_ATTR_NULL("colleagueRequest.attrNull"),
+ /**
+ * Represents the 'colleagueRequest.errorCreatingSAML' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_ERROR_CREATE_SAML("colleagueRequest.errorCreatingSAML"),
+ /**
+ * Represents the 'colleagueRequest.invalidCountryCode' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_COUNTRYCODE("colleagueRequest.invalidCountryCode"),
+ /**
+ * Represents the 'colleagueRequest.invalidDestUrl' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_DEST_URL("colleagueRequest.invalidDestUrl"),
+ /**
+ * Represents the 'colleagueRequest.invalidQaa' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_QAA("colleagueRequest.invalidQaa"),
+ /**
+ * Represents the 'colleagueRequest.invalidRedirect' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_REDIRECT("colleagueRequest.invalidRedirect"),
+ /**
+ * Represents the 'colleagueRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_SAML("colleagueRequest.invalidSAML"),
+
+ /**
+ * Represents the 'colleaguePVRequest.invalidPVAttrList' constant error identifier.
+ */
+ COLLEAGUE_PV_REQ_INVALID_PV_ATTR_LIST("colleaguePVRequest.invalidPVAttrList"),
+
+
+ /**
+ * Represents the 'cpepsRedirectUrl' constant error identifier.
+ */
+ CPEPS_REDIRECT_URL("cpepsRedirectUrl"),
+ /**
+ * Represents the 'spepsRedirectUrl' constant error identifier.
+ */
+ SPEPS_REDIRECT_URL("spepsRedirectUrl"),
+ /**
+ * Represents the 'sProviderAction.invCountry' constant error identifier.
+ */
+ SP_ACTION_INV_COUNTRY("sProviderAction.invCountry"),
+
+ /**
+ * Represents the 'providernameAlias.invalid' constant error identifier.
+ */
+ PROVIDER_ALIAS_INVALID("providernameAlias.invalid"),
+
+
+ /**
+ * Represents the 'cPeps.attrNull' constant error identifier.
+ */
+ CPEPS_ATTR_NULL("cPeps.attrNull"),
+
+ /**
+ * Represents the 'colleagueResponse.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_RESP_INVALID_SAML("colleagueResponse.invalidSAML"),
+
+ /**
+ * Represents the 'citizenNoConsent.mandatory' constant error identifier.
+ */
+ CITIZEN_NO_CONSENT_MANDATORY("citizenNoConsent.mandatory"),
+ /**
+ * Represents the 'citizenResponse.mandatory' constant error identifier.
+ */
+ CITIZEN_RESPONSE_MANDATORY("citizenResponse.mandatory"),
+ /**
+ * Represents the 'attVerification.mandatory' constant error identifier.
+ */
+ ATT_VERIFICATION_MANDATORY("attVerification.mandatory"),
+ /**
+ * Represents the 'attrValue.verification' constant error identifier.
+ */
+ ATTR_VALUE_VERIFICATION("attrValue.verification"),
+
+ /**
+ * Represents the 'audienceRestrictionError' constant error identifier.
+ */
+ AUDIENCE_RESTRICTION("audienceRestrictionError"),
+ /**
+ * Represents the 'auRequestIdError' constant error identifier.
+ */
+ AU_REQUEST_ID("auRequestIdError"),
+ /**
+ * Represents the 'domain' constant error identifier.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the 'hash.error' constant error identifier.
+ */
+ HASH_ERROR("hash.error"),
+ /**
+ * Represents the 'invalidAttributeList' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_LIST("invalidAttributeList"),
+ /**
+ * Represents the 'invalidAttributeValue' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_VALUE("invalidAttributeValue"),
+ /**
+ * Represents the 'qaaLevel' constant error identifier.
+ */
+ QAALEVEL("qaaLevel"),
+ /**
+ * Represents the 'requests' constant error identifier.
+ */
+ REQUESTS("requests"),
+ /**
+ * Represents the 'SPSAMLRequest' constant error identifier.
+ */
+ SP_SAML_REQUEST("SPSAMLRequest"),
+ /**
+ * Represents the 'spepsSAMLRequest' constant error identifier.
+ */
+ SPEPS_SAML_REQUEST("spepsSAMLRequest"),
+ /**
+ * Represents the 'IdPSAMLResponse' constant error identifier.
+ */
+ IDP_SAML_RESPONSE("IdPSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ CPEPS_SAML_RESPONSE("cpepsSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ SPEPS_SAML_RESPONSE("spepsSAMLResponse"),
+ /**
+ * Represents the 'session' constant error identifier.
+ */
+ SESSION("session"),
+ /**
+ * Represents the 'invalid.session' constant error identifier.
+ */
+ INVALID_SESSION("invalid.session"),
+ /**
+ * Represents the 'invalid.sessionId' constant error identifier.
+ */
+ INVALID_SESSION_ID("invalid.sessionId"),
+ /**
+ * Represents the 'missing.sessionId' constant error identifier.
+ */
+ MISSING_SESSION_ID("sessionError"),
+ /**
+ * Represents the 'missing.mandate' constant error identifier.
+ */
+ MISSING_MANDATE("missing.mandate"),
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_SAML_RESPONSE("AtPSAMLResponse"),
+
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_RESPONSE_ERROR("atp.response.error"),
+
+ /**
+ * Represents the 'apepsSAMLRequest' constant error identifier.
+ */
+ APEPS_SAML_REQUEST("apepsSAMLRequest"),
+
+ /**
+ * Represents the 'apepsSAMLResponse' constant error identifier.
+ */
+ APEPS_SAML_RESPONSE("apepsSAMLResponse"),
+
+ /**
+ * Represents the 'invalid.apepsRedirectUrl' constant error identifier.
+ */
+ INVALID_APEPS_REDIRECT_URL("invalid.apepsRedirectUrl"),
+
+ /**
+ * Represents the 'invalid.apepsCallbackUrl' constant error identifier.
+ */
+ INVALID_APEPS_CALLBACK_URL("invalid.apepsCallbackUrl"),
+
+ /**
+ * Represents the 'colleagueAttributeRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_ATTR_REQ_INVALID_SAML("colleagueAttributeRequest.invalidSAML");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String error;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nError The Constant error value.
+ */
+ PEPSErrors(final String nError) {
+ this.error = nError;
+ }
+
+ /**
+ * Construct the errorCode Constant value.
+ *
+ * @return The errorCode Constant.
+ */
+ public String errorCode() {
+ return error + ".code";
+ }
+
+ /**
+ * Construct the errorCode Constant value with the given code text.
+ *
+ * @param text the code text to append to the constant.
+ *
+ * @return The errorCode Constant for the given code text.
+ */
+ public String errorCode(final String text) {
+ return error + "." + text + ".code";
+ }
+
+ /**
+ * Construct the errorMessage constant value.
+ *
+ * @return The errorMessage constant.
+ */
+ public String errorMessage() {
+ return error + ".message";
+ }
+
+ /**
+ * Construct the errorMessage Constant value with the given message text.
+ *
+ * @param text the message text to append to the constant.
+ *
+ * @return The errorMessage Constant for the given text.
+ */
+ public String errorMessage(final String text) {
+ return error + "." + text + ".message";
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return error;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base
new file mode 100644
index 000000000..15c2ae552
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSParameters.java.svn-base
@@ -0,0 +1,625 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific Parameters.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSParameters {
+
+ /**
+ * Represents the 'apId' parameter constant.
+ */
+ AP_ID("apId"),
+ /**
+ * Represents the 'apUrl' parameter constant.
+ */
+ AP_URL("apUrl"),
+ /**
+ * Represents the 'ap.number' parameter constant.
+ */
+ AP_NUMBER("ap.number"),
+
+ /**
+ * Represents the 'assertionConsumerServiceURL' parameter constant.
+ */
+ ASSERTION_CONSUMER_S_URL("assertionConsumerServiceURL"),
+
+ /**
+ * Represents the 'auth' parameter constant.
+ */
+ AUTHENTICATION("auth"),
+
+ /**
+ * Represents the 'attr' parameter constant.
+ */
+ ATTRIBUTE("attr"),
+ /**
+ * Represents the 'attrName' parameter constant.
+ */
+ ATTRIBUTE_NAME("attrName"),
+ /**
+ * Represents the 'attrStatus' parameter constant.
+ */
+ ATTRIBUTE_STATUS("attrStatus"),
+ /**
+ * Represents the 'attrType' parameter constant.
+ */
+ ATTRIBUTE_TYPE("attrType"),
+ /**
+ * Represents the 'attrValue' parameter constant.
+ */
+ ATTRIBUTE_VALUE("attrValue"),
+ /**
+ * Represents the 'attrList' parameter constant.
+ */
+ ATTRIBUTE_LIST("attrList"),
+ /**
+ * Represents the 'apMandAttrList' parameter constant.
+ */
+ AP_MANDATORY_ATTRIBUTE_LIST("apMandAttrList"),
+ /**
+ * Represents the 'attrTuple' parameter constant.
+ */
+ ATTRIBUTE_TUPLE("attrTuple"),
+ /**
+ * Represents the 'attribute-missing' parameter constant.
+ */
+ ATTRIBUTE_MISSING("attribute-missing"),
+ /**
+ * Represents the 'attributesNotAllowed' parameter constant.
+ */
+ ATTRIBUTES_NOT_ALLOWED("attributesNotAllowed"),
+ /**
+ * Represents the 'authnRequest' parameter constant.
+ */
+ AUTH_REQUEST("authnRequest"),
+
+ /**
+ * Represents the 'attrValue.number' parameter constant.
+ */
+ ATTR_VALUE_NUMBER("attrValue.number"),
+
+ /**
+ * Represents the 'derivation.date.format' parameter constant.
+ */
+ DERIVATION_DATE_FORMAT("derivation.date.format"),
+ /**
+ * Represents the 'deriveAttr.number' parameter constant.
+ */
+ DERIVE_ATTRIBUTE_NUMBER("deriveAttr.number"),
+
+ /**
+ * Represents the complex attributes parameter constant.
+ */
+ COMPLEX_ADDRESS_VALUE("canonicalResidenceAddress"),
+ COMPLEX_NEWATTRIBUTE_VALUE("newAttribute2"),
+ COMPLEX_HASDEGREE_VALUE("hasDegree"),
+ COMPLEX_MANDATECONTENT_VALUE("mandateContent"),
+ /**
+ * Represents the 'consent-type' parameter constant.
+ */
+ CONSENT_TYPE("consent-type"),
+ /**
+ * Represents the 'consent-value' parameter constant.
+ */
+ CONSENT_VALUE("consent-value"),
+ /**
+ * Represents the 'country' parameter constant.
+ */
+ COUNTRY("country"),
+ /**
+ * Represents the 'countryOrigin' parameter constant.
+ */
+ COUNTRY_ORIGIN("countryOrigin"),
+
+ /**
+ * Represents the 'cpepsURL' parameter constant.
+ */
+ CPEPS_URL("cpepsURL"),
+ /**
+ * Represents the 'callback' parameter constant.
+ */
+ CPEPS_CALLBACK("callback"),
+ /**
+ * Represents the 'peps.specificidpredirect.url' parameter constant.
+ */
+ CPEPS_IDP_CALLBACK_VALUE("peps.specificidpredirect.url"),
+ /**
+ * Represents the 'peps.specificapredirect.url' parameter constant.
+ */
+ CPEPS_AP_CALLBACK_VALUE("peps.specificapredirect.url"),
+
+ /**
+ * Represents the 'errorCode' parameter constant.
+ */
+ ERROR_CODE("errorCode"),
+ /**
+ * Represents the 'subCode' parameter constant.
+ */
+ ERROR_SUBCODE("subCode"),
+ /**
+ * Represents the 'errorMessage' parameter constant.
+ */
+ ERROR_MESSAGE("errorMessage"),
+ /**
+ * Represents the 'errorRedirectUrl' parameter constant.
+ */
+ ERROR_REDIRECT_URL("errorRedirectUrl"),
+
+ /**
+ * errorRedirectUrl Represents the 'external-authentication' parameter
+ * constant.
+ */
+ EXTERNAL_AUTH("external-authentication"),
+ /**
+ * Represents the 'external-ap' parameter constant.
+ */
+ EXTERNAL_AP("external-ap"),
+ /**
+ * Represents the 'external-pv' parameter constant.
+ */
+ EXTERNAL_PV("external-pv"),
+ /**
+ * Represents the 'external-sig-module' parameter constant.
+ */
+ EXT_SIG_CREATOR_MOD("external-sig-module"),
+
+ /**
+ * Represents the 'http-x-forwarded-for' parameter constant.
+ */
+ HTTP_X_FORWARDED_FOR("http-x-forwarded-for"),
+
+ /**
+ * Represents the 'idp.url' parameter constant.
+ */
+ IDP_URL("idp.url"),
+ /**
+ * Represents the 'internal-authentication' parameter constant.
+ */
+ INTERNAL_AUTH("internal-authentication"),
+ /**
+ * Represents the 'internal-ap' parameter constant.
+ */
+ INTERNAL_AP("internal-ap"),
+ /**
+ * Represents the 'internal-pv' parameter constant.
+ */
+ INTERNAL_PV("internal-pv"),
+
+ /**
+ * Represents the 'samlIssuer' parameter constant.
+ */
+ ISSUER("samlIssuer"),
+ /**
+ * Represents the 'samlIssuer.idp' parameter constant.
+ */
+ ISSUER_IDP("samlIssuer.idp"),
+ /**
+ * Represents the 'samlIssuer.atp' parameter constant.
+ */
+ ISSUER_ATP("samlIssuer.atp"),
+
+ /**
+ * Represents the 'mandatory' parameter constant.
+ */
+ MANDATORY("mandatory"),
+ /**
+ * Represents the 'mandatoryAttributeMissing' parameter constant.
+ */
+ MANDATORY_ATTR_MISSING("mandatoryAttributeMissing"),
+ /**
+ * Represents the 'mandatoryConsentAttrMissing' parameter constant.
+ */
+ MANDATORY_CONSENT_MISSING("mandatoryConsentAttrMissing"),
+ /**
+ * Represents the 'missing-attrs' parameter constant.
+ */
+ MISSING_ATTRS("missing-attrs"),
+ /**
+ * Represents the 'no-more-attrs' parameter constant.
+ */
+ NO_MORE_ATTRS("no-more-attrs"),
+
+ /**
+ * Represents the 'optional' parameter constant.
+ */
+ OPTIONAL("optional"),
+
+ /**
+ * Represents the 'no-consent-type' parameter constant.
+ */
+ NO_CONSENT_TYPE("no-consent-type"),
+ /**
+ * Represents the 'no-consent-value' parameter constant.
+ */
+ NO_CONSENT_VALUE("no-consent-value"),
+
+ /**
+ * Represents the 'provider.name' parameter constant.
+ */
+ PROVIDER_NAME_VALUE("providerName"),
+ /**
+ * Represents the 'cpeps.askconsent' parameter constant.
+ */
+ PEPS_ASK_CONSENT("cpeps.askconsent"),
+ /**
+ * Represents the 'cpeps.askconsentvalue' parameter constant.
+ */
+ PEPS_ASK_CONSENT_VALUE("cpeps.askconsentvalue"),
+ /**
+ * Represents the 'pepsAuth' parameter constant.
+ */
+ PEPS_AUTH_CONSENT("pepsAuth"),
+ /**
+ * Represents the 'validation.bypass' parameter constant.
+ */
+ PEPS_BYPASS("validation.bypass"),
+ /**
+ * Represents the 'cpeps.number' parameter constant.
+ */
+ PEPS_NUMBER("cpeps.number"),
+ /**
+ * Represents the 'cpeps.specificapredirect.url' parameter constant.
+ */
+ PEPS_SPECIFIC_URL("cpeps.specificapredirect.url"),
+ /**
+ * Represents the 'pv.url' parameter constant.
+ */
+ PV_URL("pv.url"),
+
+ /**
+ * Represents the 'qaaLevel' parameter constant.
+ */
+ QAALEVEL("qaaLevel"),
+
+ /**
+ * Represents the 'speps.redirectUrl' parameter constant.
+ */
+ SPEPS_REDIRECT_URL("speps.redirectUrl"),
+
+ /**
+ * Represents the 'sp.redirectUrl' parameter constant.
+ */
+ SP_REDIRECT_URL("sp.redirectUrl"),
+ /**
+ * Represents the 'cpeps.redirectUrl' parameter constant.
+ */
+ CPEPS_REDIRECT_URL("cpeps.redirectUrl"),
+ /**
+ * Represents the 'RelayState' parameter constant.
+ */
+ RELAY_STATE("RelayState"),
+ /**
+ * Represents the 'remoteAddr' parameter constant.
+ */
+ REMOTE_ADDR("remoteAddr"),
+ /**
+ * Represents the 'remoteUser' parameter constant.
+ */
+ REMOTE_USER("remoteUser"),
+
+ /**
+ * Represents the 'SAMLRequest' parameter constant.
+ */
+ SAML_REQUEST("SAMLRequest"),
+ /**
+ * Represents the 'SAMLResponse' parameter constant.
+ */
+ SAML_RESPONSE("SAMLResponse"),
+ /**
+ * Represents the 'SAMLFail' parameter constant.
+ */
+ SAML_TOKEN_FAIL("SAMLFail"),
+ /**
+ * Represents the 'TokenId' parameter constant.
+ */
+ SAML_TOKEN_ID("TokenId"),
+ /**
+ * Represents the 'inResponseTo' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO("inResponseTo"),
+ /**
+ * Represents the 'inResponseTo.idp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_IDP("inResponseTo.idp"),
+ /**
+ * Represents the 'inResponseTo.atp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_ATP("inResponseTo.atp"),
+ /**
+ * Represents the 'SignatureResponse' parameter constant.
+ */
+ SIGNATURE_RESPONSE("SignatureResponse"),
+
+ /**
+ * Represents the 'cPepsSession' parameter constant.
+ */
+ SESSION_ID_URL("cPepsSession"),
+ /**
+ * Represents the 'spId' parameter constant.
+ */
+ SP_ID("spId"),
+ /**
+ * Represents the 'spQaaLevel' parameter constant.
+ */
+ SP_QAALEVEL("spQaaLevel"),
+ /**
+ * Represents the 'spUrl' parameter constant.
+ */
+ SP_URL("spUrl"),
+
+ /**
+ * Represents the 'allow.derivation.all' parameter constant.
+ */
+ SPECIFIC_ALLOW_DERIVATION_ALL("allow.derivation.all"),
+ /**
+ * Represents the ''allow.unknowns parameter constant.
+ */
+ SPECIFIC_ALLOW_UNKNOWNS("allow.unknowns"),
+ /**
+ * Represents the 'derivation.date.separator' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DATE_SEP("derivation.date.separator"),
+ /**
+ * Represents the 'derivation.month.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_MONTH_POS("derivation.month.position"),
+ /**
+ * Represents the 'derivation.day.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DAY_POS("derivation.day.position"),
+ /**
+ * Represents the 'derivation.year.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_YEAR_POS("derivation.year.position"),
+
+ /**
+ * sp.authorized.parameters Represents the '' parameter constant.
+ */
+ SPEPS_AUTHORIZED("sp.authorized.parameters"),
+
+ /**
+ * Represents the 'spSector' constant value.
+ */
+ SPSECTOR("spSector"),
+ /**
+ * Represents the 'spApplication' constant value.
+ */
+ SPAPPLICATION("spApplication"),
+ /**
+ * Represents the 'spCountry' constant value.
+ */
+ SPCOUNTRY("spCountry"),
+ /**
+ * Represents the 'spInstitution' constant value.
+ */
+ SPINSTITUTION("spInstitution"),
+ /**
+ * Represents the 'storkAttribute.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_NUMBER("storkAttribute.number"),
+ /**
+ * Represents the 'storkAttributeValue.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_VALUE_NUMBER("storkAttributeValue.number"),
+
+ /**
+ * Represents the 'username' parameter constant.
+ */
+ USERNAME("username"),
+
+ /**
+ * Represents the 'tooManyParameters' parameter constant.
+ */
+ TOO_MANY_PARAMETERS("tooManyParameters"),
+ /**
+ * Represents the 'validation.active' parameter constant.
+ */
+ VALIDATION_ACTIVE("validation.active"),
+
+ /**
+ * Represents the 'x-forwarded-for' parameter constant.
+ */
+ X_FORWARDED_FOR("x-forwarded-for"),
+ /**
+ * Represents the 'x-forwarded-host' parameter constant.
+ */
+ X_FORWARDED_HOST("x-forwarded-host"),
+ /**
+ * Represents the 'XMLResponse' parameter constant.
+ */
+ XML_RESPONSE("XMLResponse"),
+
+ /**
+ * Represents the 'ap-cpeps.number' parameter constant.
+ */
+ AP_PEPS_NUMBER("ap-cpeps.number"),
+
+ /**
+ * Represents the 'atp.number' parameter constant.
+ */
+ ATTRIBUTE_PROVIDER_NUMBER("atp.number"),
+
+ /**
+ * Represents the 'atn.number' parameter constant.
+ */
+ ATTRIBUTE_NAME_NUMBER("atn.number"),
+
+ /**
+ * Represents the 'apLinker' parameter constant.
+ */
+ AP_LINKER("apLinker"),
+
+ /**
+ * Represents the 'prevApLinker' parameter constant.
+ */
+ PREV_AP_LINKER("prevApLinker"),
+
+ /**
+ * Represents the 'NOSEL' parameter constant (no attribute provider selected).
+ */
+ AP_NO_SELECTION("NOSEL"),
+
+ /**
+ * Represents the 'OCSEL' parameter constant (attribute provider in another country).
+ */
+ AP_OTHER_COUNTRY("OCSEL"),
+
+ /**
+ * Represents the '_provider' suffix parameter constant.
+ */
+ AP_PROVIDER_SELECT_SUFFIX("_provider"),
+
+ /**
+ * Represents the '_country' suffix parameter constant.
+ */
+ AP_COUNTRY_SELECT_SUFFIX("_country"),
+
+ /**
+ * Represents the '_name' suffix parameter constant.
+ */
+ AP_NAME_SELECT_SUFFIX("_name"),
+
+ /**
+ * Represents the 'next-ap' parameter constant.
+ */
+ NEXT_AP("next-ap"),
+
+ /**
+ * Represents the 'next-apeps' parameter constant.
+ */
+ NEXT_APEPS("next-apeps"),
+
+ /**
+ * Represents the 'back-to-apeps' parameter constant.
+ */
+ BACK_TO_APEPS("back-to-apeps"),
+
+ /**
+ * Represents the 'is-remote-apeps' parameter constant.
+ */
+ IS_REMOTE_APEPS("is-remote-apeps"),
+
+ /**
+ * Represents the 'more-attributes' parameter constant.
+ */
+ MORE_ATTRIBUTES("more-attributes"),
+
+ /**
+ * Represents the 'attr-filter.number' parameter constant.
+ */
+ ATTRIBUTES_FILTER_NUMBER("attr-filter.number"),
+
+ /**
+ * Represents the 'attr-group' parameter constant.
+ */
+ ATTRIBUTE_GROUPS("attr-group"),
+
+ /**
+ * Represents the 'all' parameter constant for attribute groups.
+ */
+ ATTRIBUTE_GROUPS_ALL("all"),
+
+ /**
+ * Represents the 'none' parameter constant for attribute groups.
+ */
+ ATTRIBUTE_GROUPS_NONE("none"),
+
+ /**
+ * Represents the 'atp.url' parameter constant.
+ */
+ ATP_URL("atp.url"),
+ /**
+ * Represents the 'apepsURL' parameter constant.
+ */
+ APEPS_URL("apepsUrl"),
+
+ /**
+ * Represents the 'apepsCountry' parameter constant.
+ */
+ APEPS_COUNTRY("apepsCountry"),
+
+ /**
+ * Represents the 'apepsAuthRequest' parameter constant.
+ */
+ APEPS_ATTR_REQUEST("apepsAttrRequest"),
+
+ /**
+ * Represents the 'isApepsRequest' parameter constant.
+ */
+ APEPS_REQUEST_COMPLETE("apeps-request-complete"),
+
+ /**
+ * Represents the 'apeps.callbackUrl' parameter constant.
+ */
+ APEPS_CALLBACK_URL("apeps.callbackUrl"),
+ /**
+ * Represents the 'attrListMand' parameter constant.
+ */
+ ATTR_LIST_MAND("attrListMand"),
+
+ /**
+ * Represents the 'attrListOpt' parameter constant.
+ */
+ ATTR_LIST_OPT("attrListOpt"),
+
+ /**
+ * Represents the 'simpleAttrListMand' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_MAND("simpleAttrListMand"),
+
+ /**
+ * Represents the 'simpleAttrListOpt' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_OPT("simpleAttrListOpt"),
+
+ /**
+ * Represents the 'complexAttrListMand' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_MAND("complexAttrListMand"),
+
+ /**
+ * Represents the 'complexAttrListOpt' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_OPT("complexAttrListOpt");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nValue The Constant value.
+ */
+ PEPSParameters(final String nValue) {
+ this.value = nValue;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base
new file mode 100644
index 000000000..69729c0bb
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSUtil.java.svn-base
@@ -0,0 +1,391 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.crypto.Digest;
+import org.bouncycastle.util.encoders.Base64;
+import org.bouncycastle.util.encoders.UrlBase64;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.75 $, $Date: 2010-11-23 00:05:35 $
+ */
+public final class PEPSUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PEPSUtil.class.getName());
+
+ /**
+ * Configurations object.
+ */
+ private static Properties configs;
+
+ /**
+ * Max prefix.
+ */
+ private static final String MAX_PARAM_PREFIX = "max.";
+
+ /**
+ * Code prefix to get error code.
+ */
+ private static final String CODE_PARAM_SUFFIX = ".code";
+
+ /**
+ * param's size prefix to get max param size.
+ */
+ private static final String MAX_PARAM_SUFFIX = ".size";
+
+ /**
+ * Message prefix to get error message.
+ */
+ private static final String MSG_PARAM_SUFFIX = ".message";
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private PEPSUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Creates a single instance of this class and sets the properties.
+ *
+ * @param nConfigs The set of available configurations.
+ *
+ * @return The created PEPSUtil's class.
+ */
+ public static PEPSUtil createInstance(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ return new PEPSUtil();
+ }
+
+ /**
+ * Getter for the Properties.
+ *
+ * @return configs The properties value.
+ */
+ public Properties getConfigs() {
+ return configs;
+ }
+
+ /**
+ * Setter for the Properties.
+ *
+ * @param nConfigs The new properties value.
+ */
+ public static void setConfigs(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ }
+
+ /**
+ * Returns the identifier of some configuration given a set of configurations
+ * and the corresponding configuration key.
+ *
+ * @param configKey The key that IDs some configuration.
+ *
+ * @return The configuration String value.
+ */
+ public static String getConfig(final String configKey) {
+ return configs.getProperty(configKey);
+ }
+
+ /**
+ * Validates the input paramValue identified by the paramName.
+ *
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ *
+ * @return true if the parameter is valid.
+ */
+ public static boolean isValidParameter(final String paramName,
+ final String paramValue) {
+
+ final String validationParam =
+ PEPSUtil.getConfig(PEPSParameters.VALIDATION_ACTIVE.toString());
+ boolean retVal = true;
+
+ final String paramConf = MAX_PARAM_PREFIX + paramName + MAX_PARAM_SUFFIX;
+
+ if (PEPSValues.TRUE.toString().equals(validationParam)) {
+ final String paramSizeStr = PEPSUtil.getConfig(paramConf);
+ // Checking if the parameter size exists and if it's numeric
+ if (StringUtils.isNumeric(paramSizeStr)) {
+ final int maxParamSize = Integer.valueOf(paramSizeStr);
+ if (StringUtils.isEmpty(paramValue)
+ || paramValue.length() > maxParamSize) {
+ retVal = false;
+ LOG.warn("Invalid parameter [" + paramName + "] value " + paramValue);
+ }
+ } else {
+ retVal = false;
+ LOG.error("Missing " + paramConf
+ + " configuration in the pepsUtils.properties configuration file");
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the Parameter and throws an exception if an error occurs. Throws
+ * an InvalidParameterPEPSException runtime exception if the parameter is
+ * invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final Object paramValue) {
+
+ if (paramValue == null) {
+ PEPSUtil.validateParameter(className, paramName, "");
+ } else {
+ PEPSUtil.validateParameter(className, paramName, paramValue.toString());
+ }
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getErrorCode(paramName), PEPSUtil.getErrorMessage(paramName));
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param error The PEPSError to get error code and messages from configs.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final PEPSErrors error) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getConfig(error.errorCode()),
+ PEPSUtil.getConfig(error.errorMessage()));
+ }
+
+ /**
+ * Validates the HTTP Parameter and throws an exception if an error occurs.
+ * Throws an InvalidParameterPEPSException runtime exception if the parameter
+ * is invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param errorCode The error code to include on the exception.
+ * @param errorMessage The error message to include on the exception.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final String errorCode,
+ final String errorMessage) {
+
+ if (!isValidParameter(paramName, paramValue)) {
+ LOG.warn("Invalid parameter [" + paramName + "] value found at "
+ + className);
+ throw new InvalidParameterPEPSException(errorCode, errorMessage);
+ }
+ }
+
+ /**
+ * Getter for the error code of some given error related to the input param.
+ *
+ * @param paramName The name of the parameter associated with the error.
+ *
+ * @return The code of the error.
+ */
+ private static String getErrorCode(final String paramName) {
+ return getConfig(paramName + CODE_PARAM_SUFFIX);
+ }
+
+ /**
+ * Getter for the error message of some given error related to the input
+ * parameter.
+ *
+ * @param paramName The name of the parameter associated with the message.
+ *
+ * @return The message for the error.
+ */
+ private static String getErrorMessage(final String paramName) {
+ return getConfig(paramName + MSG_PARAM_SUFFIX);
+ }
+
+ /**
+ * {@link Base64} encodes the input samlToken parameter.
+ *
+ * @param samlToken the SAML Token to be encoded.
+ *
+ * @return The Base64 String representing the samlToken.
+ *
+ * @see Base64#encode
+ */
+ public static String encodeSAMLToken(final byte[] samlToken) {
+ try {
+ return new String(Base64.encode(samlToken), "UTF8");
+ } catch (final UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Encode samltoken url safe
+ * @param samlToken the saml token to encode
+ * @return the bas64 encoded string
+ */
+ public static String encodeSAMLTokenUrlSafe(final byte[] samlToken) {
+ try {
+ return new String(UrlBase64.encode(samlToken), "UTF8");
+ } catch (final UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Decodes the {@link Base64} String input parameter representing a samlToken.
+ *
+ * @param samlToken the SAML Token to be decoded.
+ *
+ * @return The samlToken decoded bytes.
+ *
+ * @see Base64#decode
+ */
+ public static byte[] decodeSAMLToken(final String samlToken) {
+ return Base64.decode(samlToken);
+ }
+
+ /**
+ * Decode URL save base64 saml token
+ * @param samlToken the SAML toke to decode
+ * @return The decoded bytes
+ */
+ public static byte[] decodeSAMLTokenUrlSafe(final String samlToken) {
+ return UrlBase64.decode(samlToken);
+ }
+
+ /**
+ * Hashes a SAML token. Throws an InternalErrorPEPSException runtime exception
+ * if the Cryptographic Engine fails.
+ *
+ * @param samlToken the SAML Token to be hashed.
+ *
+ * @return byte[] with the hashed SAML Token.
+ */
+ public static byte[] hashPersonalToken(final byte[] samlToken) {
+ try {
+ final String className =
+ PEPSUtil.getConfig(PEPSValues.HASH_DIGEST_CLASS.toString());
+
+ final Digest digest =
+ (Digest) Class.forName(className).getConstructor()
+ .newInstance((Object[]) null);
+ digest.update(samlToken, 0, samlToken.length);
+
+ final int retLength = digest.getDigestSize();
+ final byte[] ret = new byte[retLength];
+
+ digest.doFinal(ret, 0);
+ return ret;
+
+ } catch (final Exception e) {
+ // For all those exceptions that could be thrown, we always log it and
+ // thrown an InternalErrorPEPSException.
+ LOG.error(PEPSErrors.HASH_ERROR.errorMessage(), e);
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Gets the Stork error code in the error message if exists!
+ *
+ * @param errorMessage The message to get the error code if exists;
+ *
+ * @return the error code if exists. Returns null otherwise.
+ */
+ public static String getStorkErrorCode(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the Stork error message in the saml message if exists!
+ *
+ * @param errorMessage The message to get in the saml message if exists;
+ *
+ * @return the error message if exists. Returns the original message
+ * otherwise.
+ */
+ public static String getStorkErrorMessage(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[1];
+ }
+ }
+ return errorMessage;
+ }
+
+ /**
+ * Get inputstream from string
+ * @param string the string to convert
+ * @param codePage the codepage of string
+ * @return an inputstream
+ * @throws UnsupportedEncodingException
+ */
+ public static InputStream getStream(final String string, final String codePage) throws UnsupportedEncodingException
+ {
+ return new ByteArrayInputStream(string.getBytes(codePage));
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base
new file mode 100644
index 000000000..89cf8fa9b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PEPSValues.java.svn-base
@@ -0,0 +1,342 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the value constants.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.17 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSValues {
+
+ /**
+ * Represents the 'all' constant value.
+ */
+ ALL("all"),
+ /**
+ * Represents the 'none' constant value.
+ */
+ NONE("none"),
+ /**
+ * Represents the 'true' constant value.
+ */
+ TRUE("true"),
+ /**
+ * Represents the 'false' constant value.
+ */
+ FALSE("false"),
+ /**
+ * Represents the empty string constant value.
+ */
+ EMPTY_STRING(""),
+
+ /**
+ * Represents the ',' separator constant value.
+ */
+ ATTRIBUTE_VALUE_SEP(","),
+ /**
+ * Represents the ';' separator constant value.
+ */
+ ATTRIBUTE_SEP(";"),
+ /**
+ * Represents the ':' separator constant value.
+ */
+ ATTRIBUTE_TUPLE_SEP(":"),
+ /**
+ * Represents the '/' separator constant value.
+ */
+ EID_SEPARATOR("/"),
+ /**
+ * Represents the ' - ' separator constant value.
+ */
+ ERROR_MESSAGE_SEP(" - "),
+ /**
+ * Represents the '#' parameter constant value.
+ */
+ LOGGER_SEP("#"),
+ /**
+ * Represents the 'NOT_AVAILABLE' parameter constant value.
+ */
+ NOT_AVAILABLE("NotAvailable"),
+ /**
+ * Represents the ';' parameter constant value.
+ */
+ SPEPS_AUTHORIZED_SEP(";"),
+
+ /**
+ * Represents the 'ap' constant value.
+ */
+ AP("ap"),
+ /**
+ * Represents the 'C-PEPS' constant value.
+ */
+ CPEPS("C-PEPS"),
+ /**
+ * Represents the 'cpeps' constant value.
+ */
+ CPEPS_PREFIX("cpeps"),
+ /**
+ * Represents the 'peps' constant value.
+ */
+ PEPS("peps"),
+ /**
+ * Represents the '-PEPS' constant value.
+ */
+ PEPS_SUFFIX("-PEPS"),
+ /**
+ * Represents the 'SP' constant value.
+ */
+ SP("SP"),
+ /**
+ * Represents the 'S-PEPS' constant value.
+ */
+ SPEPS("S-PEPS"),
+ /**
+ * Represents the 'speps' constant value.
+ */
+ SPEPS_PREFIX("speps"),
+ /**
+ * Represents the 'sp.default.parameters' constant value.
+ */
+ DEFAULT("sp.default.parameters"),
+ /**
+ * Represents the default saml id constant value.
+ */
+ DEFAULT_SAML_ID("1"),
+ /**
+ * Represents the 'hashDigest.className' constant value.
+ */
+ HASH_DIGEST_CLASS("hashDigest.className"),
+
+ /**
+ * Represents the 'eu.stork.communication.requests' constant value.
+ */
+ STORK_PACKAGE_REQUEST_LOGGER_VALUE("eu.stork.communication.requests"),
+ /**
+ * Represents the 'eu.stork.communication.responses' constant value.
+ */
+ STORK_PACKAGE_RESPONSE_LOGGER_VALUE("eu.stork.communication.responses"),
+
+ /**
+ * Represents the 'S-PEPS receives request from SP' constant value.
+ */
+ SP_REQUEST("S-PEPS receives request from SP"),
+ /**
+ * Represents the 'Get Citizen Consent' constant value.
+ */
+ CITIZEN_CONSENT_LOG("Get Citizen Consent"),
+ /**
+ * Represents the 'C-PEPS receives request from S-PEPS' constant value.
+ */
+ CPEPS_REQUEST("C-PEPS receives request from S-PEPS"),
+ /**
+ * Represents the 'C-PEPS generates response to S-PEPS' constant value.
+ */
+ CPEPS_RESPONSE("C-PEPS generates response to S-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates request to C-PEPS' constant value.
+ */
+ SPEPS_REQUEST("S-PEPS generates request to C-PEPS"),
+ /**
+ * Represents the 'S-PEPS receives response from C-PEPS' constant value.
+ */
+ SPEPS_RESPONSE("S-PEPS receives response from C-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates response to SP' constant value.
+ */
+ SP_RESPONSE("S-PEPS generates response to SP"),
+ /**
+ * Represents the 'Success' constant value.
+ */
+ SUCCESS("Success"),
+ /**
+ * Represents the December's month number constant value.
+ */
+ LAST_MONTH("12"),
+ /**
+ * Represents the yyyyMM constant value.
+ */
+ NO_DAY_DATE_FORMAT("yyyyMM"),
+
+ /**
+ * Represents the 'attrValue' constant value.
+ */
+ ATTRIBUTE("attrValue"),
+ /**
+ * Represents the 'derivedAttr' constant value.
+ */
+ DERIVE_ATTRIBUTE("deriveAttr"),
+ /**
+ * Represents the 'storkAttribute' constant value.
+ */
+ STORK_ATTRIBUTE("storkAttribute"),
+
+ /**
+ * Represents the 'properties' constant value.
+ */
+ PROPERTIES("properties"),
+ /**
+ * Represents the 'referer' constant value.
+ */
+ REFERER("referer"),
+ /**
+ * Represents the 'host' constant value.
+ */
+ HOST("host"),
+ /**
+ * Represents the 'spid' constant value.
+ */
+ SPID("spid"),
+ /**
+ * Represents the 'domain' constant value.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the '.validation' constant value.
+ */
+ VALIDATION_SUFFIX(".validation"),
+ /**
+ * Represents the 'jsessionid' constant value.
+ */
+ EQUAL("="),
+ /**
+ * Represents the 'HttpOnly' constant value.
+ */
+ HTTP_ONLY("HttpOnly"),
+ /**
+ * Represents the 'SET-COOKIE' constant value.
+ */
+ JSSESSION("JSESSIONID"),
+ /**
+ * Represents the '=' constant value.
+ */
+ SETCOOKIE("SET-COOKIE"),
+ /**
+ * Represents the ';' constant value.
+ */
+ SEMICOLON(";"),
+ /**
+ * Represents the ' ' constant value.
+ */
+ SPACE(" "),
+ /**
+ * Represents the 'atp' constant value.
+ */
+ APROVIDER_PREFIX("atp"),
+ /**
+ * Represents the 'atn' constant value.
+ */
+ ANAME_PREFIX("atn"),
+ /**
+ * Represents the 'ap-cpeps' constant value.
+ */
+ AP_CPEPS_PREFIX("ap-cpeps"),
+ /**
+ * Represents the 'attr-filter' constant value.
+ */
+ AP_ATTRFILTER_PREFIX("attr-filter");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ PEPSValues(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".id".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String index(final int index) {
+
+ return value + index + ".id";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".value".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated string value.
+ */
+ public String value(final int index) {
+
+ return value + index + ".value";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".name".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String name(final int index) {
+
+ return value + index + ".name";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".url".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String url(final int index) {
+
+ return value + index + ".url";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".allowedGroups".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String allowedGroups(final int index) {
+
+ return value + index + ".allowedGroups";
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base
new file mode 100644
index 000000000..5d8281445
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttribute.java.svn-base
@@ -0,0 +1,348 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.log4j.Logger;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttribute.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.22 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class PersonalAttribute implements Serializable, Cloneable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2612951678412632174L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PersonalAttribute.class
+ .getName());
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String name;
+
+ /**
+ * Values of the personal attribute.
+ */
+ private List<String> value = new ArrayList<String>();
+
+ /**
+ * Type of the personal attribute.
+ */
+ private String type;
+
+ /**
+ * Complex values of the personal attribute.
+ */
+ private Map<String, String> complexValue = new ConcurrentHashMap<String, String>();
+
+ /**
+ * Is the personal attribute mandatory?
+ */
+ private transient boolean required;
+
+ /**
+ * Returned status of the attribute from the IdP.
+ */
+ private String status;
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String friendlyName;
+
+ /**
+ * Empty Constructor.
+ */
+ public PersonalAttribute() {
+ super();
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final List<String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's complex value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final Map<String, String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setComplexValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public Object clone() {
+
+ try {
+ final PersonalAttribute personalAttr = (PersonalAttribute) super.clone();
+ personalAttr.setIsRequired(this.isRequired());
+ personalAttr.setName(this.getName());
+ personalAttr.setStatus(this.getStatus());
+ if (!isEmptyValue()) {
+ final List<String> val =
+ (List<String>) ((ArrayList<String>) this.getValue()).clone();
+ personalAttr.setValue(val);
+ }
+ if (!isEmptyComplexValue()) {
+ final Map<String, String> complexVal =
+ (Map<String, String>) ((HashMap<String, String>) this
+ .getComplexValue()).clone();
+ personalAttr.setComplexValue(complexVal);
+ }
+ return personalAttr;
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("Nothing to do.");
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Getter for the required value.
+ *
+ * @return The required value.
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * Setter for the required value.
+ *
+ * @param attrIsRequired this attribute?
+ */
+ public void setIsRequired(final boolean attrIsRequired) {
+ this.required = attrIsRequired;
+ }
+
+ /**
+ * Getter for the name value.
+ *
+ * @return The name value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for the name value.
+ *
+ * @param attrName The personal attribute name.
+ */
+ public void setName(final String attrName) {
+ this.name = attrName;
+ }
+
+ /**
+ * Getter for the value.
+ *
+ * @return The list of values.
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Setter for the list of values.
+ *
+ * @param attrValue The personal attribute value.
+ */
+ public void setValue(final List<String> attrValue) {
+ if (attrValue != null) {
+ this.value = attrValue;
+ }
+ }
+
+
+ /**
+ * Getter for the type value.
+ *
+ * @return The name value.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Setter for the type value.
+ *
+ * @param attrName The personal attribute type.
+ */
+ public void setType(final String attrType) {
+ this.type = attrType;
+ }
+
+ /**
+ * Getter for the status.
+ *
+ * @return The status value.
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for the status value.
+ *
+ * @param attrStatus The personal attribute status.
+ */
+ public void setStatus(final String attrStatus) {
+ this.status = attrStatus;
+ }
+
+ /**
+ * Getter for the complex value.
+ *
+ * @return The complex value.
+ */
+ public Map<String, String> getComplexValue() {
+ return complexValue;
+ }
+
+ /**
+ * Setter for the complex value.
+ *
+ * @param complexVal The personal attribute Complex value.
+ */
+ public void setComplexValue(final Map<String, String> complexVal) {
+ if (complexVal != null) {
+ this.complexValue = complexVal;
+ }
+ }
+
+ /**
+ * Getter for the personal's friendly name.
+ *
+ * @return The personal's friendly name value.
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Setter for the personal's friendly name.
+ *
+ * @param fName The personal's friendly name.
+ */
+ public void setFriendlyName(final String fName) {
+ this.friendlyName = fName;
+ }
+
+ /**
+ * Return true the value is empty.
+ *
+ * @return True if the value is empty "[]";
+ */
+ public boolean isEmptyValue() {
+ return value.isEmpty() || (value.size() == 1 && value.get(0).length() == 0);
+ }
+
+ /**
+ * Returns true if the Complex Value is empty.
+ *
+ * @return True if the Complex Value is empty;
+ */
+ public boolean isEmptyComplexValue() {
+ return complexValue.isEmpty();
+ }
+
+ /**
+ * Returns true if the Status is empty.
+ *
+ * @return True if the Status is empty;
+ */
+ public boolean isEmptyStatus() {
+ return (status == null || status.length() == 0);
+ }
+
+ /**
+ * Prints the PersonalAttribute in the following format.
+ * name:required:[v,a,l,u,e,s]|[v=a,l=u,e=s]:status;
+ *
+ * @return The PersonalAttribute as a string.
+ */
+ public String toString() {
+ final StringBuilder strBuild = new StringBuilder();
+
+ AttributeUtil.appendIfNotNull(strBuild, getName());
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, String.valueOf(isRequired()));
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ strBuild.append('[');
+
+ if (isEmptyValue()) {
+ if (!isEmptyComplexValue()) {
+ AttributeUtil.appendIfNotNull(strBuild, AttributeUtil.mapToString(
+ getComplexValue(), PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+ } else {
+ AttributeUtil.appendIfNotNull(
+ strBuild,
+ AttributeUtil.listToString(getValue(),
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+
+ strBuild.append(']');
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, getStatus());
+ strBuild.append(PEPSValues.ATTRIBUTE_SEP.toString());
+
+ return strBuild.toString();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base
new file mode 100644
index 000000000..642b249d4
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/PersonalAttributeList.java.svn-base
@@ -0,0 +1,396 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.StringTokenizer;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttributeList.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.27 $, $Date: 2010-11-18 22:54:56 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD")
+public final class PersonalAttributeList extends
+ ConcurrentHashMap<String, PersonalAttribute> implements IPersonalAttributeList{
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger
+ .getLogger(PersonalAttributeList.class.getName());
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = 7375127363889975062L;
+
+ /**
+ * Hash with the latest fetched attribute name alias.
+ */
+ private final transient Map<String, Integer> latestAttrAlias =
+ new HashMap<String, Integer>();
+
+ /**
+ * Hash with mapping number of alias or the attribute name.
+ */
+ private final transient Map<String, Integer> attrAliasNumber =
+ new HashMap<String, Integer>();
+
+ /**
+ * Default constructor.
+ */
+ public PersonalAttributeList() {
+ // The best practices recommend to call the super constructor.
+ super();
+ }
+
+ /**
+ * Constructor with initial capacity for the PersonalAttributeList size.
+ *
+ * @param capacity The initial capacity for the PersonalAttributeList.
+ */
+ public PersonalAttributeList(final int capacity) {
+ super(capacity);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Iterator<PersonalAttribute> iterator() {
+ return this.values().iterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute get(final Object key) {
+ String attrName = (String) key;
+
+ if (this.latestAttrAlias.containsKey(key)) {
+ attrName = attrName + this.latestAttrAlias.get(key);
+ } else {
+ if (this.attrAliasNumber.containsKey(key)) {
+ this.latestAttrAlias.put(attrName, this.attrAliasNumber.get(key));
+ }
+ }
+ return super.get(attrName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(final PersonalAttribute value) {
+ if (value != null) {
+ this.put(value.getName(), value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute put(final String key, final PersonalAttribute val) {
+ if (StringUtils.isNotEmpty(key) && val != null) {
+ // Validate if attribute name already exists!
+ String attrAlias = key;
+ if (this.containsKey(attrAlias)) {
+ //TODO isAgeOver should not be hardcoded, a better way of handling multipe isAgeOver requests should be implemented.
+ if (!val.isEmptyValue() && StringUtils.isNumeric(val.getValue().get(0)) && "isAgeOver".equals( val.getName() ) ) {
+ final String attrValue = val.getValue().get(0);
+ attrAlias = key + attrValue;
+ this.attrAliasNumber.put(key, Integer.valueOf(attrValue));
+ } else {
+ final PersonalAttribute attr = super.get(key);
+ if (!attr.isEmptyValue()
+ && StringUtils.isNumeric(attr.getValue().get(0))) {
+ attrAlias = key + attr.getValue().get(0);
+ super.put(key, (PersonalAttribute) attr);
+ this.attrAliasNumber.put(key, null);
+ }
+ }
+ }
+ return super.put(attrAlias, val);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void populate(final String attrList) {
+ final StringTokenizer strToken =
+ new StringTokenizer(attrList, PEPSValues.ATTRIBUTE_SEP.toString());
+
+ while (strToken.hasMoreTokens()) {
+ final PersonalAttribute persAttr = new PersonalAttribute();
+ String[] tuples =
+ strToken.nextToken().split(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString(),
+ AttributeConstants.NUMBER_TUPLES.intValue());
+
+ // Convert to the new format if needed!
+ tuples = convertFormat(tuples);
+
+ if (AttributeUtil.hasValidTuples(tuples)) {
+ final int attrValueIndex =
+ AttributeConstants.ATTR_VALUE_INDEX.intValue();
+ final String tmpAttrValue =
+ tuples[attrValueIndex].substring(1,
+ tuples[attrValueIndex].length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ persAttr.setName(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()]);
+ persAttr.setIsRequired(Boolean
+ .valueOf(tuples[AttributeConstants.ATTR_TYPE_INDEX.intValue()]));
+
+ // check if it is a complex value
+ if (isComplexValue(vals)) {
+ persAttr.setComplexValue(createComplexValue(vals));
+ }
+ else
+ {
+ persAttr.setValue(createValues(vals));
+ }
+
+ if (tuples.length == AttributeConstants.NUMBER_TUPLES.intValue()) {
+ persAttr.setStatus(tuples[AttributeConstants.ATTR_STATUS_INDEX
+ .intValue()]);
+ }
+ this.put(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()],
+ persAttr);
+
+ } else {
+ LOG.warn("Invalid personal attribute list tuples");
+ }
+
+ }
+ }
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ public Object clone() {
+ try {
+ return (PersonalAttributeList) super.clone();
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Creates a string in the following format.
+ *
+ * attrName:attrType:[attrValue1,attrValue2=attrComplexValue]:attrStatus;
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ final Iterator<Entry<String, PersonalAttribute>> itAttrs =
+ this.entrySet().iterator();
+ final StringBuilder strBuilder = new StringBuilder();
+
+ while (itAttrs.hasNext()) {
+ final Entry<String, PersonalAttribute> attrEntry = itAttrs.next();
+ final PersonalAttribute attr = attrEntry.getValue();
+ //strBuilder.append(attr.toString());
+ strBuilder.insert(0, attr.toString());
+ }
+
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates and creates the attribute's complex values.
+ *
+ * @param values The complex values.
+ *
+ * @return The {@link Map} with the complex values.
+ *
+ * @see Map
+ */
+ private Map<String, String> createComplexValue(final String[] values) {
+ final Map<String, String> complexValue = new HashMap<String, String>();
+ for (final String val : values) {
+ final String[] tVal = val.split("=");
+ if (StringUtils.isNotEmpty(val) && tVal.length == 2) {
+ complexValue.put(tVal[0], AttributeUtil.unescape(tVal[1]));
+ }
+ }
+ return complexValue;
+ }
+
+ /**
+ * Checks if value is complex or not
+ * @param values The values to check
+ * @return True if succesful
+ */
+ private boolean isComplexValue(final String[] values) {
+ boolean isComplex = false;
+ if (values.length > 0) {
+ final String[] tVal = values[0].split("=");
+ if (StringUtils.isNotEmpty(values[0]) && tVal.length == 2) {
+ isComplex = true;
+ }
+ }
+ return isComplex;
+ }
+
+ /**
+ * Validates and creates the attribute values.
+ *
+ * @param vals The attribute values.
+ *
+ * @return The {@link List} with the attribute values.
+ *
+ * @see List
+ */
+ private List<String> createValues(final String[] vals) {
+ final List<String> values = new ArrayList<String>();
+ for (final String val : vals) {
+ if (StringUtils.isNotEmpty(val)) {
+ values.add(AttributeUtil.unescape(val));
+ }
+ }
+ return values;
+ }
+
+ /**
+ * Converts the attribute tuple (attrName:attrType...) to the new format.
+ *
+ * @param tuples The attribute tuples to convert.
+ *
+ * @return The attribute tuples in the new format.
+ */
+ private String[] convertFormat(final String[] tuples) {
+ final String[] newFormatTuples =
+ new String[AttributeConstants.NUMBER_TUPLES.intValue()];
+ if (tuples != null) {
+ System.arraycopy(tuples, 0, newFormatTuples, 0, tuples.length);
+
+ for (int i = tuples.length; i < newFormatTuples.length; i++) {
+ if (i == AttributeConstants.ATTR_VALUE_INDEX.intValue()) {
+ newFormatTuples[i] = "[]";
+ } else {
+ newFormatTuples[i] = "";
+ }
+ }
+ }
+ return newFormatTuples;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the complex attributes contained in this map.
+ */
+ public IPersonalAttributeList getComplexAttributes() {
+ LOG.info("get complex attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(!attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding complex attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getSimpleValueAttributes() {
+ LOG.info("get simple attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding simple attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getMandatoryAttributes() {
+ return getAttributesByParam(true);
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the attributes in this map by parameter value.
+ *
+ * @param compareValue The boolean to get mandatory (true) or optional (false) attributes.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map if compareValue is true or optional otherwise.
+ */
+ private IPersonalAttributeList getAttributesByParam(final boolean compareValue) {
+ LOG.info("get attributes by param :"+compareValue);
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.isRequired() == compareValue) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ public IPersonalAttributeList getOptionalAttributes() {
+ return getAttributesByParam(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasMissingValues() {
+ for(PersonalAttribute attr: this) {
+ if(attr.isEmptyValue() && attr.isEmptyComplexValue()) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base
new file mode 100644
index 000000000..65936f1a8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryRequest.java.svn-base
@@ -0,0 +1,447 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+public class STORKAttrQueryRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAttrQueryRequest</tt> instance.
+ *
+ * @return The copy of this STORKAttrQueryRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAttrQueryRequest storkAttrQueryReq = null;
+ storkAttrQueryReq = (STORKAttrQueryRequest) super.clone();
+ storkAttrQueryReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAttrQueryReq.setTokenSaml(getTokenSaml());
+ return storkAttrQueryReq;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base
new file mode 100644
index 000000000..4e40d6d01
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAttrQueryResponse.java.svn-base
@@ -0,0 +1,388 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+public class STORKAttrQueryResponse {
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Request failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** The complete assertion **/
+ private Assertion assertion;
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /** Citizen's personal attribute list. */
+ private transient IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ /** Get the assertion from the response **/
+ public Assertion getAssertion() {
+ return assertion;
+ }
+
+ /** Set the assertion in the response **/
+ public void setAssertion(final Assertion nAssertion) {
+ this.assertion = nAssertion;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base
new file mode 100644
index 000000000..2354d0eb1
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnRequest.java.svn-base
@@ -0,0 +1,495 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnRequest (SAML Token Request).
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.21 $, $Date: 2011-02-17 22:44:34 $
+ */
+public final class STORKAuthnRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The destination. */
+ private String destination;
+
+ /** The provider name. */
+ private String providerName;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The provider name value.
+ */
+ public String getProviderName() {
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param samlProvider the provider name value.
+ */
+ public void setProviderName(final String samlProvider) {
+ this.providerName = samlProvider;
+ }
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAuthnRequest</tt> instance.
+ *
+ * @return The copy of this STORKAuthnRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAuthnRequest storkAuthnReq = null;
+ try {
+ storkAuthnReq = (STORKAuthnRequest) super.clone();
+ storkAuthnReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAuthnReq.setTokenSaml(getTokenSaml());
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+
+ return storkAuthnReq;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base
new file mode 100644
index 000000000..84fadd023
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKAuthnResponse.java.svn-base
@@ -0,0 +1,383 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnResponse.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class STORKAuthnResponse {
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Authentication failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** Citizen's personal attribute list. */
+ private transient IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base
new file mode 100644
index 000000000..44811aee2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutRequest.java.svn-base
@@ -0,0 +1,197 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutRequest implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** The ID of principal as known to SP **/
+ private String spProvidedId;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /** Getter for spProvidedId **/
+ public String getSpProvidedId() {
+ return spProvidedId;
+ }
+
+ public void setSpProvidedId(final String nSpProvidedId) {
+ this.spProvidedId = nSpProvidedId;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutRequest storkLogoutRequest = null;
+ storkLogoutRequest = (STORKLogoutRequest) super.clone();
+ storkLogoutRequest.setTokenSaml(getTokenSaml());
+ return storkLogoutRequest;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base
new file mode 100644
index 000000000..21b53a652
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKLogoutResponse.java.svn-base
@@ -0,0 +1,250 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutResponse implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Status message. */
+ private String statusMessage;
+
+ /** Logout failed? */
+ private boolean fail;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Setter for the statusMessage value.
+ *
+ * @param status the new statusMessage value.
+ */
+ public void setStatusMessage(final String status) {
+ this.statusMessage = status;
+ }
+
+ /**
+ * Getter for the statusMessage value.
+ *
+ * @return The statusMessage value.
+ */
+ public String getStatusMessage() {
+ return statusMessage;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutResponse storkLogoutResponse = null;
+ storkLogoutResponse = (STORKLogoutResponse) super.clone();
+ storkLogoutResponse.setTokenSaml(getTokenSaml());
+ return storkLogoutResponse;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base
new file mode 100644
index 000000000..a9c4a156b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKStatusCode.java.svn-base
@@ -0,0 +1,68 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKStatusCode {
+
+ /** URI for Requester status code. */
+ REQUESTER_URI("urn:oasis:names:tc:SAML:2.0:status:Requester"),
+
+ /** URI for Responder status code. */
+ RESPONDER_URI("urn:oasis:names:tc:SAML:2.0:status:Responder"),
+
+ /** URI for Success status code. */
+ SUCCESS_URI("urn:oasis:names:tc:SAML:2.0:status:Success"),
+
+ /** Attribute is Available. */
+ STATUS_AVAILABLE("Available"),
+
+ /** Attribute is NotAvailable. */
+ STATUS_NOT_AVAILABLE("NotAvailable"),
+
+ /** Attribute is Withheld. */
+ STATUS_WITHHELD("Withheld");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base
new file mode 100644
index 000000000..0a711c9b7
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/STORKSubStatusCode.java.svn-base
@@ -0,0 +1,71 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Sub Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.7 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKSubStatusCode {
+
+ /** URI for AuthnFailed status code. */
+ AUTHN_FAILED_URI("urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"),
+
+ /** URI for InvalidAttrNameOrValue status code. */
+ INVALID_ATTR_NAME_VALUE_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"),
+
+ /** URI for InvalidNameIDPolicy status code. */
+ INVALID_NAMEID_POLICY_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"),
+
+ /** URI for VersionMismatch status code. */
+ VERSION_MISMATCH_URI("urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"),
+
+ /** URI for RequestDenied status code. */
+ REQUEST_DENIED_URI("urn:oasis:names:tc:SAML:2.0:status:RequestDenied"),
+
+ /** URI for QaaNotSupported status code. */
+ QAA_NOT_SUPPORTED(
+ "http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKSubStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..19d45aaa2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,9 @@
+/**
+ * Common Authentication Service functionalities to be deployed in every PEPS
+ * is contained in this package.
+ * In particular, it contains the SAML Engine that implements the SAML messages
+ * management
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons;
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
new file mode 100644
index 000000000..09769641c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeConstants.java
@@ -0,0 +1,72 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum AttributeConstants {
+
+ /**
+ * Represents the attribute's name index.
+ */
+ ATTR_NAME_INDEX(0),
+ /**
+ * Represents the attribute's type index.
+ */
+ ATTR_TYPE_INDEX(1),
+ /**
+ * Represents the attribute's value index.
+ */
+ ATTR_VALUE_INDEX(2),
+ /**
+ * Represents the attribute's status index.
+ */
+ ATTR_STATUS_INDEX(3),
+ /**
+ * Represents the number of allowed tuples.
+ */
+ NUMBER_TUPLES(4);
+
+ /**
+ * Represents the constant's value.
+ */
+ private int attribute;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param attr The Attribute Constant value.
+ */
+ AttributeConstants(final int attr) {
+
+ this.attribute = attr;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public int intValue() {
+
+ return attribute;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
new file mode 100644
index 000000000..a44768c7e
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeName.java
@@ -0,0 +1,74 @@
+package eu.stork.peps.auth.commons;
+
+/**
+ * This class is a bean used to store information relative to Attribute Names.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-11-26 $
+ */
+public final class AttributeName {
+
+ /**
+ * Attribute Id.
+ */
+ private String attributeId;
+
+ /**
+ * Attribute Name.
+ */
+ private String attributeName;
+
+ /**
+ * Attribute Name Constructor.
+ *
+ * @param aId Id of the Attribute Name.
+ * @param aName Name of the Attribute Name.
+ */
+ public AttributeName(final String aId, final String aName) {
+
+ this.attributeId = aId;
+ this.attributeName = aName;
+ }
+
+ /**
+ * Getter for the attributeId value.
+ *
+ * @return The attributeId value.
+ */
+ public String getAttributeId() {
+
+ return attributeId;
+ }
+
+ /**
+ * Setter for the attributeId value.
+ *
+ * @param aId Id of the Attribute Name.
+ */
+ public void setAttributeId(final String aId) {
+
+ this.attributeId = aId;
+ }
+
+ /**
+ * Getter for the attributeName value.
+ *
+ * @return The attributeName value.
+ */
+ public String getAttributeName() {
+
+ return attributeName;
+ }
+
+ /**
+ * Setter for the attributeName value.
+ *
+ * @param name Name of the Attribute Name.
+ */
+ public void setAttributeName(final String name) {
+
+ this.attributeName = name;
+ }
+
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
new file mode 100644
index 000000000..575732e27
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
@@ -0,0 +1,123 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Provider.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2014-01-13 $
+ */
+public final class AttributeProvider implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7210186241917444559L;
+
+ /**
+ * Provider Id.
+ */
+ private String providerId;
+
+ /**
+ * Provider Name.
+ */
+ private String providerName;
+
+ /**
+ * Allowed groups of attribute names.
+ */
+ private List<String> allowedGroups;
+
+ /**
+ * Attribute Provider Constructor.
+ *
+ * @param pId Id of the Attribute Provider.
+ * @param pName Name of the Attribute Provider.
+ */
+ public AttributeProvider(final String pId, final String pName, final List<String> pAllowedGroups) {
+
+ this.providerId = pId;
+ this.providerName = pName;
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Getter for the providerId value.
+ *
+ * @return The providerId value.
+ */
+ public String getProviderId() {
+
+ return providerId;
+ }
+
+ /**
+ * Setter for the providerId value.
+ *
+ * @param pId Id of the Attribute Provider.
+ */
+ public void setProviderId(final String pId) {
+
+ this.providerId = pId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The providerName value.
+ */
+ public String getProviderName() {
+
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param name Name of the Attribute Provider.
+ */
+ public void setProviderName(final String name) {
+
+ this.providerName = name;
+ }
+
+ /**
+ * Getter for the allowedGroups value.
+ *
+ * @return The allowedGroups value.
+ */
+ public List<String> getAllowedGroups() {
+
+ return allowedGroups;
+ }
+
+ /**
+ * Setter for the allowedGroups value.
+ *
+ * @param name AllowedGroups of the Attribute Provider.
+ */
+ public void setAllowedGroups(final List<String> pAllowedGroups) {
+
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Check if an attribute name is allowed for this Attribute Provider
+ *
+ * @param pAttrName the Attribute Name to check
+ * @return true if the name is allowed, false otherwise
+ */
+ public boolean isAttributeNameAllowed(final String pAttrName) {
+ if ( allowedGroups==null || pAttrName==null )
+ return false;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_ALL.toString()) )
+ return true;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_NONE.toString()) )
+ return false;
+ else
+ return allowedGroups.contains(pAttrName);
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
new file mode 100644
index 000000000..85aec2625
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvidersMap.java
@@ -0,0 +1,96 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of the AttributeProviderMap using a LinkedHashMap.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2013-09-20 $
+ *
+ * @see LinkedHashMap
+ */
+public class AttributeProvidersMap extends LinkedHashMap<AttributeSource, IPersonalAttributeList>
+ implements IAttributeProvidersMap {
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeProvidersMap.class.getName());
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8949081185106296122L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList get(final AttributeSource key) {
+ return this.get((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IPersonalAttributeList remove(final AttributeSource key) {
+ return this.remove((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean containsKey(final AttributeSource key) {
+ return this.containsKey((Object) key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Iterator<AttributeSource> keyIterator() {
+ return this.keySet().iterator();
+ }
+
+ public void trace() {
+ Iterator<AttributeSource> iterator;
+ Iterator<PersonalAttribute> iterator2;
+ AttributeSource source;
+ IPersonalAttributeList pal;
+ PersonalAttribute pa;
+
+ iterator = this.keyIterator();
+ LOG.trace("Start dumping of AttributeProvidersMap\n=======================");
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ LOG.trace("Source details: type [" + source.getSourceType() + "], URL [" + source.getProviderURL() + "]");
+
+ if(source.getSourceType() == AttributeSource.SOURCE_LOCAL_APROVIDER) {
+ LOG.trace("-> Attribute Provider: ID [" + source.getProvider().getProviderId() + "], name [" + source.getProvider().getProviderName() + "]");
+ }
+ else {
+ LOG.trace("-> Country: ID [" + source.getCountry().getCountryId() + "], name [" + source.getCountry().getCountryName() + "]");
+ }
+
+ pal = this.get(source);
+ LOG.trace("++++++++=>");
+ iterator2 = pal.iterator();
+ while (iterator2.hasNext()) {
+ pa = iterator2.next();
+
+ LOG.trace("-> Citizen Attribute: name [" + pa.getName() + "], required [" + pa.isRequired() + "]");
+ }
+ LOG.trace("<=++++++++");
+
+ LOG.trace("-----------------------");
+ }
+ LOG.trace("END\n=======================");
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
new file mode 100644
index 000000000..846f54f67
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java
@@ -0,0 +1,188 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Source (either AttributeProvider or Country).
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.10 $, $Date: 2013-11-29 $
+ */
+public final class AttributeSource implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 432243595968469014L;
+
+ public static final int SOURCE_LOCAL_APROVIDER = 1;
+ public static final int SOURCE_REMOTE_COUNTRY = 2;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(AttributeSource.class.getName());
+
+ /**
+ * Provider source.
+ */
+ private int sourceType;
+
+ /**
+ * Provider URL.
+ */
+ private String providerURL;
+
+ /**
+ * The local Attribute Provider.
+ */
+ private AttributeProvider provider;
+
+ /**
+ * The remote Country.
+ */
+ private Country country;
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param provider The local Attribute Provider.
+ * @param pURL URL of the Attribute Provider.
+ */
+ public AttributeSource(final AttributeProvider provider, final String pURL) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.setProvider(provider);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * Attribute Source Constructor.
+ *
+ * @param country The remote Country.
+ * @param pURL URL of the Country.
+ */
+ public AttributeSource(final Country country, final String pURL) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.setCountry(country);
+ this.setProviderURL(pURL);
+ }
+
+ /**
+ * @param sourceType the sourceType to set
+ */
+ public void setSourceType(final int sourceType) {
+ this.sourceType = sourceType;
+ }
+
+ /**
+ * @return the sourceType
+ */
+ public int getSourceType() {
+ return sourceType;
+ }
+
+ /**
+ * @param providerURL the providerURL to set
+ */
+ public void setProviderURL(final String providerURL) {
+ this.providerURL = providerURL;
+ }
+
+ /**
+ * @return the providerURL
+ */
+ public String getProviderURL() {
+ return providerURL;
+ }
+
+ /**
+ * @param provider the provider to set
+ */
+ public void setProvider(final AttributeProvider provider) {
+ this.setSourceType(SOURCE_LOCAL_APROVIDER);
+
+ this.provider = provider;
+ }
+
+ /**
+ * @return the provider
+ */
+ public AttributeProvider getProvider() {
+ return provider;
+ }
+
+ /**
+ * @param country the country to set
+ */
+ public void setCountry(final Country country) {
+ this.setSourceType(SOURCE_REMOTE_COUNTRY);
+
+ this.country = country;
+ }
+
+ /**
+ * @return the country
+ */
+ public Country getCountry() {
+ return country;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+ boolean outcome = false;
+
+ LOG.debug("Calling equals with Object.");
+ if ( obj instanceof AttributeSource ) {
+ LOG.debug("Calling equals with AttributeSource.");
+ outcome = this.equals((AttributeSource)obj);
+ }
+
+ LOG.debug("Object equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * Compare the given AttributeSource with the current object in order to determinine
+ * if they are equal.
+ *
+ * @param obj The AttributeSource to compare to
+ *
+ * @return true if the two objects are equal
+ */
+ public boolean equals(AttributeSource obj) {
+ boolean outcome = false;
+
+ if ( this.sourceType==obj.getSourceType() ) {
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( this.provider.getProviderId().equals(obj.getProvider().getProviderId()) )
+ outcome = true;
+ }
+ else if ( this.sourceType==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( this.country.getCountryId().equals(obj.getCountry().getCountryId()) )
+ outcome = true;
+ }
+ }
+
+ LOG.debug("AttributeSource equals outcome: " + outcome);
+ return outcome;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hash = 1;
+ hash = hash * 17 + this.sourceType;
+ if ( this.sourceType==AttributeSource.SOURCE_LOCAL_APROVIDER )
+ hash = hash * 31 + this.provider.getProviderName().hashCode();
+ else
+ hash = hash * 31 + this.country.getCountryName().hashCode();
+ return hash;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
new file mode 100644
index 000000000..af7ab6cf3
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeUtil.java
@@ -0,0 +1,231 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-12-15 23:19:59 $
+ */
+public final class AttributeUtil {
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private AttributeUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Safe escape any given string.
+ *
+ * @param value The HTTP Value to escaped.
+ *
+ * @return The value escaped value.
+ */
+ public static String escape(final String value) {
+
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(attrSep, escAttrSep)
+ .replace(attrTupleSep, escAttrTupleSep)
+ .replace(attrValueSep, escAttrValueSep);
+ }
+
+ /**
+ * Unescape any given string.
+ *
+ * @param value The HTTP Value to be unescaped.
+ *
+ * @return The value unescaped value.
+ */
+ public static String unescape(final String value) {
+ final String attrSep = PEPSValues.ATTRIBUTE_SEP.toString();
+ final String attrTupleSep = PEPSValues.ATTRIBUTE_TUPLE_SEP.toString();
+ final String attrValueSep = PEPSValues.ATTRIBUTE_VALUE_SEP.toString();
+
+ final String escAttrSep = "%" + (int) attrSep.charAt(0);
+ final String escAttrTupleSep = "%" + (int) attrTupleSep.charAt(0);
+ final String escAttrValueSep = "%" + (int) attrValueSep.charAt(0);
+
+ return value.replace(escAttrSep, attrSep)
+ .replace(escAttrTupleSep, attrTupleSep)
+ .replace(escAttrValueSep, attrValueSep);
+ }
+
+ /**
+ * Appends the string representation of an object to a StringBuilder.
+ *
+ * @param strBuilder The StringBuilder to append to.
+ * @param val The string representation of an object.
+ */
+ public static void appendIfNotNull(final StringBuilder strBuilder,
+ final Object val) {
+
+ if (val != null) {
+ strBuilder.append(val);
+ }
+ }
+
+ /**
+ * Given a separator and a list of strings, joins the list, as a string,
+ * separated by the separator string.
+ *
+ * @param list The list of strings to join.
+ * @param separator The separator string.
+ * @return the list, as a string, separated by the separator string.
+ */
+ public static String listToString(final List<String> list,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ for (final String s : list) {
+ if (!StringUtils.isEmpty(s)) {
+ strBuilder.append(AttributeUtil.escape(s) + separator);
+ }
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Given a separator and a map of strings to strings, joins the map, as a
+ * string, separated by the separator string with the pair key/value
+ * concatenated with a '='.
+ *
+ * @param map The map of strings to join.
+ * @param separator The separator string.
+ *
+ * @return the map of strings, as a string, separated by the separator string
+ * with the pair key/value concatenated with a '='.
+ */
+ public static String mapToString(final Map<String, String> map,
+ final String separator) {
+
+ final StringBuilder strBuilder = new StringBuilder();
+ final Iterator<Entry<String, String>> valuesIt = map.entrySet().iterator();
+ while (valuesIt.hasNext()) {
+ final Entry<String, String> entry = valuesIt.next();
+ strBuilder.append(entry.getKey());
+ strBuilder.append('=');
+ strBuilder.append(AttributeUtil.escape(entry.getValue()));
+ strBuilder.append(separator);
+ }
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates the attribute value format.
+ *
+ * @param value The attribute value to validate.
+ *
+ * @return true if value has a valid format.
+ */
+ public static boolean isValidValue(final String value) {
+ boolean retVal = false;
+ if (value != null && value.charAt(0) == '[' && value.endsWith("]")) {
+ final String tmpAttrValue = value.substring(1, value.length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ if (tmpAttrValue.length() >= 0
+ || (vals.length > 0 && vals[0].length() > 0)) {
+ retVal = true;
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the attribute type value. It's case insensitive. E.g. return true
+ * value to: a) "true", "TRUE", "True", ... b) "false", "FALSE", "False", ...
+ *
+ * @param type The attribute type value.
+ *
+ * @return true if type has a true or false (case insensitive) value.
+ */
+ public static boolean isValidType(final String type) {
+ return StringUtils.isNotEmpty(type) && (PEPSValues.TRUE.toString().equalsIgnoreCase(type) || PEPSValues.FALSE.toString().equalsIgnoreCase(type)) ;
+ }
+
+ /**
+ * Validates the Personal attribute tuple. E.g. name:type:[value]:status
+ *
+ * @param tuples The Personal attribute's tuple.
+ *
+ * @return true if the tuples' format is valid.
+ *
+ * @see PEPSUtil#validateParameter(String, String, String)
+ * @see String#equalsIgnoreCase(String)
+ */
+ public static boolean hasValidTuples(final String[] tuples) {
+ boolean retVal = false;
+
+ final int numberTuples = AttributeConstants.NUMBER_TUPLES.intValue();
+ if (tuples != null && tuples.length == numberTuples) {
+ // validate attrName
+ final int attrNameIndex = AttributeConstants.ATTR_NAME_INDEX.intValue();
+ final int attrTypeIndex = AttributeConstants.ATTR_TYPE_INDEX.intValue();
+ final int attrValueIndex = AttributeConstants.ATTR_VALUE_INDEX.intValue();
+
+ retVal =
+ StringUtils.isNotEmpty(tuples[attrNameIndex])
+ && StringUtils.isNotEmpty(tuples[attrTypeIndex])
+ && StringUtils.isNotEmpty(tuples[attrValueIndex])
+ && AttributeUtil.isValidType(tuples[attrTypeIndex])
+ && AttributeUtil.isValidValue(tuples[attrValueIndex]);
+ }
+ return retVal;
+ }
+
+ /**
+ * Check if all mandatory attributes have values.
+ *
+ * @param personalAttrList The Personal Attributes List.
+ *
+ * @return true if all mandatory attributes have values, false if at least one
+ * attribute doesn't have value.
+ */
+ public static boolean checkMandatoryAttributes(
+ final IPersonalAttributeList personalAttrList) {
+
+ final Iterator<PersonalAttribute> itAttributes =
+ personalAttrList.values().iterator();
+ boolean retVal = true;
+ while (itAttributes.hasNext() && retVal) {
+ final PersonalAttribute attr = itAttributes.next();
+ if (attr.isRequired()
+ && !STORKStatusCode.STATUS_AVAILABLE.toString()
+ .equals(attr.getStatus())) {
+ retVal = false;
+ }
+ }
+ return retVal;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
new file mode 100644
index 000000000..9ebcfbd5a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CitizenConsent.java
@@ -0,0 +1,123 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Citizen
+ * Consent.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CitizenConsent {
+
+ /**
+ * Mandatory attributes list.
+ */
+ private List<String> mandatoryList;
+
+ /**
+ * Optional attributes list.
+ */
+ private List<String> optionalList;
+
+ /**
+ * Citizen Consent default Constructor.
+ */
+ public CitizenConsent() {
+ this.mandatoryList = new ArrayList<String>();
+ this.optionalList = new ArrayList<String>();
+ }
+
+ /**
+ * Getter for the mandatoryList value.
+ *
+ * @return The mandatoryList value.
+ */
+ public List<String> getMandatoryList() {
+ return this.mandatoryList;
+ }
+
+ /**
+ * Setter for the mandatoryList value.
+ *
+ * @param mandatoryAttrList Mandatory parameters list.
+ */
+ public void setMandatoryList(final List<String> mandatoryAttrList) {
+ this.mandatoryList = mandatoryAttrList;
+ }
+
+ /**
+ * Setter for some mandatoryAttribute. Adds the input parameter to the
+ * mandatoryList.
+ *
+ * @param mandatoryAttr Attribute to add to the mandatoryList.
+ */
+ public void setMandatoryAttribute(final String mandatoryAttr) {
+ this.mandatoryList.add(mandatoryAttr);
+ }
+
+ /**
+ * Getter for the optionalList value.
+ *
+ * @return The optionalList value.
+ */
+ public List<String> getOptionalList() {
+ return optionalList;
+ }
+
+ /**
+ * Setter for the optionalList value.
+ *
+ * @param optAttrList Optional parameters list.
+ */
+ public void setOptionalList(final List<String> optAttrList) {
+ this.optionalList = optAttrList;
+ }
+
+ /**
+ * Setter for some optionalAttr. Adds the input parameter to the optionalList.
+ *
+ * @param optionalAttr Attribute to add to the optionalList.
+ */
+ public void setOptionalAttribute(final String optionalAttr) {
+ this.optionalList.add(optionalAttr);
+ }
+
+ /**
+ * Returns a string in the following format. "Mandatory attributes:
+ * mandatoryAttr1;mandatoryAttr2;mandatoryAttrN Optional attributes:
+ * optionalAttr1;optionalAttr2;optionalAttrN"
+ *
+ * @return {@inheritDoc}
+ */
+ public String toString() {
+ final StringBuilder strbldr = new StringBuilder(46);
+ strbldr.append("Mandatory attributes: ");
+ for (final String str : mandatoryList) {
+ strbldr.append(str).append(';');
+ }
+ strbldr.append(" Optional attributes: ");
+ for (final String str : optionalList) {
+ strbldr.append(str).append(';');
+ }
+ return strbldr.toString();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java
new file mode 100644
index 000000000..001f9317a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Country.java
@@ -0,0 +1,95 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+/**
+ * This class is a bean used to store the information relative to the Country.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class Country implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1135994036496370993L;
+
+/**
+ * Country Id.
+ */
+ private String countryId;
+
+ /**
+ * Country Name.
+ */
+ private String countryName;
+
+ /**
+ * Country Constructor.
+ *
+ * @param cId Id of the Country.
+ * @param cName Name of the Country.
+ */
+ public Country(final String cId, final String cName) {
+
+ this.countryId = cId;
+ this.countryName = cName;
+ }
+
+ /**
+ * Getter for the countryId value.
+ *
+ * @return The countryId value.
+ */
+ public String getCountryId() {
+
+ return countryId;
+ }
+
+ /**
+ * Setter for the countryId value.
+ *
+ * @param cId Id of the Country.
+ */
+ public void setCountryId(final String cId) {
+
+ this.countryId = cId;
+ }
+
+ /**
+ * Getter for the countryName value.
+ *
+ * @return The countryName value.
+ */
+ public String getCountryName() {
+
+ return countryName;
+ }
+
+ /**
+ * Setter for the countryName value.
+ *
+ * @param name Name of the Country.
+ */
+ public void setCountryName(final String name) {
+
+ this.countryName = name;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
new file mode 100644
index 000000000..54345f3ea
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/CountryCodes.java
@@ -0,0 +1,79 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This class contains all the ISO 3166-1 Alpha 3 Country Codes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2011-04-14 00:24:56 $
+ */
+public final class CountryCodes {
+
+ /**
+ * Private Constructor.
+ */
+ private CountryCodes() {
+
+ }
+
+ /**
+ * ISO 3166-1 Alpha 3 Country Codes.
+ */
+ private static List<String> countrysAlpha3 = Arrays.asList("ABW", "AFG",
+ "AGO", "AIA", "ALA", "ALB", "AND", "ANT", "ARE", "ARG", "ARM", "ASM",
+ "ATA", "ATF", "ATG", "AUS", "AUT", "AZE", "BDI", "BEL", "BEN", "BES",
+ "BFA", "BGD", "BGR", "BHR", "BHS", "BIH", "BLM", "BLR", "BLZ", "BMU",
+ "BOL", "BRA", "BRB", "BRN", "BTN", "BUR", "BVT", "BWA", "BYS", "CAF",
+ "CAN", "CCK", "CHE", "CHL", "CHN", "CIV", "CMR", "COD", "COG", "COK",
+ "COL", "COM", "CPV", "CRI", "CSK", "CUB", "CUW", "CXR", "CYM", "CYP",
+ "CZE", "DEU", "DJI", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "ERI",
+ "ESH", "ESP", "EST", "ETH", "FIN", "FJI", "FLK", "FRA", "FRO", "FSM",
+ "GAB", "GBR", "GEO", "GGY", "GHA", "GIB", "GIN", "GLP", "GMB", "GNB",
+ "GNQ", "GRC", "GRD", "GRL", "GTM", "GUF", "GUM", "GUY", "HKG", "HMD",
+ "HND", "HRV", "HTI", "HUN", "IDN", "IMN", "IND", "IOT", "IRL", "IRN",
+ "IRQ", "ISL", "ISR", "ITA", "JAM", "JEY", "JOR", "JPN", "KAZ", "KEN",
+ "KGZ", "KHM", "KIR", "KNA", "KOR", "KWT", "LAO", "LBN", "LBR", "LBY",
+ "LCA", "LIE", "LKA", "LSO", "LTU", "LUX", "LVA", "MAC", "MAF", "MAR",
+ "MCO", "MDA", "MDG", "MDV", "MEX", "MHL", "MKD", "MLI", "MLT", "MMR",
+ "MNE", "MNG", "MNP", "MOZ", "MRT", "MSR", "MTQ", "MUS", "MWI", "MYS",
+ "MYT", "NAM", "NCL", "NER", "NFK", "NGA", "NIC", "NIU", "NLD", "NOR",
+ "NPL", "NRU", "NZL", "OMN", "PAK", "PAN", "PCN", "PER", "PHL", "PLW",
+ "PNG", "POL", "PRI", "PRK", "PRT", "PRY", "PSE", "PYF", "QAT", "REU",
+ "ROM", "ROU", "RUS", "RWA", "SAU", "SCG", "SDN", "SEN", "SGP", "SGS",
+ "SHN", "SJM", "SLB", "SLE", "SLV", "SMR", "SOM", "SPM", "SRB", "STP",
+ "SUR", "SVK", "SVN", "SXW", "SWE", "SWZ", "SYC", "SYR", "TCA", "TCD",
+ "TGO", "THA", "TJK", "TKL", "TKM", "TLS", "TMP", "TON", "TTO", "TUN",
+ "TUR", "TUV", "TWN", "TZA", "UGA", "UKR", "UMI", "URY", "USA", "UZB",
+ "VAT", "VCT", "VEN", "VGB", "VIR", "VNM", "VUT", "WLF", "WSM", "YEM",
+ "YUG", "ZAF", "ZAR", "ZMB", "ZWE");
+
+ /**
+ * Searches the CountryCode (3166-1 alpha3 format) an return true if it
+ * exists.
+ *
+ * @param countryCode The Country code to search.
+ *
+ * @return true if the CountryCode exists, false otherwise.
+ */
+ public static boolean hasCountryCodeAlpha3(final String countryCode) {
+
+ return CountryCodes.countrysAlpha3.contains(countryCode);
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
new file mode 100644
index 000000000..9c0bd6775
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/DateUtil.java
@@ -0,0 +1,169 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.sql.Timestamp;
+import java.util.GregorianCalendar;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.joda.time.Years;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * This class holds static helper methods for Date Operations.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class DateUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(DateUtil.class.getName());
+
+ /**
+ * yyyy Date format size.
+ */
+ private static final int YEAR_DATE_SIZE = 4;
+
+ /**
+ * yyyyMM Date format size.
+ */
+ private static final int MONTH_DATE_SIZE = 6;
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private DateUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Fulfils dateValue with a valid date. The following roles are applied: a) If
+ * the dateValue only contains the year then fulfils with last year's day.
+ * e.g. this method returns 19951231 to the 1995 dateValue. b) If the
+ * dateValue contains the year and the month then fulfils with last month's
+ * day. e.g. this method returns 19950630 to the 199505 dateValue.
+ *
+ * @param dateValue The date to be fulfilled.
+ *
+ * @return The dateValue fulfilled.
+ */
+ private static String fulfilDate(final String dateValue) {
+
+ final StringBuffer strBuf = new StringBuffer();
+ strBuf.append(dateValue);
+ // if the IdP just provides the year then we must fullfil the date.
+ if (dateValue.length() == YEAR_DATE_SIZE) {
+ strBuf.append(PEPSValues.LAST_MONTH.toString());
+ }
+ // if the IdP provides the year and the month then we must fullfil the
+ // date.
+ if (dateValue.length() == MONTH_DATE_SIZE
+ || strBuf.length() == MONTH_DATE_SIZE) {
+ // IdP doesn't provide the day, so we will use DateTime to
+ // calculate it.
+ final String noDayCons = PEPSValues.NO_DAY_DATE_FORMAT.toString();
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(noDayCons);
+ final DateTime dateTime = fmt.parseDateTime(strBuf.toString());
+ // Append the last month's day.
+ strBuf.append(dateTime.dayOfMonth().withMaximumValue().getDayOfMonth());
+ }
+
+ return strBuf.toString();
+ }
+
+ /**
+ * Validates the dateValue format: a) if has a valid size; b) if has a numeric
+ * value; Note: dateValue must have the format yyyyMMdd.
+ *
+ * @param dateValueTmp The date to be validated.
+ * @param pattern The accepted date format.
+ *
+ * @return true if the date has a valid format.
+ */
+ public static boolean isValidFormatDate(final String dateValueTmp,
+ final String pattern) {
+
+ boolean retVal = true;
+ try {
+ final String dateValue = DateUtil.fulfilDate(dateValueTmp);
+
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ fmt.parseDateTime(dateValue);
+ } catch (final Exception e) {
+ // We catch Exception because we only have to return false
+ // value!
+ retVal = false;
+ }
+ return retVal;
+ }
+
+ /**
+ * Calculates the age for a given date string.
+ *
+ * @param dateVal The date to be validated.
+ * @param now The current date.
+ * @param pattern The date pattern.
+ *
+ * @return The age value.
+ */
+ public static int calculateAge(final String dateVal, final DateTime now,
+ final String pattern) {
+
+ if (DateUtil.isValidFormatDate(dateVal, pattern)) {
+ try {
+ final String dateValueTemp = DateUtil.fulfilDate(dateVal);
+ final DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+ final DateTime dateTime = fmt.parseDateTime(dateValueTemp);
+ // Calculating age
+ final Years age = Years.yearsBetween(dateTime, now);
+
+ return age.getYears();
+ } catch (final IllegalArgumentException e) {
+ LOG.warn("Invalid date format (" + pattern
+ + ") or an invalid dateValue.");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()),
+ e);
+ }
+ } else {
+ LOG.warn("Couldn't calculate Age, invalid date!");
+ throw new SecurityPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INVALID_ATTRIBUTE_VALUE.errorMessage()));
+ }
+
+ }
+
+ /**
+ * Generates the current timestamp.
+ *
+ * @return timestamp The current timestamp
+ */
+ public static Timestamp currentTimeStamp() {
+ final GregorianCalendar cal = new GregorianCalendar();
+ final long millis = cal.getTimeInMillis();
+ return new Timestamp(millis);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
new file mode 100644
index 000000000..b13c70f04
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeListProcessor.java
@@ -0,0 +1,148 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface for {@link AttributeListProcessor}.
+ *
+ * @author ricardo.ferreira@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ *
+ * @see IPersonalAttributeList
+ */
+public interface IAttributeListProcessor {
+
+ /**
+ * Checks if attribute list only contains allowed attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the allowed attributes
+ *
+ * @return true is all the attributes are allowed.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAllowedAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Lookup for business attribute.
+ *
+ * @param attrList the requested attribute list
+ * @param normalAttributes the normal attributes
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList, final List<String> normalAttributes);
+
+ /**
+ * Lookup for business attribute in normal attribute list (loaded by
+ * implementation).
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return true is at least one business attribute was requested.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasBusinessAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes to get business
+ * attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to add (eIdentifier, name,
+ * surname, and DateOfBirth).
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Adds eIdentifier, name, surname, and DateOfBirth attributes, loaded by
+ * implementation, to get business attributes from some AP.
+ *
+ * @param attrList the requested attribute list
+ *
+ * @return the requested attribute list and the new attributes added
+ * (eIdentifier, name, surname, and DateOfBirth).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList addAPMandatoryAttributes(final IPersonalAttributeList attrList);
+
+ /**
+ * Removes from attribute list the given list of attributes.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the list of attributes to remove.
+ *
+ * @return the requested attribute list and the attributes removed.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(final IPersonalAttributeList attrList, final List<String> attributes);
+
+ /**
+ * Removes from attribute list the given list of attributes and change
+ * attributes status if attribute was optional in the request.
+ *
+ * @param attrList the requested attribute list
+ * @param attributes the map of attributes (attribute name, mandatory/optional) to remove.
+ *
+ * @return the requested attribute list and the attributes removed
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList removeAPMandatoryAttributes(IPersonalAttributeList attrList, Map<String, Boolean> attributes);
+
+ /**
+ * Checks if mandate attribute exist in the requested Attribute List. Power
+ * attribute name to lookup is loaded by implementation.
+ *
+ * @param attrList the requested attribute list.
+ *
+ * @return true if mandate attribute exists or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasPowerAttribute(final IPersonalAttributeList attrList);
+
+ /**
+ * Checks if attribute name was requested and has value.
+ *
+ * @param attrList the requested attribute list.
+ * @param attrName the attribute name to lookup for .
+ *
+ * @return true if attribute was requested and has value or false otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean hasAttributeValue(final IPersonalAttributeList attrList, final String attrName);
+
+ /**
+ * Checks if attribute has value.
+ *
+ * @param attr the attribute to check.
+ *
+ * @return true if has value;
+ *
+ * @see PersonalAttribute
+ */
+ boolean hasAttributeValue(final PersonalAttribute attr);
+
+ /**
+ * Gets a map (attribute name, attribute isRequired) of attributes added to attribute list.
+ *
+ * @return the Map of attributes added and if is required to attribute list.
+ */
+ Map<String, Boolean> getNormalAttributesAdded();
+
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
new file mode 100644
index 000000000..733399ca3
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IAttributeProvidersMap.java
@@ -0,0 +1,82 @@
+package eu.stork.peps.auth.commons;
+
+import java.util.Iterator;
+
+/**
+ * Interface for Attributes Providers map.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.00 $, $Date: 2013-09-20 $
+ */
+public interface IAttributeProvidersMap {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ IPersonalAttributeList get(AttributeSource key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(AttributeSource key, IPersonalAttributeList value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ IPersonalAttributeList remove(AttributeSource key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(AttributeSource key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns an Iterator of the keys contained in this map. The implementation must
+ * take care in order for the Iterator to have predictable order of the returned
+ * keys.
+ *
+ * @return an iterator of the keys contained in this map
+ */
+ Iterator<AttributeSource> keyIterator();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
new file mode 100644
index 000000000..b24c915c0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IPersonalAttributeList.java
@@ -0,0 +1,194 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Interface for {@link PersonalAttributeList}.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.16 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD.CloneMethodMustImplementCloneable")
+public interface IPersonalAttributeList extends Iterable<PersonalAttribute>,
+ Cloneable {
+
+ /**
+ * Associates the specified value with the specified key in this Personal
+ * Attribute List.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return the previous value associated with key, or null if there was no
+ * mapping for key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute put(String key, PersonalAttribute value);
+
+ /**
+ * Returns the value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @param key whose associated value is to be returned.
+ *
+ * @return The value to which the specified key is mapped, or null if this map
+ * contains no mapping for the key.
+ *
+ * @see PersonalAttribute
+ */
+ PersonalAttribute get(Object key);
+
+ /**
+ * Adds to the PersonalAttributeList the given PersonalAttribute. It sets the
+ * attribute name as the key to the attribute value.
+ *
+ * @param value PersonalAttribute to add to the PersonalAttributeList
+ */
+ void add(PersonalAttribute value);
+
+ /**
+ * Get the size of the Personal Attribute List.
+ *
+ * @return size of the Personal Attribute List.
+ */
+ int size();
+
+ /**
+ * Checks if the Personal Attribute List contains the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if the Personal Attribute List contains the given key, false
+ * otherwise.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Getter for the iterator of the Personal Attribute List values.
+ *
+ * @return The iterator for the Personal Attribute List values.
+ *
+ * @see PersonalAttribute
+ */
+ Iterator<PersonalAttribute> iterator();
+
+ /**
+ * Creates a Personal Attribute List from a String representing an Attribute
+ * List.
+ *
+ * @param attrList String Object representing the attribute list.
+ */
+ void populate(String attrList);
+
+ /**
+ * Removes the mapping for this key from this map if present.
+ *
+ * @param key key whose mapping is to be removed from the map.
+ * @return previous value associated with specified key, or <tt>null</tt> if
+ * there was no mapping for key. A <tt>null</tt> return can also
+ * indicate that the map previously associated <tt>null</tt> with the
+ * specified key.
+ */
+ PersonalAttribute remove(Object key);
+
+ /**
+ * Returns a collection view of the values contained in this map. The
+ * collection is backed by the map, so changes to the map are reflected in the
+ * collection, and vice-versa. The collection supports element removal, which
+ * removes the corresponding mapping from this map, via the
+ * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>clear</tt> operations. It does not support the
+ * <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * @return a collection view of the values contained in this map.
+ */
+ Collection<PersonalAttribute> values();
+
+ /**
+ * Returns a {@link Set} view of the keys contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. If the map is modified
+ * while an iteration over the set is in progress (except through
+ * the iterator's own <tt>remove</tt> operation), the results of
+ * the iteration are undefined. The set supports element removal,
+ * which removes the corresponding mapping from the map, via the
+ * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or <tt>addAll</tt>
+ * operations.
+ *
+ * @return a set view of the keys contained in this map
+ */
+ Set<String> keySet();
+
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes.
+ *
+ * @return an IPersonalAttributeList of the complex attributes.
+ */
+ IPersonalAttributeList getComplexAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the simple value attributes.
+ *
+ * @return an IPersonalAttributeList of the simple value attributes.
+ */
+ IPersonalAttributeList getSimpleValueAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ IPersonalAttributeList getMandatoryAttributes();
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ IPersonalAttributeList getOptionalAttributes();
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ *
+ * @return <tt>true</tt> if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns <tt>true</tt> if this map contains at least one element that doesn't have value.
+ *
+ * @return <tt>true</tt> if this map contains at least one element that doesn't have value.
+ */
+ boolean hasMissingValues();
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ Object clone() throws CloneNotSupportedException;
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
new file mode 100644
index 000000000..33eb618f0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkLogger.java
@@ -0,0 +1,239 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork logging.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public interface IStorkLogger {
+
+ /**
+ * Getter for SpApplication.
+ *
+ * @return The SpApplication value.
+ */
+ String getSpApplication();
+
+ /**
+ * Setter for SpApplication.
+ *
+ * @param spApplication The SP Application.
+ */
+ void setSpApplication(String spApplication);
+
+ /**
+ * Getter for ProviderName.
+ *
+ * @return The ProviderName value.
+ */
+ String getProviderName();
+
+ /**
+ * Setter for ProviderName.
+ *
+ * @param providerName The provider name.
+ */
+ void setProviderName(String providerName);
+
+ /**
+ *
+ * Getter for Origin.
+ *
+ * @return The Origin value.
+ *
+ */
+ String getOrigin();
+
+ /**
+ * Setter for Origin.
+ *
+ * @param origin The origin.
+ */
+ void setOrigin(String origin);
+
+ /**
+ *
+ * Getter for QAA Level.
+ *
+ * @return The QAA Level value.
+ *
+ */
+ int getQaaLevel();
+
+ /**
+ * Setter for QAA Level.
+ *
+ * @param qaaLevel The qaa level.
+ */
+ void setQaaLevel(int qaaLevel);
+
+ /**
+ *
+ * Getter for timestamp.
+ *
+ * @return The timestamp value.
+ *
+ */
+ String getTimestamp();
+
+ /**
+ * Setter for timestamp.
+ *
+ * @param timestamp The request's timestamp.
+ */
+ void setTimestamp(String timestamp);
+
+ /**
+ * Getter for InResponseTo.
+ *
+ * @return The InResponseTo value.
+ */
+ String getInResponseTo();
+
+ /**
+ * Setter for InResponseTo.
+ *
+ * @param inResponseTo The Saml's response id.
+ */
+ void setInResponseTo(String inResponseTo);
+
+ /**
+ * Getter for InResponseToSPReq.
+ *
+ * @return The InResponseToSPReq value.
+ */
+ String getInResponseToSPReq();
+
+ /**
+ * Setter for InResponseToSPRequ.
+ *
+ * @param inResponseToSPReq The Saml's response id.
+ */
+ void setInResponseToSPReq(String inResponseToSPReq);
+
+ /**
+ * Getter for opType.
+ *
+ * @return The opType value.
+ */
+ String getOpType();
+
+ /**
+ * Setter for opType.
+ *
+ * @param opType The operation type.
+ */
+ void setOpType(String opType);
+
+ /**
+ * Getter for destination.
+ *
+ * @return The destination value.
+ */
+ String getDestination();
+
+ /**
+ * Setter for destinationIp.
+ *
+ * @param destination The remote IP.
+ */
+ void setDestination(String destination);
+
+ /**
+ * Getter for message or assertion consumer.
+ *
+ * @return The message or assertion consumer.
+ */
+ String getMessage();
+
+ /**
+ * Setter for message or assertion consumer.
+ *
+ * @param message or assertion consumer.
+ */
+ void setMessage(String message);
+
+ /**
+ * Getter for country.
+ *
+ * @return The country value.
+ */
+ String getCountry();
+
+ /**
+ * Setter for country.
+ *
+ * @param country The country.
+ */
+ void setCountry(String country);
+
+ /**
+ * Getter for samlHash.
+ *
+ * @return The samlHash value.
+ */
+ byte[] getSamlHash();
+
+ /**
+ * Setter for samlHash.
+ *
+ * @param samlHash the encrypted SAML token
+ */
+ void setSamlHash(byte[] samlHash);
+
+ /**
+ * Getter for msgId.
+ *
+ * @return the msgId
+ */
+ String getMsgId();
+
+ /**
+ * Setter for msgId.
+ *
+ * @param msgId the ID of the originator of this message
+ */
+ void setMsgId(String msgId);
+
+ /**
+ * Getter for sPMsgId.
+ *
+ * @return the sPMsgId
+ */
+ String getSPMsgId();
+
+ /**
+ * Setter for sPMsgId.
+ *
+ * @param sPMsgId the ID of the originator of this message
+ */
+ void setSPMsgId(String sPMsgId);
+
+ /**
+ * The format of the returned String must be the following:
+ * "requestCounter#ddMMMyyyykk:mm:ss#opType#originIp#originName
+ * #destinationIp#destinationName#samlHash#[originatorName#msgId#]"
+ *
+ * The values enclosed in '[]' only apply when logging responses.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ String toString();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
new file mode 100644
index 000000000..f38b41838
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/IStorkSession.java
@@ -0,0 +1,85 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * Interface for stork session.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public interface IStorkSession {
+
+ /**
+ * Returns the object associated the the given key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return The object associated the the given key.
+ */
+ Object get(Object key);
+
+ /**
+ * Associates a key to a value, and inserts them in the session object.
+ *
+ * @param key with which the specified value is to be associated.
+ * @param value to be associated with the specified key.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object put(String key, Object value);
+
+ /**
+ * Removes the mapping for this key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return previous value associated with specified key, or null if there was
+ * no mapping for key. A null return can also indicate that the map
+ * previously associated null with the specified key.
+ */
+ Object remove(Object key);
+
+ /**
+ * Returns the number of key-value mappings in this map.
+ *
+ * @return the number of key-value mappings in this map.
+ */
+ int size();
+
+ /**
+ * Returns true if this map contains a mapping for the specified key.
+ *
+ * @param key with which the specified value is to be associated.
+ *
+ * @return true if this map contains a mapping for the specified key.
+ */
+ boolean containsKey(Object key);
+
+ /**
+ * Removes all mappings from this map.
+ */
+ void clear();
+
+ /**
+ * Returns true if this map contains no key-value mappings.
+ *
+ * @return true if this map contains no key-value mappings.
+ */
+ boolean isEmpty();
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
new file mode 100644
index 000000000..6e7c891da
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/Linker.java
@@ -0,0 +1,316 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information of Attribute Providers, the Attribute
+ * List to be requested, the Assertions returned by the Attribute Providers and the values
+ * that each Attribute has. This information along with the current status of the Linker (the
+ * attribute providers that were queried and the remaining providers) is used by the PEPS
+ * actions in order to complete the Attribute gathering.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.50 $, $Date: 2013-11-28 $
+ */
+public final class Linker implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -3268006381745987237L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(Linker.class.getName());
+
+ /**
+ * Attributes Providers map.
+ */
+ private IAttributeProvidersMap attributeProvidersMap;
+
+ /**
+ * Assertion map.
+ */
+ private LinkedHashMap<AttributeSource, STORKAttrQueryResponse> assertions;
+
+ /**
+ * The current index of local (domestic) Attribute Providers.
+ */
+ private int localIndex;
+
+ /**
+ * The current index of remote (foreign) Attribute Providers - countries.
+ */
+ private int remoteIndex;
+
+ /**
+ * Constructs an empty Linker object.
+ */
+ public Linker() {
+ localIndex = 0;
+ remoteIndex = 0;
+
+ assertions = new LinkedHashMap<AttributeSource, STORKAttrQueryResponse>();
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next local Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextLocalProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap!=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_LOCAL_APROVIDER ) {
+ if ( curIndex>=localIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * Based on the internal state of the Linker it returns the next remote Attribute Source
+ *
+ * @return The next Attribute Source or null if not found
+ *
+ * @see AttributeSource
+ */
+ public AttributeSource getNextRemoteProvider() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source, found;
+ int curIndex = 0;
+
+ found = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY ) {
+ if ( curIndex>=remoteIndex ) {
+ found = source;
+
+ break;
+ }
+
+ curIndex++;
+ }
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * It updates the Linker with the values returned by the Attribute Source. It also advances
+ * to the next index in order to mark this attribute source as completed.
+ *
+ * @param source The Attribute Source that was queried for attribute values.
+ * @param attrResponse The attrResponse returned by the Attribute Source that contains the attribute values.
+ *
+ * @see AttributeSource, STORKAttrQueryResponse
+ */
+ public void setProviderReponse(AttributeSource source, STORKAttrQueryResponse attrResponse) {
+ if ( source.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ //Assertion storage
+ this.assertions.put(source, attrResponse);
+
+ this.attributeProvidersMap.put(source, attrResponse.getPersonalAttributeList());
+ //this.attributeProvidersMap.put(source, attrResponse.getTotalPersonalAttributeList());
+ }
+
+ /**
+ * Reset the internal state of the local Attribute Source in order to start over.
+ */
+ public void resetLocalIndex() {
+ localIndex = 0;
+ }
+
+ /**
+ * Reset the internal state of the remote Attribute Source in order to start over.
+ */
+ public void resetRemoteIndex() {
+ remoteIndex = 0;
+ }
+
+ /**
+ * Setter for attributeProvidersMap.
+ *
+ * @param attributeProvidersMap The attributeProvidersMap to set.
+ */
+ public void setAttributeProvidersMap(IAttributeProvidersMap attributeProvidersMap) {
+ this.attributeProvidersMap = attributeProvidersMap;
+ }
+
+ /**
+ * Getter for attributeProvidersMap.
+ *
+ * @return attributeProvidersMap
+ */
+ public IAttributeProvidersMap getAttributeProvidersMap() {
+ return attributeProvidersMap;
+ }
+
+ /**
+ * Returns the Personal Attribute list of the provided Attribute Source.
+ *
+ * @param source The attributeSource in reference
+ *
+ * @return The IPersonalAttributeList assosiated with this source or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getProviderAttributes(AttributeSource source) {
+ if ( attributeProvidersMap.containsKey(source) )
+ return attributeProvidersMap.get(source);
+ else
+ return null;
+ }
+
+ /**
+ * Returns the merged Personal Attribute list from all the Attribute Sources.
+ *
+ * @return The IPersonalAttributeList merged Personal Attribute list or null if empty
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getAllAttributes() {
+ Iterator<AttributeSource> iterator;
+ AttributeSource source;
+ IPersonalAttributeList list, merged;
+
+ merged = null;
+
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ iterator = attributeProvidersMap.keyIterator();
+
+ merged = new PersonalAttributeList();
+ while (iterator.hasNext()) {
+ source = iterator.next();
+ list = this.getProviderAttributes(source);
+
+ for (final PersonalAttribute pa : list) {
+ merged.add(pa);
+ }
+ }
+ }
+
+ return merged;
+ }
+
+ /**
+ * Returns a List with all the assertions gathered by the AAS-PEPS module
+ * returned both by local APs or remote A-PEPS.
+ *
+ * @return The assertions returned from the APs and A-PEPS
+ */
+ public List<STORKAttrQueryResponse> getAttrQueryResponseList() {
+ List<STORKAttrQueryResponse> originalAssertions;
+
+ originalAssertions = new ArrayList<STORKAttrQueryResponse>();
+
+ //Gather all assertions
+ for (STORKAttrQueryResponse element : this.assertions.values()) {
+ originalAssertions.add(element);
+ }
+
+ return originalAssertions;
+ }
+
+ /**
+ * Checks the internal state of the Linker and if all Attribute Sources where visited
+ * returns true, otherwise it returns false. So if you go directly from AtPLinkerAction
+ * to MoreAttributesAction the call will have, since the method setProviderReponse
+ * was not executed from every Attribute Source.
+ *
+ * @return true if everything is OK, false otherwise
+ */
+ public boolean isComplete() {
+ boolean outcome = false;
+
+ LOG.debug("Check if linkder is complete: R[" + remoteIndex + "], L[" + localIndex + "], S[" + attributeProvidersMap.size() + "]");
+ if ( attributeProvidersMap !=null && !attributeProvidersMap.isEmpty() ) {
+ if ( (remoteIndex + localIndex)==attributeProvidersMap.size() )
+ outcome = true;
+ }
+ else {
+ outcome = true;
+ }
+
+ return outcome;
+ }
+
+ /**
+ * Merge the two Linker objects.
+ *
+ * @param previous The other Linker object to merge with this one.
+ */
+ public void mergeWith(Linker previous) {
+ //BEFORE
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap from the current object.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ LOG.debug("The attributeProvidersMap from the provided object.");
+ ((AttributeProvidersMap)previous.getAttributeProvidersMap()).trace();
+ }
+
+ IAttributeProvidersMap map = previous.getAttributeProvidersMap();
+ Iterator<AttributeSource> items = map.keyIterator();
+ while( items.hasNext() ) {
+ AttributeSource item = items.next();
+ IPersonalAttributeList pal = map.get(item);
+
+ if ( this.attributeProvidersMap.containsKey(item) ) {
+ IPersonalAttributeList new_pal = this.attributeProvidersMap.get(item);
+
+ for(PersonalAttribute pa : pal)
+ new_pal.add(pa);
+ }
+ else {
+ if ( item.getSourceType()==AttributeSource.SOURCE_REMOTE_COUNTRY )
+ remoteIndex++;
+ else
+ localIndex++;
+
+ this.attributeProvidersMap.put(item, pal);
+ }
+ }
+
+ //AFTER
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug("The attributeProvidersMap after the merge.");
+ ((AttributeProvidersMap)this.attributeProvidersMap).trace();
+ }
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
new file mode 100644
index 000000000..5da9ba494
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSErrors.java
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific errors
+ * constant identifiers.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.10 $, $Date: 2011-02-17 22:44:34 $
+ */
+public enum PEPSErrors {
+
+ /**
+ * Represents the 'authenticationFailed' constant error identifier.
+ */
+ AUTHENTICATION_FAILED_ERROR("authenticationFailed"),
+ /**
+ * Represents the 'spCountrySelector.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_ERROR_CREATE_SAML("spCountrySelector.errorCreatingSAML"),
+ /**
+ * Represents the 'spCountrySelector.destNull' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_DESTNULL("spCountrySelector.destNull"),
+ /**
+ * Represents the 'spCountrySelector.invalidAttr' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_ATTR("spCountrySelector.invalidAttr"),
+ /**
+ * Represents the 'spCountrySelector.invalidProviderName' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_PROVIDER_NAME(
+ "spCountrySelector.invalidProviderName"),
+ /**
+ * Represents the 'spCountrySelector.invalidQaaSPid' constant error
+ * identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_QAASPID("spCountrySelector.invalidQaaSPid"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpId' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPID("spCountrySelector.invalidSpId"),
+ /**
+ * Represents the 'spCountrySelector.invalidSPQAA' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPQAA("spCountrySelector.invalidSPQAA"),
+ /**
+ * Represents the 'spCountrySelector.invalidSpURL' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_INVALID_SPURL("spCountrySelector.invalidSpURL"),
+ /**
+ * Represents the 'spCountrySelector.spNotAllowed' constant error identifier.
+ */
+ SP_COUNTRY_SELECTOR_SPNOTALLOWED("spCountrySelector.spNotAllowed"),
+
+ /**
+ * Represents the 'sProviderAction.errorCreatingSAML' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_ERROR_CREATE_SAML("sProviderAction.errorCreatingSAML"),
+ /**
+ * Represents the 'sProviderAction.attr' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_ATTR("sProviderAction.invalidAttr"),
+ /**
+ * Represents the 'sProviderAction.country' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_COUNTRY("sProviderAction.invalidCountry"),
+ /**
+ * Represents the 'sProviderAction.relayState' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_RELAY_STATE("sProviderAction.invalidRelayState"),
+ /**
+ * Represents the 'sProviderAction.saml' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SAML("sProviderAction.invalidSaml"),
+ /**
+ * Represents the 'sProviderAction.spAlias' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPALIAS("sProviderAction.invalidSPAlias"),
+ /**
+ * Represents the 'sProviderAction.spDomain' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPDOMAIN("sProviderAction.invalidSPDomain"),
+ /**
+ * Represents the 'sProviderAction.spId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPID("sProviderAction.invalidSPId"),
+ /**
+ * Represents the 'sProviderAction.spQAA' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAA("sProviderAction.invalidSPQAA"),
+ /**
+ * Represents the 'sProviderAction.spQAAId' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPQAAID("sProviderAction.invalidSPQAAId"),
+ /**
+ * Represents the 'sProviderAction.spRedirect' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SPREDIRECT("sProviderAction.invalidSPRedirect"),
+ /**
+ * Represents the 'sPPowerValidationAction.invalidSPPVAttrList' constant error identifier.
+ */
+ SPPOWERVALIDATION_SELECTOR_INVALID_SP_PV_ATTR_LIST("sPPowerValidationAction.invalidSPPVAttrList"),
+
+ /**
+ * Represents the 'sProviderAction.invalidSPProviderName' constant error
+ * identifier.
+ */
+ SPROVIDER_SELECTOR_INVALID_SP_PROVIDERNAME(
+ "sProviderAction.invalidSPProviderName"),
+ /**
+ * Represents the 'sProviderAction.spNotAllowed' constant error identifier.
+ */
+ SPROVIDER_SELECTOR_SPNOTALLOWED("sProviderAction.spNotAllowed"),
+
+
+ /**
+ * Represents the 'internalError' constant error identifier.
+ */
+ INTERNAL_ERROR("internalError"),
+
+ /**
+ * Represents the 'colleagueRequest.attrNull' constant error identifier.
+ */
+ COLLEAGUE_REQ_ATTR_NULL("colleagueRequest.attrNull"),
+ /**
+ * Represents the 'colleagueRequest.errorCreatingSAML' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_ERROR_CREATE_SAML("colleagueRequest.errorCreatingSAML"),
+ /**
+ * Represents the 'colleagueRequest.invalidCountryCode' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_COUNTRYCODE("colleagueRequest.invalidCountryCode"),
+ /**
+ * Represents the 'colleagueRequest.invalidDestUrl' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_DEST_URL("colleagueRequest.invalidDestUrl"),
+ /**
+ * Represents the 'colleagueRequest.invalidQaa' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_QAA("colleagueRequest.invalidQaa"),
+ /**
+ * Represents the 'colleagueRequest.invalidRedirect' constant error
+ * identifier.
+ */
+ COLLEAGUE_REQ_INVALID_REDIRECT("colleagueRequest.invalidRedirect"),
+ /**
+ * Represents the 'colleagueRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_REQ_INVALID_SAML("colleagueRequest.invalidSAML"),
+
+ /**
+ * Represents the 'colleaguePVRequest.invalidPVAttrList' constant error identifier.
+ */
+ COLLEAGUE_PV_REQ_INVALID_PV_ATTR_LIST("colleaguePVRequest.invalidPVAttrList"),
+
+
+ /**
+ * Represents the 'cpepsRedirectUrl' constant error identifier.
+ */
+ CPEPS_REDIRECT_URL("cpepsRedirectUrl"),
+ /**
+ * Represents the 'spepsRedirectUrl' constant error identifier.
+ */
+ SPEPS_REDIRECT_URL("spepsRedirectUrl"),
+ /**
+ * Represents the 'sProviderAction.invCountry' constant error identifier.
+ */
+ SP_ACTION_INV_COUNTRY("sProviderAction.invCountry"),
+
+ /**
+ * Represents the 'providernameAlias.invalid' constant error identifier.
+ */
+ PROVIDER_ALIAS_INVALID("providernameAlias.invalid"),
+
+
+ /**
+ * Represents the 'cPeps.attrNull' constant error identifier.
+ */
+ CPEPS_ATTR_NULL("cPeps.attrNull"),
+
+ /**
+ * Represents the 'colleagueResponse.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_RESP_INVALID_SAML("colleagueResponse.invalidSAML"),
+
+ /**
+ * Represents the 'citizenNoConsent.mandatory' constant error identifier.
+ */
+ CITIZEN_NO_CONSENT_MANDATORY("citizenNoConsent.mandatory"),
+ /**
+ * Represents the 'citizenResponse.mandatory' constant error identifier.
+ */
+ CITIZEN_RESPONSE_MANDATORY("citizenResponse.mandatory"),
+ /**
+ * Represents the 'attVerification.mandatory' constant error identifier.
+ */
+ ATT_VERIFICATION_MANDATORY("attVerification.mandatory"),
+ /**
+ * Represents the 'attrValue.verification' constant error identifier.
+ */
+ ATTR_VALUE_VERIFICATION("attrValue.verification"),
+
+ /**
+ * Represents the 'audienceRestrictionError' constant error identifier.
+ */
+ AUDIENCE_RESTRICTION("audienceRestrictionError"),
+ /**
+ * Represents the 'auRequestIdError' constant error identifier.
+ */
+ AU_REQUEST_ID("auRequestIdError"),
+ /**
+ * Represents the 'domain' constant error identifier.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the 'hash.error' constant error identifier.
+ */
+ HASH_ERROR("hash.error"),
+ /**
+ * Represents the 'invalidAttributeList' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_LIST("invalidAttributeList"),
+ /**
+ * Represents the 'invalidAttributeValue' constant error identifier.
+ */
+ INVALID_ATTRIBUTE_VALUE("invalidAttributeValue"),
+ /**
+ * Represents the 'qaaLevel' constant error identifier.
+ */
+ QAALEVEL("qaaLevel"),
+ /**
+ * Represents the 'requests' constant error identifier.
+ */
+ REQUESTS("requests"),
+ /**
+ * Represents the 'SPSAMLRequest' constant error identifier.
+ */
+ SP_SAML_REQUEST("SPSAMLRequest"),
+ /**
+ * Represents the 'spepsSAMLRequest' constant error identifier.
+ */
+ SPEPS_SAML_REQUEST("spepsSAMLRequest"),
+ /**
+ * Represents the 'IdPSAMLResponse' constant error identifier.
+ */
+ IDP_SAML_RESPONSE("IdPSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ CPEPS_SAML_RESPONSE("cpepsSAMLResponse"),
+ /**
+ * Represents the 'cpepsSAMLResponse' constant error identifier.
+ */
+ SPEPS_SAML_RESPONSE("spepsSAMLResponse"),
+ /**
+ * Represents the 'session' constant error identifier.
+ */
+ SESSION("session"),
+ /**
+ * Represents the 'invalid.session' constant error identifier.
+ */
+ INVALID_SESSION("invalid.session"),
+ /**
+ * Represents the 'invalid.sessionId' constant error identifier.
+ */
+ INVALID_SESSION_ID("invalid.sessionId"),
+ /**
+ * Represents the 'missing.sessionId' constant error identifier.
+ */
+ MISSING_SESSION_ID("sessionError"),
+ /**
+ * Represents the 'missing.mandate' constant error identifier.
+ */
+ MISSING_MANDATE("missing.mandate"),
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_SAML_RESPONSE("AtPSAMLResponse"),
+
+ /**
+ * Represents the 'AtPSAMLResponse' constant error identifier.
+ */
+ ATP_RESPONSE_ERROR("atp.response.error"),
+
+ /**
+ * Represents the 'apepsSAMLRequest' constant error identifier.
+ */
+ APEPS_SAML_REQUEST("apepsSAMLRequest"),
+
+ /**
+ * Represents the 'apepsSAMLResponse' constant error identifier.
+ */
+ APEPS_SAML_RESPONSE("apepsSAMLResponse"),
+
+ /**
+ * Represents the 'invalid.apepsRedirectUrl' constant error identifier.
+ */
+ INVALID_APEPS_REDIRECT_URL("invalid.apepsRedirectUrl"),
+
+ /**
+ * Represents the 'invalid.apepsCallbackUrl' constant error identifier.
+ */
+ INVALID_APEPS_CALLBACK_URL("invalid.apepsCallbackUrl"),
+
+ /**
+ * Represents the 'colleagueAttributeRequest.invalidSAML' constant error identifier.
+ */
+ COLLEAGUE_ATTR_REQ_INVALID_SAML("colleagueAttributeRequest.invalidSAML");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String error;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nError The Constant error value.
+ */
+ PEPSErrors(final String nError) {
+ this.error = nError;
+ }
+
+ /**
+ * Construct the errorCode Constant value.
+ *
+ * @return The errorCode Constant.
+ */
+ public String errorCode() {
+ return error + ".code";
+ }
+
+ /**
+ * Construct the errorCode Constant value with the given code text.
+ *
+ * @param text the code text to append to the constant.
+ *
+ * @return The errorCode Constant for the given code text.
+ */
+ public String errorCode(final String text) {
+ return error + "." + text + ".code";
+ }
+
+ /**
+ * Construct the errorMessage constant value.
+ *
+ * @return The errorMessage constant.
+ */
+ public String errorMessage() {
+ return error + ".message";
+ }
+
+ /**
+ * Construct the errorMessage Constant value with the given message text.
+ *
+ * @param text the message text to append to the constant.
+ *
+ * @return The errorMessage Constant for the given text.
+ */
+ public String errorMessage(final String text) {
+ return error + "." + text + ".message";
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return error;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
new file mode 100644
index 000000000..15c2ae552
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSParameters.java
@@ -0,0 +1,625 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the STORK PEPS, Commons and Specific Parameters.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSParameters {
+
+ /**
+ * Represents the 'apId' parameter constant.
+ */
+ AP_ID("apId"),
+ /**
+ * Represents the 'apUrl' parameter constant.
+ */
+ AP_URL("apUrl"),
+ /**
+ * Represents the 'ap.number' parameter constant.
+ */
+ AP_NUMBER("ap.number"),
+
+ /**
+ * Represents the 'assertionConsumerServiceURL' parameter constant.
+ */
+ ASSERTION_CONSUMER_S_URL("assertionConsumerServiceURL"),
+
+ /**
+ * Represents the 'auth' parameter constant.
+ */
+ AUTHENTICATION("auth"),
+
+ /**
+ * Represents the 'attr' parameter constant.
+ */
+ ATTRIBUTE("attr"),
+ /**
+ * Represents the 'attrName' parameter constant.
+ */
+ ATTRIBUTE_NAME("attrName"),
+ /**
+ * Represents the 'attrStatus' parameter constant.
+ */
+ ATTRIBUTE_STATUS("attrStatus"),
+ /**
+ * Represents the 'attrType' parameter constant.
+ */
+ ATTRIBUTE_TYPE("attrType"),
+ /**
+ * Represents the 'attrValue' parameter constant.
+ */
+ ATTRIBUTE_VALUE("attrValue"),
+ /**
+ * Represents the 'attrList' parameter constant.
+ */
+ ATTRIBUTE_LIST("attrList"),
+ /**
+ * Represents the 'apMandAttrList' parameter constant.
+ */
+ AP_MANDATORY_ATTRIBUTE_LIST("apMandAttrList"),
+ /**
+ * Represents the 'attrTuple' parameter constant.
+ */
+ ATTRIBUTE_TUPLE("attrTuple"),
+ /**
+ * Represents the 'attribute-missing' parameter constant.
+ */
+ ATTRIBUTE_MISSING("attribute-missing"),
+ /**
+ * Represents the 'attributesNotAllowed' parameter constant.
+ */
+ ATTRIBUTES_NOT_ALLOWED("attributesNotAllowed"),
+ /**
+ * Represents the 'authnRequest' parameter constant.
+ */
+ AUTH_REQUEST("authnRequest"),
+
+ /**
+ * Represents the 'attrValue.number' parameter constant.
+ */
+ ATTR_VALUE_NUMBER("attrValue.number"),
+
+ /**
+ * Represents the 'derivation.date.format' parameter constant.
+ */
+ DERIVATION_DATE_FORMAT("derivation.date.format"),
+ /**
+ * Represents the 'deriveAttr.number' parameter constant.
+ */
+ DERIVE_ATTRIBUTE_NUMBER("deriveAttr.number"),
+
+ /**
+ * Represents the complex attributes parameter constant.
+ */
+ COMPLEX_ADDRESS_VALUE("canonicalResidenceAddress"),
+ COMPLEX_NEWATTRIBUTE_VALUE("newAttribute2"),
+ COMPLEX_HASDEGREE_VALUE("hasDegree"),
+ COMPLEX_MANDATECONTENT_VALUE("mandateContent"),
+ /**
+ * Represents the 'consent-type' parameter constant.
+ */
+ CONSENT_TYPE("consent-type"),
+ /**
+ * Represents the 'consent-value' parameter constant.
+ */
+ CONSENT_VALUE("consent-value"),
+ /**
+ * Represents the 'country' parameter constant.
+ */
+ COUNTRY("country"),
+ /**
+ * Represents the 'countryOrigin' parameter constant.
+ */
+ COUNTRY_ORIGIN("countryOrigin"),
+
+ /**
+ * Represents the 'cpepsURL' parameter constant.
+ */
+ CPEPS_URL("cpepsURL"),
+ /**
+ * Represents the 'callback' parameter constant.
+ */
+ CPEPS_CALLBACK("callback"),
+ /**
+ * Represents the 'peps.specificidpredirect.url' parameter constant.
+ */
+ CPEPS_IDP_CALLBACK_VALUE("peps.specificidpredirect.url"),
+ /**
+ * Represents the 'peps.specificapredirect.url' parameter constant.
+ */
+ CPEPS_AP_CALLBACK_VALUE("peps.specificapredirect.url"),
+
+ /**
+ * Represents the 'errorCode' parameter constant.
+ */
+ ERROR_CODE("errorCode"),
+ /**
+ * Represents the 'subCode' parameter constant.
+ */
+ ERROR_SUBCODE("subCode"),
+ /**
+ * Represents the 'errorMessage' parameter constant.
+ */
+ ERROR_MESSAGE("errorMessage"),
+ /**
+ * Represents the 'errorRedirectUrl' parameter constant.
+ */
+ ERROR_REDIRECT_URL("errorRedirectUrl"),
+
+ /**
+ * errorRedirectUrl Represents the 'external-authentication' parameter
+ * constant.
+ */
+ EXTERNAL_AUTH("external-authentication"),
+ /**
+ * Represents the 'external-ap' parameter constant.
+ */
+ EXTERNAL_AP("external-ap"),
+ /**
+ * Represents the 'external-pv' parameter constant.
+ */
+ EXTERNAL_PV("external-pv"),
+ /**
+ * Represents the 'external-sig-module' parameter constant.
+ */
+ EXT_SIG_CREATOR_MOD("external-sig-module"),
+
+ /**
+ * Represents the 'http-x-forwarded-for' parameter constant.
+ */
+ HTTP_X_FORWARDED_FOR("http-x-forwarded-for"),
+
+ /**
+ * Represents the 'idp.url' parameter constant.
+ */
+ IDP_URL("idp.url"),
+ /**
+ * Represents the 'internal-authentication' parameter constant.
+ */
+ INTERNAL_AUTH("internal-authentication"),
+ /**
+ * Represents the 'internal-ap' parameter constant.
+ */
+ INTERNAL_AP("internal-ap"),
+ /**
+ * Represents the 'internal-pv' parameter constant.
+ */
+ INTERNAL_PV("internal-pv"),
+
+ /**
+ * Represents the 'samlIssuer' parameter constant.
+ */
+ ISSUER("samlIssuer"),
+ /**
+ * Represents the 'samlIssuer.idp' parameter constant.
+ */
+ ISSUER_IDP("samlIssuer.idp"),
+ /**
+ * Represents the 'samlIssuer.atp' parameter constant.
+ */
+ ISSUER_ATP("samlIssuer.atp"),
+
+ /**
+ * Represents the 'mandatory' parameter constant.
+ */
+ MANDATORY("mandatory"),
+ /**
+ * Represents the 'mandatoryAttributeMissing' parameter constant.
+ */
+ MANDATORY_ATTR_MISSING("mandatoryAttributeMissing"),
+ /**
+ * Represents the 'mandatoryConsentAttrMissing' parameter constant.
+ */
+ MANDATORY_CONSENT_MISSING("mandatoryConsentAttrMissing"),
+ /**
+ * Represents the 'missing-attrs' parameter constant.
+ */
+ MISSING_ATTRS("missing-attrs"),
+ /**
+ * Represents the 'no-more-attrs' parameter constant.
+ */
+ NO_MORE_ATTRS("no-more-attrs"),
+
+ /**
+ * Represents the 'optional' parameter constant.
+ */
+ OPTIONAL("optional"),
+
+ /**
+ * Represents the 'no-consent-type' parameter constant.
+ */
+ NO_CONSENT_TYPE("no-consent-type"),
+ /**
+ * Represents the 'no-consent-value' parameter constant.
+ */
+ NO_CONSENT_VALUE("no-consent-value"),
+
+ /**
+ * Represents the 'provider.name' parameter constant.
+ */
+ PROVIDER_NAME_VALUE("providerName"),
+ /**
+ * Represents the 'cpeps.askconsent' parameter constant.
+ */
+ PEPS_ASK_CONSENT("cpeps.askconsent"),
+ /**
+ * Represents the 'cpeps.askconsentvalue' parameter constant.
+ */
+ PEPS_ASK_CONSENT_VALUE("cpeps.askconsentvalue"),
+ /**
+ * Represents the 'pepsAuth' parameter constant.
+ */
+ PEPS_AUTH_CONSENT("pepsAuth"),
+ /**
+ * Represents the 'validation.bypass' parameter constant.
+ */
+ PEPS_BYPASS("validation.bypass"),
+ /**
+ * Represents the 'cpeps.number' parameter constant.
+ */
+ PEPS_NUMBER("cpeps.number"),
+ /**
+ * Represents the 'cpeps.specificapredirect.url' parameter constant.
+ */
+ PEPS_SPECIFIC_URL("cpeps.specificapredirect.url"),
+ /**
+ * Represents the 'pv.url' parameter constant.
+ */
+ PV_URL("pv.url"),
+
+ /**
+ * Represents the 'qaaLevel' parameter constant.
+ */
+ QAALEVEL("qaaLevel"),
+
+ /**
+ * Represents the 'speps.redirectUrl' parameter constant.
+ */
+ SPEPS_REDIRECT_URL("speps.redirectUrl"),
+
+ /**
+ * Represents the 'sp.redirectUrl' parameter constant.
+ */
+ SP_REDIRECT_URL("sp.redirectUrl"),
+ /**
+ * Represents the 'cpeps.redirectUrl' parameter constant.
+ */
+ CPEPS_REDIRECT_URL("cpeps.redirectUrl"),
+ /**
+ * Represents the 'RelayState' parameter constant.
+ */
+ RELAY_STATE("RelayState"),
+ /**
+ * Represents the 'remoteAddr' parameter constant.
+ */
+ REMOTE_ADDR("remoteAddr"),
+ /**
+ * Represents the 'remoteUser' parameter constant.
+ */
+ REMOTE_USER("remoteUser"),
+
+ /**
+ * Represents the 'SAMLRequest' parameter constant.
+ */
+ SAML_REQUEST("SAMLRequest"),
+ /**
+ * Represents the 'SAMLResponse' parameter constant.
+ */
+ SAML_RESPONSE("SAMLResponse"),
+ /**
+ * Represents the 'SAMLFail' parameter constant.
+ */
+ SAML_TOKEN_FAIL("SAMLFail"),
+ /**
+ * Represents the 'TokenId' parameter constant.
+ */
+ SAML_TOKEN_ID("TokenId"),
+ /**
+ * Represents the 'inResponseTo' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO("inResponseTo"),
+ /**
+ * Represents the 'inResponseTo.idp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_IDP("inResponseTo.idp"),
+ /**
+ * Represents the 'inResponseTo.atp' parameter constant.
+ */
+ SAML_IN_RESPONSE_TO_ATP("inResponseTo.atp"),
+ /**
+ * Represents the 'SignatureResponse' parameter constant.
+ */
+ SIGNATURE_RESPONSE("SignatureResponse"),
+
+ /**
+ * Represents the 'cPepsSession' parameter constant.
+ */
+ SESSION_ID_URL("cPepsSession"),
+ /**
+ * Represents the 'spId' parameter constant.
+ */
+ SP_ID("spId"),
+ /**
+ * Represents the 'spQaaLevel' parameter constant.
+ */
+ SP_QAALEVEL("spQaaLevel"),
+ /**
+ * Represents the 'spUrl' parameter constant.
+ */
+ SP_URL("spUrl"),
+
+ /**
+ * Represents the 'allow.derivation.all' parameter constant.
+ */
+ SPECIFIC_ALLOW_DERIVATION_ALL("allow.derivation.all"),
+ /**
+ * Represents the ''allow.unknowns parameter constant.
+ */
+ SPECIFIC_ALLOW_UNKNOWNS("allow.unknowns"),
+ /**
+ * Represents the 'derivation.date.separator' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DATE_SEP("derivation.date.separator"),
+ /**
+ * Represents the 'derivation.month.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_MONTH_POS("derivation.month.position"),
+ /**
+ * Represents the 'derivation.day.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_DAY_POS("derivation.day.position"),
+ /**
+ * Represents the 'derivation.year.position' parameter constant.
+ */
+ SPECIFIC_DERIVATION_YEAR_POS("derivation.year.position"),
+
+ /**
+ * sp.authorized.parameters Represents the '' parameter constant.
+ */
+ SPEPS_AUTHORIZED("sp.authorized.parameters"),
+
+ /**
+ * Represents the 'spSector' constant value.
+ */
+ SPSECTOR("spSector"),
+ /**
+ * Represents the 'spApplication' constant value.
+ */
+ SPAPPLICATION("spApplication"),
+ /**
+ * Represents the 'spCountry' constant value.
+ */
+ SPCOUNTRY("spCountry"),
+ /**
+ * Represents the 'spInstitution' constant value.
+ */
+ SPINSTITUTION("spInstitution"),
+ /**
+ * Represents the 'storkAttribute.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_NUMBER("storkAttribute.number"),
+ /**
+ * Represents the 'storkAttributeValue.number' parameter constant.
+ */
+ STORK_ATTRIBUTE_VALUE_NUMBER("storkAttributeValue.number"),
+
+ /**
+ * Represents the 'username' parameter constant.
+ */
+ USERNAME("username"),
+
+ /**
+ * Represents the 'tooManyParameters' parameter constant.
+ */
+ TOO_MANY_PARAMETERS("tooManyParameters"),
+ /**
+ * Represents the 'validation.active' parameter constant.
+ */
+ VALIDATION_ACTIVE("validation.active"),
+
+ /**
+ * Represents the 'x-forwarded-for' parameter constant.
+ */
+ X_FORWARDED_FOR("x-forwarded-for"),
+ /**
+ * Represents the 'x-forwarded-host' parameter constant.
+ */
+ X_FORWARDED_HOST("x-forwarded-host"),
+ /**
+ * Represents the 'XMLResponse' parameter constant.
+ */
+ XML_RESPONSE("XMLResponse"),
+
+ /**
+ * Represents the 'ap-cpeps.number' parameter constant.
+ */
+ AP_PEPS_NUMBER("ap-cpeps.number"),
+
+ /**
+ * Represents the 'atp.number' parameter constant.
+ */
+ ATTRIBUTE_PROVIDER_NUMBER("atp.number"),
+
+ /**
+ * Represents the 'atn.number' parameter constant.
+ */
+ ATTRIBUTE_NAME_NUMBER("atn.number"),
+
+ /**
+ * Represents the 'apLinker' parameter constant.
+ */
+ AP_LINKER("apLinker"),
+
+ /**
+ * Represents the 'prevApLinker' parameter constant.
+ */
+ PREV_AP_LINKER("prevApLinker"),
+
+ /**
+ * Represents the 'NOSEL' parameter constant (no attribute provider selected).
+ */
+ AP_NO_SELECTION("NOSEL"),
+
+ /**
+ * Represents the 'OCSEL' parameter constant (attribute provider in another country).
+ */
+ AP_OTHER_COUNTRY("OCSEL"),
+
+ /**
+ * Represents the '_provider' suffix parameter constant.
+ */
+ AP_PROVIDER_SELECT_SUFFIX("_provider"),
+
+ /**
+ * Represents the '_country' suffix parameter constant.
+ */
+ AP_COUNTRY_SELECT_SUFFIX("_country"),
+
+ /**
+ * Represents the '_name' suffix parameter constant.
+ */
+ AP_NAME_SELECT_SUFFIX("_name"),
+
+ /**
+ * Represents the 'next-ap' parameter constant.
+ */
+ NEXT_AP("next-ap"),
+
+ /**
+ * Represents the 'next-apeps' parameter constant.
+ */
+ NEXT_APEPS("next-apeps"),
+
+ /**
+ * Represents the 'back-to-apeps' parameter constant.
+ */
+ BACK_TO_APEPS("back-to-apeps"),
+
+ /**
+ * Represents the 'is-remote-apeps' parameter constant.
+ */
+ IS_REMOTE_APEPS("is-remote-apeps"),
+
+ /**
+ * Represents the 'more-attributes' parameter constant.
+ */
+ MORE_ATTRIBUTES("more-attributes"),
+
+ /**
+ * Represents the 'attr-filter.number' parameter constant.
+ */
+ ATTRIBUTES_FILTER_NUMBER("attr-filter.number"),
+
+ /**
+ * Represents the 'attr-group' parameter constant.
+ */
+ ATTRIBUTE_GROUPS("attr-group"),
+
+ /**
+ * Represents the 'all' parameter constant for attribute groups.
+ */
+ ATTRIBUTE_GROUPS_ALL("all"),
+
+ /**
+ * Represents the 'none' parameter constant for attribute groups.
+ */
+ ATTRIBUTE_GROUPS_NONE("none"),
+
+ /**
+ * Represents the 'atp.url' parameter constant.
+ */
+ ATP_URL("atp.url"),
+ /**
+ * Represents the 'apepsURL' parameter constant.
+ */
+ APEPS_URL("apepsUrl"),
+
+ /**
+ * Represents the 'apepsCountry' parameter constant.
+ */
+ APEPS_COUNTRY("apepsCountry"),
+
+ /**
+ * Represents the 'apepsAuthRequest' parameter constant.
+ */
+ APEPS_ATTR_REQUEST("apepsAttrRequest"),
+
+ /**
+ * Represents the 'isApepsRequest' parameter constant.
+ */
+ APEPS_REQUEST_COMPLETE("apeps-request-complete"),
+
+ /**
+ * Represents the 'apeps.callbackUrl' parameter constant.
+ */
+ APEPS_CALLBACK_URL("apeps.callbackUrl"),
+ /**
+ * Represents the 'attrListMand' parameter constant.
+ */
+ ATTR_LIST_MAND("attrListMand"),
+
+ /**
+ * Represents the 'attrListOpt' parameter constant.
+ */
+ ATTR_LIST_OPT("attrListOpt"),
+
+ /**
+ * Represents the 'simpleAttrListMand' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_MAND("simpleAttrListMand"),
+
+ /**
+ * Represents the 'simpleAttrListOpt' parameter constant.
+ */
+ SIMPLE_ATTR_LIST_OPT("simpleAttrListOpt"),
+
+ /**
+ * Represents the 'complexAttrListMand' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_MAND("complexAttrListMand"),
+
+ /**
+ * Represents the 'complexAttrListOpt' parameter constant.
+ */
+ COMPLEX_ATTR_LIST_OPT("complexAttrListOpt");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param nValue The Constant value.
+ */
+ PEPSParameters(final String nValue) {
+ this.value = nValue;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
new file mode 100644
index 000000000..69729c0bb
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSUtil.java
@@ -0,0 +1,391 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.crypto.Digest;
+import org.bouncycastle.util.encoders.Base64;
+import org.bouncycastle.util.encoders.UrlBase64;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * This class holds static helper methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.75 $, $Date: 2010-11-23 00:05:35 $
+ */
+public final class PEPSUtil {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PEPSUtil.class.getName());
+
+ /**
+ * Configurations object.
+ */
+ private static Properties configs;
+
+ /**
+ * Max prefix.
+ */
+ private static final String MAX_PARAM_PREFIX = "max.";
+
+ /**
+ * Code prefix to get error code.
+ */
+ private static final String CODE_PARAM_SUFFIX = ".code";
+
+ /**
+ * param's size prefix to get max param size.
+ */
+ private static final String MAX_PARAM_SUFFIX = ".size";
+
+ /**
+ * Message prefix to get error message.
+ */
+ private static final String MSG_PARAM_SUFFIX = ".message";
+
+ /**
+ * Private constructor. Prevents the class from being instantiated.
+ */
+ private PEPSUtil() {
+ // empty constructor
+ }
+
+ /**
+ * Creates a single instance of this class and sets the properties.
+ *
+ * @param nConfigs The set of available configurations.
+ *
+ * @return The created PEPSUtil's class.
+ */
+ public static PEPSUtil createInstance(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ return new PEPSUtil();
+ }
+
+ /**
+ * Getter for the Properties.
+ *
+ * @return configs The properties value.
+ */
+ public Properties getConfigs() {
+ return configs;
+ }
+
+ /**
+ * Setter for the Properties.
+ *
+ * @param nConfigs The new properties value.
+ */
+ public static void setConfigs(final Properties nConfigs) {
+ if (nConfigs != null) {
+ PEPSUtil.configs = nConfigs;
+ }
+ }
+
+ /**
+ * Returns the identifier of some configuration given a set of configurations
+ * and the corresponding configuration key.
+ *
+ * @param configKey The key that IDs some configuration.
+ *
+ * @return The configuration String value.
+ */
+ public static String getConfig(final String configKey) {
+ return configs.getProperty(configKey);
+ }
+
+ /**
+ * Validates the input paramValue identified by the paramName.
+ *
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ *
+ * @return true if the parameter is valid.
+ */
+ public static boolean isValidParameter(final String paramName,
+ final String paramValue) {
+
+ final String validationParam =
+ PEPSUtil.getConfig(PEPSParameters.VALIDATION_ACTIVE.toString());
+ boolean retVal = true;
+
+ final String paramConf = MAX_PARAM_PREFIX + paramName + MAX_PARAM_SUFFIX;
+
+ if (PEPSValues.TRUE.toString().equals(validationParam)) {
+ final String paramSizeStr = PEPSUtil.getConfig(paramConf);
+ // Checking if the parameter size exists and if it's numeric
+ if (StringUtils.isNumeric(paramSizeStr)) {
+ final int maxParamSize = Integer.valueOf(paramSizeStr);
+ if (StringUtils.isEmpty(paramValue)
+ || paramValue.length() > maxParamSize) {
+ retVal = false;
+ LOG.warn("Invalid parameter [" + paramName + "] value " + paramValue);
+ }
+ } else {
+ retVal = false;
+ LOG.error("Missing " + paramConf
+ + " configuration in the pepsUtils.properties configuration file");
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Validates the Parameter and throws an exception if an error occurs. Throws
+ * an InvalidParameterPEPSException runtime exception if the parameter is
+ * invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final Object paramValue) {
+
+ if (paramValue == null) {
+ PEPSUtil.validateParameter(className, paramName, "");
+ } else {
+ PEPSUtil.validateParameter(className, paramName, paramValue.toString());
+ }
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getErrorCode(paramName), PEPSUtil.getErrorMessage(paramName));
+ }
+
+ /**
+ * Validates the Parameters and throws an exception if an error occurs.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param error The PEPSError to get error code and messages from configs.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final PEPSErrors error) {
+
+ PEPSUtil.validateParameter(className, paramName, paramValue,
+ PEPSUtil.getConfig(error.errorCode()),
+ PEPSUtil.getConfig(error.errorMessage()));
+ }
+
+ /**
+ * Validates the HTTP Parameter and throws an exception if an error occurs.
+ * Throws an InvalidParameterPEPSException runtime exception if the parameter
+ * is invalid.
+ *
+ * @param className The Class Name that invoked the method.
+ * @param paramName The name of the parameter to validate.
+ * @param paramValue The value of the parameter to validate.
+ * @param errorCode The error code to include on the exception.
+ * @param errorMessage The error message to include on the exception.
+ */
+ public static void validateParameter(final String className,
+ final String paramName, final String paramValue, final String errorCode,
+ final String errorMessage) {
+
+ if (!isValidParameter(paramName, paramValue)) {
+ LOG.warn("Invalid parameter [" + paramName + "] value found at "
+ + className);
+ throw new InvalidParameterPEPSException(errorCode, errorMessage);
+ }
+ }
+
+ /**
+ * Getter for the error code of some given error related to the input param.
+ *
+ * @param paramName The name of the parameter associated with the error.
+ *
+ * @return The code of the error.
+ */
+ private static String getErrorCode(final String paramName) {
+ return getConfig(paramName + CODE_PARAM_SUFFIX);
+ }
+
+ /**
+ * Getter for the error message of some given error related to the input
+ * parameter.
+ *
+ * @param paramName The name of the parameter associated with the message.
+ *
+ * @return The message for the error.
+ */
+ private static String getErrorMessage(final String paramName) {
+ return getConfig(paramName + MSG_PARAM_SUFFIX);
+ }
+
+ /**
+ * {@link Base64} encodes the input samlToken parameter.
+ *
+ * @param samlToken the SAML Token to be encoded.
+ *
+ * @return The Base64 String representing the samlToken.
+ *
+ * @see Base64#encode
+ */
+ public static String encodeSAMLToken(final byte[] samlToken) {
+ try {
+ return new String(Base64.encode(samlToken), "UTF8");
+ } catch (final UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Encode samltoken url safe
+ * @param samlToken the saml token to encode
+ * @return the bas64 encoded string
+ */
+ public static String encodeSAMLTokenUrlSafe(final byte[] samlToken) {
+ try {
+ return new String(UrlBase64.encode(samlToken), "UTF8");
+ } catch (final UnsupportedEncodingException e) {
+ LOG.error(PEPSErrors.INTERNAL_ERROR.errorMessage(), e);
+ return null;
+ }
+ }
+
+ /**
+ * Decodes the {@link Base64} String input parameter representing a samlToken.
+ *
+ * @param samlToken the SAML Token to be decoded.
+ *
+ * @return The samlToken decoded bytes.
+ *
+ * @see Base64#decode
+ */
+ public static byte[] decodeSAMLToken(final String samlToken) {
+ return Base64.decode(samlToken);
+ }
+
+ /**
+ * Decode URL save base64 saml token
+ * @param samlToken the SAML toke to decode
+ * @return The decoded bytes
+ */
+ public static byte[] decodeSAMLTokenUrlSafe(final String samlToken) {
+ return UrlBase64.decode(samlToken);
+ }
+
+ /**
+ * Hashes a SAML token. Throws an InternalErrorPEPSException runtime exception
+ * if the Cryptographic Engine fails.
+ *
+ * @param samlToken the SAML Token to be hashed.
+ *
+ * @return byte[] with the hashed SAML Token.
+ */
+ public static byte[] hashPersonalToken(final byte[] samlToken) {
+ try {
+ final String className =
+ PEPSUtil.getConfig(PEPSValues.HASH_DIGEST_CLASS.toString());
+
+ final Digest digest =
+ (Digest) Class.forName(className).getConstructor()
+ .newInstance((Object[]) null);
+ digest.update(samlToken, 0, samlToken.length);
+
+ final int retLength = digest.getDigestSize();
+ final byte[] ret = new byte[retLength];
+
+ digest.doFinal(ret, 0);
+ return ret;
+
+ } catch (final Exception e) {
+ // For all those exceptions that could be thrown, we always log it and
+ // thrown an InternalErrorPEPSException.
+ LOG.error(PEPSErrors.HASH_ERROR.errorMessage(), e);
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.HASH_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Gets the Stork error code in the error message if exists!
+ *
+ * @param errorMessage The message to get the error code if exists;
+ *
+ * @return the error code if exists. Returns null otherwise.
+ */
+ public static String getStorkErrorCode(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[0];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the Stork error message in the saml message if exists!
+ *
+ * @param errorMessage The message to get in the saml message if exists;
+ *
+ * @return the error message if exists. Returns the original message
+ * otherwise.
+ */
+ public static String getStorkErrorMessage(final String errorMessage) {
+ if (StringUtils.isNotBlank(errorMessage)
+ && errorMessage.indexOf(PEPSValues.ERROR_MESSAGE_SEP.toString()) >= 0) {
+ final String[] msgSplitted =
+ errorMessage.split(PEPSValues.ERROR_MESSAGE_SEP.toString());
+ if (msgSplitted.length == 2 && StringUtils.isNumeric(msgSplitted[0])) {
+ return msgSplitted[1];
+ }
+ }
+ return errorMessage;
+ }
+
+ /**
+ * Get inputstream from string
+ * @param string the string to convert
+ * @param codePage the codepage of string
+ * @return an inputstream
+ * @throws UnsupportedEncodingException
+ */
+ public static InputStream getStream(final String string, final String codePage) throws UnsupportedEncodingException
+ {
+ return new ByteArrayInputStream(string.getBytes(codePage));
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
new file mode 100644
index 000000000..89cf8fa9b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PEPSValues.java
@@ -0,0 +1,342 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains all the value constants.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.17 $, $Date: 2011-07-07 20:48:45 $
+ */
+public enum PEPSValues {
+
+ /**
+ * Represents the 'all' constant value.
+ */
+ ALL("all"),
+ /**
+ * Represents the 'none' constant value.
+ */
+ NONE("none"),
+ /**
+ * Represents the 'true' constant value.
+ */
+ TRUE("true"),
+ /**
+ * Represents the 'false' constant value.
+ */
+ FALSE("false"),
+ /**
+ * Represents the empty string constant value.
+ */
+ EMPTY_STRING(""),
+
+ /**
+ * Represents the ',' separator constant value.
+ */
+ ATTRIBUTE_VALUE_SEP(","),
+ /**
+ * Represents the ';' separator constant value.
+ */
+ ATTRIBUTE_SEP(";"),
+ /**
+ * Represents the ':' separator constant value.
+ */
+ ATTRIBUTE_TUPLE_SEP(":"),
+ /**
+ * Represents the '/' separator constant value.
+ */
+ EID_SEPARATOR("/"),
+ /**
+ * Represents the ' - ' separator constant value.
+ */
+ ERROR_MESSAGE_SEP(" - "),
+ /**
+ * Represents the '#' parameter constant value.
+ */
+ LOGGER_SEP("#"),
+ /**
+ * Represents the 'NOT_AVAILABLE' parameter constant value.
+ */
+ NOT_AVAILABLE("NotAvailable"),
+ /**
+ * Represents the ';' parameter constant value.
+ */
+ SPEPS_AUTHORIZED_SEP(";"),
+
+ /**
+ * Represents the 'ap' constant value.
+ */
+ AP("ap"),
+ /**
+ * Represents the 'C-PEPS' constant value.
+ */
+ CPEPS("C-PEPS"),
+ /**
+ * Represents the 'cpeps' constant value.
+ */
+ CPEPS_PREFIX("cpeps"),
+ /**
+ * Represents the 'peps' constant value.
+ */
+ PEPS("peps"),
+ /**
+ * Represents the '-PEPS' constant value.
+ */
+ PEPS_SUFFIX("-PEPS"),
+ /**
+ * Represents the 'SP' constant value.
+ */
+ SP("SP"),
+ /**
+ * Represents the 'S-PEPS' constant value.
+ */
+ SPEPS("S-PEPS"),
+ /**
+ * Represents the 'speps' constant value.
+ */
+ SPEPS_PREFIX("speps"),
+ /**
+ * Represents the 'sp.default.parameters' constant value.
+ */
+ DEFAULT("sp.default.parameters"),
+ /**
+ * Represents the default saml id constant value.
+ */
+ DEFAULT_SAML_ID("1"),
+ /**
+ * Represents the 'hashDigest.className' constant value.
+ */
+ HASH_DIGEST_CLASS("hashDigest.className"),
+
+ /**
+ * Represents the 'eu.stork.communication.requests' constant value.
+ */
+ STORK_PACKAGE_REQUEST_LOGGER_VALUE("eu.stork.communication.requests"),
+ /**
+ * Represents the 'eu.stork.communication.responses' constant value.
+ */
+ STORK_PACKAGE_RESPONSE_LOGGER_VALUE("eu.stork.communication.responses"),
+
+ /**
+ * Represents the 'S-PEPS receives request from SP' constant value.
+ */
+ SP_REQUEST("S-PEPS receives request from SP"),
+ /**
+ * Represents the 'Get Citizen Consent' constant value.
+ */
+ CITIZEN_CONSENT_LOG("Get Citizen Consent"),
+ /**
+ * Represents the 'C-PEPS receives request from S-PEPS' constant value.
+ */
+ CPEPS_REQUEST("C-PEPS receives request from S-PEPS"),
+ /**
+ * Represents the 'C-PEPS generates response to S-PEPS' constant value.
+ */
+ CPEPS_RESPONSE("C-PEPS generates response to S-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates request to C-PEPS' constant value.
+ */
+ SPEPS_REQUEST("S-PEPS generates request to C-PEPS"),
+ /**
+ * Represents the 'S-PEPS receives response from C-PEPS' constant value.
+ */
+ SPEPS_RESPONSE("S-PEPS receives response from C-PEPS"),
+ /**
+ * Represents the 'S-PEPS generates response to SP' constant value.
+ */
+ SP_RESPONSE("S-PEPS generates response to SP"),
+ /**
+ * Represents the 'Success' constant value.
+ */
+ SUCCESS("Success"),
+ /**
+ * Represents the December's month number constant value.
+ */
+ LAST_MONTH("12"),
+ /**
+ * Represents the yyyyMM constant value.
+ */
+ NO_DAY_DATE_FORMAT("yyyyMM"),
+
+ /**
+ * Represents the 'attrValue' constant value.
+ */
+ ATTRIBUTE("attrValue"),
+ /**
+ * Represents the 'derivedAttr' constant value.
+ */
+ DERIVE_ATTRIBUTE("deriveAttr"),
+ /**
+ * Represents the 'storkAttribute' constant value.
+ */
+ STORK_ATTRIBUTE("storkAttribute"),
+
+ /**
+ * Represents the 'properties' constant value.
+ */
+ PROPERTIES("properties"),
+ /**
+ * Represents the 'referer' constant value.
+ */
+ REFERER("referer"),
+ /**
+ * Represents the 'host' constant value.
+ */
+ HOST("host"),
+ /**
+ * Represents the 'spid' constant value.
+ */
+ SPID("spid"),
+ /**
+ * Represents the 'domain' constant value.
+ */
+ DOMAIN("domain"),
+ /**
+ * Represents the '.validation' constant value.
+ */
+ VALIDATION_SUFFIX(".validation"),
+ /**
+ * Represents the 'jsessionid' constant value.
+ */
+ EQUAL("="),
+ /**
+ * Represents the 'HttpOnly' constant value.
+ */
+ HTTP_ONLY("HttpOnly"),
+ /**
+ * Represents the 'SET-COOKIE' constant value.
+ */
+ JSSESSION("JSESSIONID"),
+ /**
+ * Represents the '=' constant value.
+ */
+ SETCOOKIE("SET-COOKIE"),
+ /**
+ * Represents the ';' constant value.
+ */
+ SEMICOLON(";"),
+ /**
+ * Represents the ' ' constant value.
+ */
+ SPACE(" "),
+ /**
+ * Represents the 'atp' constant value.
+ */
+ APROVIDER_PREFIX("atp"),
+ /**
+ * Represents the 'atn' constant value.
+ */
+ ANAME_PREFIX("atn"),
+ /**
+ * Represents the 'ap-cpeps' constant value.
+ */
+ AP_CPEPS_PREFIX("ap-cpeps"),
+ /**
+ * Represents the 'attr-filter' constant value.
+ */
+ AP_ATTRFILTER_PREFIX("attr-filter");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ PEPSValues(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".id".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String index(final int index) {
+
+ return value + index + ".id";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".value".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated string value.
+ */
+ public String value(final int index) {
+
+ return value + index + ".value";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".name".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String name(final int index) {
+
+ return value + index + ".name";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".url".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String url(final int index) {
+
+ return value + index + ".url";
+ }
+
+ /**
+ * Construct the return value with the following structure
+ * CONSTANT_VALUE+index+".allowedGroups".
+ *
+ * @param index the number.
+ *
+ * @return The concatenated String value.
+ */
+ public String allowedGroups(final int index) {
+
+ return value + index + ".allowedGroups";
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
new file mode 100644
index 000000000..5d8281445
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttribute.java
@@ -0,0 +1,348 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.log4j.Logger;
+
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttribute.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.22 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class PersonalAttribute implements Serializable, Cloneable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2612951678412632174L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(PersonalAttribute.class
+ .getName());
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String name;
+
+ /**
+ * Values of the personal attribute.
+ */
+ private List<String> value = new ArrayList<String>();
+
+ /**
+ * Type of the personal attribute.
+ */
+ private String type;
+
+ /**
+ * Complex values of the personal attribute.
+ */
+ private Map<String, String> complexValue = new ConcurrentHashMap<String, String>();
+
+ /**
+ * Is the personal attribute mandatory?
+ */
+ private transient boolean required;
+
+ /**
+ * Returned status of the attribute from the IdP.
+ */
+ private String status;
+
+ /**
+ * Name of the personal attribute.
+ */
+ private String friendlyName;
+
+ /**
+ * Empty Constructor.
+ */
+ public PersonalAttribute() {
+ super();
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final List<String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * PersonalAttribute Constructor for complex values.
+ *
+ * @param attrName The attribute name.
+ * @param attrIsRequired The attribute type value.
+ * @param attrComplexValue The attribute's complex value.
+ * @param attrStatus The attribute's status value.
+ */
+ public PersonalAttribute(final String attrName, final boolean attrIsRequired,
+ final Map<String, String> attrComplexValue, final String attrStatus) {
+ this.setName(attrName);
+ this.setIsRequired(attrIsRequired);
+ this.setComplexValue(attrComplexValue);
+ this.setStatus(attrStatus);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public Object clone() {
+
+ try {
+ final PersonalAttribute personalAttr = (PersonalAttribute) super.clone();
+ personalAttr.setIsRequired(this.isRequired());
+ personalAttr.setName(this.getName());
+ personalAttr.setStatus(this.getStatus());
+ if (!isEmptyValue()) {
+ final List<String> val =
+ (List<String>) ((ArrayList<String>) this.getValue()).clone();
+ personalAttr.setValue(val);
+ }
+ if (!isEmptyComplexValue()) {
+ final Map<String, String> complexVal =
+ (Map<String, String>) ((HashMap<String, String>) this
+ .getComplexValue()).clone();
+ personalAttr.setComplexValue(complexVal);
+ }
+ return personalAttr;
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("Nothing to do.");
+ throw new InternalErrorPEPSException(
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorCode()),
+ PEPSUtil.getConfig(PEPSErrors.INTERNAL_ERROR.errorMessage()), e);
+ }
+ }
+
+ /**
+ * Getter for the required value.
+ *
+ * @return The required value.
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * Setter for the required value.
+ *
+ * @param attrIsRequired this attribute?
+ */
+ public void setIsRequired(final boolean attrIsRequired) {
+ this.required = attrIsRequired;
+ }
+
+ /**
+ * Getter for the name value.
+ *
+ * @return The name value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for the name value.
+ *
+ * @param attrName The personal attribute name.
+ */
+ public void setName(final String attrName) {
+ this.name = attrName;
+ }
+
+ /**
+ * Getter for the value.
+ *
+ * @return The list of values.
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Setter for the list of values.
+ *
+ * @param attrValue The personal attribute value.
+ */
+ public void setValue(final List<String> attrValue) {
+ if (attrValue != null) {
+ this.value = attrValue;
+ }
+ }
+
+
+ /**
+ * Getter for the type value.
+ *
+ * @return The name value.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Setter for the type value.
+ *
+ * @param attrName The personal attribute type.
+ */
+ public void setType(final String attrType) {
+ this.type = attrType;
+ }
+
+ /**
+ * Getter for the status.
+ *
+ * @return The status value.
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for the status value.
+ *
+ * @param attrStatus The personal attribute status.
+ */
+ public void setStatus(final String attrStatus) {
+ this.status = attrStatus;
+ }
+
+ /**
+ * Getter for the complex value.
+ *
+ * @return The complex value.
+ */
+ public Map<String, String> getComplexValue() {
+ return complexValue;
+ }
+
+ /**
+ * Setter for the complex value.
+ *
+ * @param complexVal The personal attribute Complex value.
+ */
+ public void setComplexValue(final Map<String, String> complexVal) {
+ if (complexVal != null) {
+ this.complexValue = complexVal;
+ }
+ }
+
+ /**
+ * Getter for the personal's friendly name.
+ *
+ * @return The personal's friendly name value.
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Setter for the personal's friendly name.
+ *
+ * @param fName The personal's friendly name.
+ */
+ public void setFriendlyName(final String fName) {
+ this.friendlyName = fName;
+ }
+
+ /**
+ * Return true the value is empty.
+ *
+ * @return True if the value is empty "[]";
+ */
+ public boolean isEmptyValue() {
+ return value.isEmpty() || (value.size() == 1 && value.get(0).length() == 0);
+ }
+
+ /**
+ * Returns true if the Complex Value is empty.
+ *
+ * @return True if the Complex Value is empty;
+ */
+ public boolean isEmptyComplexValue() {
+ return complexValue.isEmpty();
+ }
+
+ /**
+ * Returns true if the Status is empty.
+ *
+ * @return True if the Status is empty;
+ */
+ public boolean isEmptyStatus() {
+ return (status == null || status.length() == 0);
+ }
+
+ /**
+ * Prints the PersonalAttribute in the following format.
+ * name:required:[v,a,l,u,e,s]|[v=a,l=u,e=s]:status;
+ *
+ * @return The PersonalAttribute as a string.
+ */
+ public String toString() {
+ final StringBuilder strBuild = new StringBuilder();
+
+ AttributeUtil.appendIfNotNull(strBuild, getName());
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, String.valueOf(isRequired()));
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ strBuild.append('[');
+
+ if (isEmptyValue()) {
+ if (!isEmptyComplexValue()) {
+ AttributeUtil.appendIfNotNull(strBuild, AttributeUtil.mapToString(
+ getComplexValue(), PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+ } else {
+ AttributeUtil.appendIfNotNull(
+ strBuild,
+ AttributeUtil.listToString(getValue(),
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()));
+ }
+
+ strBuild.append(']');
+ strBuild.append(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString());
+ AttributeUtil.appendIfNotNull(strBuild, getStatus());
+ strBuild.append(PEPSValues.ATTRIBUTE_SEP.toString());
+
+ return strBuild.toString();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
new file mode 100644
index 000000000..9a0f87488
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/PersonalAttributeList.java
@@ -0,0 +1,397 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.StringTokenizer;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * PersonalAttributeList.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.27 $, $Date: 2010-11-18 22:54:56 $
+ *
+ * @see PersonalAttribute
+ */
+@SuppressWarnings("PMD")
+public final class PersonalAttributeList extends
+ ConcurrentHashMap<String, PersonalAttribute> implements IPersonalAttributeList, Serializable {
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger
+ .getLogger(PersonalAttributeList.class.getName());
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = 7375127363889975062L;
+
+ /**
+ * Hash with the latest fetched attribute name alias.
+ */
+ private final Map<String, Integer> latestAttrAlias =
+ new HashMap<String, Integer>();
+
+ /**
+ * Hash with mapping number of alias or the attribute name.
+ */
+ private final Map<String, Integer> attrAliasNumber =
+ new HashMap<String, Integer>();
+
+ /**
+ * Default constructor.
+ */
+ public PersonalAttributeList() {
+ // The best practices recommend to call the super constructor.
+ super();
+ }
+
+ /**
+ * Constructor with initial capacity for the PersonalAttributeList size.
+ *
+ * @param capacity The initial capacity for the PersonalAttributeList.
+ */
+ public PersonalAttributeList(final int capacity) {
+ super(capacity);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Iterator<PersonalAttribute> iterator() {
+ return this.values().iterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute get(final Object key) {
+ String attrName = (String) key;
+
+ if (this.latestAttrAlias.containsKey(key)) {
+ attrName = attrName + this.latestAttrAlias.get(key);
+ } else {
+ if (this.attrAliasNumber.containsKey(key)) {
+ this.latestAttrAlias.put(attrName, this.attrAliasNumber.get(key));
+ }
+ }
+ return super.get(attrName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(final PersonalAttribute value) {
+ if (value != null) {
+ this.put(value.getName(), value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PersonalAttribute put(final String key, final PersonalAttribute val) {
+ if (StringUtils.isNotEmpty(key) && val != null) {
+ // Validate if attribute name already exists!
+ String attrAlias = key;
+ if (this.containsKey(attrAlias)) {
+ //TODO isAgeOver should not be hardcoded, a better way of handling multipe isAgeOver requests should be implemented.
+ if (!val.isEmptyValue() && StringUtils.isNumeric(val.getValue().get(0)) && "isAgeOver".equals( val.getName() ) ) {
+ final String attrValue = val.getValue().get(0);
+ attrAlias = key + attrValue;
+ this.attrAliasNumber.put(key, Integer.valueOf(attrValue));
+ } else {
+ final PersonalAttribute attr = super.get(key);
+ if (!attr.isEmptyValue()
+ && StringUtils.isNumeric(attr.getValue().get(0))) {
+ attrAlias = key + attr.getValue().get(0);
+ super.put(key, (PersonalAttribute) attr);
+ this.attrAliasNumber.put(key, null);
+ }
+ }
+ }
+ return super.put(attrAlias, val);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void populate(final String attrList) {
+ final StringTokenizer strToken =
+ new StringTokenizer(attrList, PEPSValues.ATTRIBUTE_SEP.toString());
+
+ while (strToken.hasMoreTokens()) {
+ final PersonalAttribute persAttr = new PersonalAttribute();
+ String[] tuples =
+ strToken.nextToken().split(PEPSValues.ATTRIBUTE_TUPLE_SEP.toString(),
+ AttributeConstants.NUMBER_TUPLES.intValue());
+
+ // Convert to the new format if needed!
+ tuples = convertFormat(tuples);
+
+ if (AttributeUtil.hasValidTuples(tuples)) {
+ final int attrValueIndex =
+ AttributeConstants.ATTR_VALUE_INDEX.intValue();
+ final String tmpAttrValue =
+ tuples[attrValueIndex].substring(1,
+ tuples[attrValueIndex].length() - 1);
+ final String[] vals =
+ tmpAttrValue.split(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ persAttr.setName(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()]);
+ persAttr.setIsRequired(Boolean
+ .valueOf(tuples[AttributeConstants.ATTR_TYPE_INDEX.intValue()]));
+
+ // check if it is a complex value
+ if (isComplexValue(vals)) {
+ persAttr.setComplexValue(createComplexValue(vals));
+ }
+ else
+ {
+ persAttr.setValue(createValues(vals));
+ }
+
+ if (tuples.length == AttributeConstants.NUMBER_TUPLES.intValue()) {
+ persAttr.setStatus(tuples[AttributeConstants.ATTR_STATUS_INDEX
+ .intValue()]);
+ }
+ this.put(tuples[AttributeConstants.ATTR_NAME_INDEX.intValue()],
+ persAttr);
+
+ } else {
+ LOG.warn("Invalid personal attribute list tuples");
+ }
+
+ }
+ }
+
+ /**
+ * Returns a copy of this <tt>IPersonalAttributeList</tt> instance.
+ *
+ * @return The copy of this IPersonalAttributeList.
+ */
+ public Object clone() {
+ try {
+ return (PersonalAttributeList) super.clone();
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Creates a string in the following format.
+ *
+ * attrName:attrType:[attrValue1,attrValue2=attrComplexValue]:attrStatus;
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ final Iterator<Entry<String, PersonalAttribute>> itAttrs =
+ this.entrySet().iterator();
+ final StringBuilder strBuilder = new StringBuilder();
+
+ while (itAttrs.hasNext()) {
+ final Entry<String, PersonalAttribute> attrEntry = itAttrs.next();
+ final PersonalAttribute attr = attrEntry.getValue();
+ //strBuilder.append(attr.toString());
+ strBuilder.insert(0, attr.toString());
+ }
+
+ return strBuilder.toString();
+ }
+
+ /**
+ * Validates and creates the attribute's complex values.
+ *
+ * @param values The complex values.
+ *
+ * @return The {@link Map} with the complex values.
+ *
+ * @see Map
+ */
+ private Map<String, String> createComplexValue(final String[] values) {
+ final Map<String, String> complexValue = new HashMap<String, String>();
+ for (final String val : values) {
+ final String[] tVal = val.split("=");
+ if (StringUtils.isNotEmpty(val) && tVal.length == 2) {
+ complexValue.put(tVal[0], AttributeUtil.unescape(tVal[1]));
+ }
+ }
+ return complexValue;
+ }
+
+ /**
+ * Checks if value is complex or not
+ * @param values The values to check
+ * @return True if succesful
+ */
+ private boolean isComplexValue(final String[] values) {
+ boolean isComplex = false;
+ if (values.length > 0) {
+ final String[] tVal = values[0].split("=");
+ if (StringUtils.isNotEmpty(values[0]) && tVal.length == 2) {
+ isComplex = true;
+ }
+ }
+ return isComplex;
+ }
+
+ /**
+ * Validates and creates the attribute values.
+ *
+ * @param vals The attribute values.
+ *
+ * @return The {@link List} with the attribute values.
+ *
+ * @see List
+ */
+ private List<String> createValues(final String[] vals) {
+ final List<String> values = new ArrayList<String>();
+ for (final String val : vals) {
+ if (StringUtils.isNotEmpty(val)) {
+ values.add(AttributeUtil.unescape(val));
+ }
+ }
+ return values;
+ }
+
+ /**
+ * Converts the attribute tuple (attrName:attrType...) to the new format.
+ *
+ * @param tuples The attribute tuples to convert.
+ *
+ * @return The attribute tuples in the new format.
+ */
+ private String[] convertFormat(final String[] tuples) {
+ final String[] newFormatTuples =
+ new String[AttributeConstants.NUMBER_TUPLES.intValue()];
+ if (tuples != null) {
+ System.arraycopy(tuples, 0, newFormatTuples, 0, tuples.length);
+
+ for (int i = tuples.length; i < newFormatTuples.length; i++) {
+ if (i == AttributeConstants.ATTR_VALUE_INDEX.intValue()) {
+ newFormatTuples[i] = "[]";
+ } else {
+ newFormatTuples[i] = "";
+ }
+ }
+ }
+ return newFormatTuples;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the complex attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the complex attributes contained in this map.
+ */
+ public IPersonalAttributeList getComplexAttributes() {
+ LOG.info("get complex attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(!attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding complex attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getSimpleValueAttributes() {
+ LOG.info("get simple attributes");
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.getComplexValue().isEmpty()) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding simple attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+
+ /**
+ * Returns a IPersonalAttributeList of the mandatory attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map.
+ */
+ public IPersonalAttributeList getMandatoryAttributes() {
+ return getAttributesByParam(true);
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the attributes in this map by parameter value.
+ *
+ * @param compareValue The boolean to get mandatory (true) or optional (false) attributes.
+ *
+ * @return an IPersonalAttributeList of the mandatory attributes contained in this map if compareValue is true or optional otherwise.
+ */
+ private IPersonalAttributeList getAttributesByParam(final boolean compareValue) {
+ LOG.info("get attributes by param :"+compareValue);
+ IPersonalAttributeList attrList = new PersonalAttributeList();
+ for(PersonalAttribute attr: this) {
+ if(attr.isRequired() == compareValue) {
+ attrList.put(attr.getName(), attr);
+ LOG.info("adding attribute:"+attr.getName());
+ }
+ }
+ return attrList;
+ }
+
+
+ /**
+ * Returns a IPersonalAttributeList of the optional attributes in this map.
+ *
+ * @return an IPersonalAttributeList of the optional attributes contained in this map.
+ */
+ public IPersonalAttributeList getOptionalAttributes() {
+ return getAttributesByParam(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasMissingValues() {
+ for(PersonalAttribute attr: this) {
+ if(attr.isEmptyValue() && attr.isEmptyComplexValue()) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
new file mode 100644
index 000000000..65936f1a8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryRequest.java
@@ -0,0 +1,447 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+public class STORKAttrQueryRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAttrQueryRequest</tt> instance.
+ *
+ * @return The copy of this STORKAttrQueryRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAttrQueryRequest storkAttrQueryReq = null;
+ storkAttrQueryReq = (STORKAttrQueryRequest) super.clone();
+ storkAttrQueryReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAttrQueryReq.setTokenSaml(getTokenSaml());
+ return storkAttrQueryReq;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
new file mode 100644
index 000000000..1974f4f66
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAttrQueryResponse.java
@@ -0,0 +1,392 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+public class STORKAttrQueryResponse implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 7653893041391541235L;
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Request failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** The complete assertion **/
+ private Assertion assertion;
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /** Citizen's personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAttrQueryResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ /** Get the assertion from the response **/
+ public Assertion getAssertion() {
+ return assertion;
+ }
+
+ /** Set the assertion in the response **/
+ public void setAssertion(final Assertion nAssertion) {
+ this.assertion = nAssertion;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
new file mode 100644
index 000000000..2354d0eb1
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnRequest.java
@@ -0,0 +1,495 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnRequest (SAML Token Request).
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.21 $, $Date: 2011-02-17 22:44:34 $
+ */
+public final class STORKAuthnRequest implements Serializable, Cloneable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnRequest.class
+ .getName());
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The assertion consumer service url. */
+ private String serviceURL;
+
+ /** The destination. */
+ private String destination;
+
+ /** The provider name. */
+ private String providerName;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The e id sector share. */
+ private boolean eIDSectorShare;
+
+ /** The e id cross sector share. */
+ private boolean eIDCrossSectorShare;
+
+ /** The e id cross border share. */
+ private boolean eIDCrossBorderShare;
+
+ /** The personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The country. */
+ private String country;
+
+ /** The citizen country code. */
+ private String citizenCountry;
+
+ /** The Service Provider ID. */
+ private String sPID;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return sPID The SP ID.
+ */
+ public String getSPID() {
+ return sPID;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param sPId The new sp samlId.
+ */
+ public void setSPID(final String sPId) {
+ this.sPID = sPId;
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return The citizen country code value.
+ */
+ public String getCitizenCountryCode() {
+ return citizenCountry;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param countryCode the new citizen country code value.
+ */
+ public void setCitizenCountryCode(final String countryCode) {
+ this.citizenCountry = countryCode;
+ }
+
+ /**
+ * Gets the sp country.
+ *
+ * @return The sp country value.
+ */
+ public String getSpCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the sp country.
+ *
+ * @param sPCountry the new sp country value.
+ */
+ public void setSpCountry(final String sPCountry) {
+ this.spCountry = sPCountry;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the serviceURL value.
+ *
+ * @return The serviceURL value.
+ */
+ public String getAssertionConsumerServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Setter for the serviceURL value.
+ *
+ * @param newServiceURL the assertion consumer service URL.
+ */
+ public void setAssertionConsumerServiceURL(final String newServiceURL) {
+ this.serviceURL = newServiceURL;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The provider name value.
+ */
+ public String getProviderName() {
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param samlProvider the provider name value.
+ */
+ public void setProviderName(final String samlProvider) {
+ this.providerName = samlProvider;
+ }
+
+ /**
+ * Getter for the attributeList value.
+ *
+ * @return The attributeList value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the attributeList value.
+ *
+ * @param attrList the personal attribute list value.
+ *
+ * @see IPersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return The service provider sector value.
+ */
+ public String getSpSector() {
+ return spSector;
+ }
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param samlSPSector the new service provider sector value.
+ */
+ public void setSpSector(final String samlSPSector) {
+ this.spSector = samlSPSector;
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return The service provider institution value.
+ */
+ public String getSpInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param samlSPInst the new service provider institution value.
+ */
+ public void setSpInstitution(final String samlSPInst) {
+ this.spInstitution = samlSPInst;
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return The service provider application value.
+ */
+ public String getSpApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param samlSPApp the new service provider application value.
+ */
+ public void setSpApplication(final String samlSPApp) {
+ this.spApplication = samlSPApp;
+ }
+
+ /**
+ * Checks if is eId sector share.
+ *
+ * @return true, if is eId sector share.
+ */
+ public boolean isEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eId sector share.
+ *
+ * @param eIdSectorShare the new eId sector share value.
+ */
+ public void setEIDSectorShare(final boolean eIdSectorShare) {
+ this.eIDSectorShare = eIdSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross sector share.
+ *
+ * @return true, if is eId cross sector share.
+ */
+ public boolean isEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+ /**
+ * Sets the eId cross sector share.
+ *
+ * @param eIdCrossSectorShare the new eId cross sector share value.
+ */
+ public void setEIDCrossSectorShare(final boolean eIdCrossSectorShare) {
+ this.eIDCrossSectorShare = eIdCrossSectorShare;
+ }
+
+ /**
+ * Checks if is eId cross border share.
+ *
+ * @return true, if is eId cross border share.
+ */
+ public boolean isEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+ /**
+ * Sets the eId cross border share.
+ *
+ * @param eIdCrossBorderShare the new eId cross border share value.
+ */
+ public void setEIDCrossBorderShare(final boolean eIdCrossBorderShare) {
+ this.eIDCrossBorderShare = eIdCrossBorderShare;
+ }
+
+ /**
+ * Returns a copy of this <tt>STORKAuthnRequest</tt> instance.
+ *
+ * @return The copy of this STORKAuthnRequest.
+ * @throws CloneNotSupportedException on clone exception
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKAuthnRequest storkAuthnReq = null;
+ try {
+ storkAuthnReq = (STORKAuthnRequest) super.clone();
+ storkAuthnReq.setPersonalAttributeList(getPersonalAttributeList());
+ storkAuthnReq.setTokenSaml(getTokenSaml());
+ } catch (final CloneNotSupportedException e) {
+ // assert false;
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+
+ return storkAuthnReq;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
new file mode 100644
index 000000000..c4a3e2b6c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKAuthnResponse.java
@@ -0,0 +1,387 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.opensaml.saml2.core.Assertion;
+
+/**
+ * This class is a bean used to store the information relative to the
+ * STORKAuthnResponse.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class STORKAuthnResponse implements Serializable {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -9100982727074068660L;
+
+ /** Response Id. */
+ private String samlId;
+
+ /** Authentication failed? */
+ private boolean fail;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Audience restriction. */
+ private transient String audienceRest;
+
+ /** Error message. */
+ private String message;
+
+ /** Id of the request that originated this response. */
+ private String inResponseTo;
+
+ /** Expiration date. */
+ private DateTime notOnOrAfter;
+
+ /** Creation date. */
+ private DateTime notBefore;
+
+ /** The SAML token. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** Country. */
+ private String country;
+
+ /** Citizen's personal attribute list. */
+ private IPersonalAttributeList attributeList = new PersonalAttributeList();
+
+ /** List of all assertions in response **/
+ private List<Assertion> assertions;
+
+ /** The complete list from all assertions **/
+ private transient IPersonalAttributeList totalAttributeList = new PersonalAttributeList();
+
+ /** All personal attribute lists **/
+ private List<IPersonalAttributeList> attributeLists;
+
+ /**
+ * Logger object.
+ */
+ private static final Logger LOG = Logger.getLogger(STORKAuthnResponse.class.getName());
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Getter for audienceRest.
+ *
+ * @return The audienceRest value.
+ */
+ public String getAudienceRestriction() {
+ return audienceRest;
+ }
+
+ /**
+ * Setter for audienceRest.
+ *
+ * @param audRest the new audienceRest value.
+ */
+ public void setAudienceRestriction(final String audRest) {
+ this.audienceRest = audRest;
+ }
+
+ /**
+ * Getter for the samlToken.
+ *
+ * @return The samlToken value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Setter for samlToken.
+ *
+ * @param samlToken the new tokenSaml value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Getter for the country name.
+ *
+ * @return The country name value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Setter for the country name.
+ *
+ * @param cCountry the new country name value.
+ */
+ public void setCountry(final String cCountry) {
+ this.country = cCountry;
+ }
+
+ /**
+ * Getter for pal value.
+ *
+ * @return The pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) attributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.attributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for the inResponseTo value.
+ *
+ * @return The inResponseTo value.
+ */
+ public String getInResponseTo() {
+ return inResponseTo;
+ }
+
+ /**
+ * Setter for the inResponseTo value.
+ *
+ * @param samlInResponseTo the new inResponseTo value.
+ */
+ public void setInResponseTo(final String samlInResponseTo) {
+ this.inResponseTo = samlInResponseTo;
+ }
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the message value.
+ *
+ * @return The message value.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Setter for the message value.
+ *
+ * @param msg the new message value.
+ */
+ public void setMessage(final String msg) {
+ this.message = msg;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param nSamlId the new samlId value.
+ */
+ public void setSamlId(final String nSamlId) {
+ this.samlId = nSamlId;
+ }
+
+ /**
+ * Getter for the notOnOrAfter value.
+ *
+ * @return The notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotOnOrAfter() {
+ return this.notOnOrAfter;
+ }
+
+ /**
+ * Setter for the notOnOrAfter value.
+ *
+ * @param nOnOrAfter the new notOnOrAfter value.
+ *
+ * @see DateTime
+ */
+ public void setNotOnOrAfter(final DateTime nOnOrAfter) {
+ this.notOnOrAfter = nOnOrAfter;
+ }
+
+ /**
+ * Getter for the notBefore value.
+ *
+ * @return The notBefore value.
+ *
+ * @see DateTime
+ */
+ public DateTime getNotBefore() {
+ return notBefore;
+ }
+
+ /**
+ * Setter for the notBefore value.
+ *
+ * @param nBefore the new notBefore value.
+ *
+ * @see DateTime
+ */
+ public void setNotBefore(final DateTime nBefore) {
+ this.notBefore = nBefore;
+ }
+
+ public void setAssertions(List<Assertion> newAssert) {
+ this.assertions = newAssert;
+ }
+
+ public List<Assertion> getAssertions() {
+ return assertions;
+ }
+
+ /**
+ * Getter for the toal pal value.
+ *
+ * @return The total pal value.
+ *
+ * @see PersonalAttributeList
+ */
+ public IPersonalAttributeList getTotalPersonalAttributeList() {
+ IPersonalAttributeList personnalAttributeList = null;
+ try {
+ personnalAttributeList = (IPersonalAttributeList) totalAttributeList.clone();
+ } catch (CloneNotSupportedException e1) {
+ LOG.trace("[PersonalAttribute] Nothing to do.");
+ }
+ return personnalAttributeList;
+ }
+
+ /**
+ * Setter for the total Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setTotalPersonalAttributeList(final IPersonalAttributeList attrList) {
+ if (attrList != null) {
+ this.totalAttributeList = attrList;
+ }
+ }
+
+ /**
+ * Getter for personal attribute lists
+ *
+ * @return The lists
+ *
+ * @see PersonalAttributeList
+ */
+ public List<IPersonalAttributeList> getPersonalAttributeLists() {
+ return attributeLists;
+ }
+
+ /**
+ * Setter for the Personal Attribute List value.
+ *
+ * @param attrList the new value.
+ *
+ * @see PersonalAttributeList
+ */
+ public void setPersonalAttributeLists(final List<IPersonalAttributeList> attrLists) {
+ if (attrLists != null) {
+ this.attributeLists = attrLists;
+ }
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
new file mode 100644
index 000000000..44811aee2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutRequest.java
@@ -0,0 +1,197 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutRequest implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The qaa. */
+ private int qaa;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** The ID of principal as known to SP **/
+ private String spProvidedId;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the qaa value.
+ *
+ * @return The qaa value value.
+ */
+ public int getQaa() {
+ return qaa;
+ }
+
+ /**
+ * Setter for the qaa value.
+ *
+ * @param qaaLevel The new qaa value.
+ */
+ public void setQaa(final int qaaLevel) {
+ this.qaa = qaaLevel;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+ /** Getter for spProvidedId **/
+ public String getSpProvidedId() {
+ return spProvidedId;
+ }
+
+ public void setSpProvidedId(final String nSpProvidedId) {
+ this.spProvidedId = nSpProvidedId;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutRequest storkLogoutRequest = null;
+ storkLogoutRequest = (STORKLogoutRequest) super.clone();
+ storkLogoutRequest.setTokenSaml(getTokenSaml());
+ return storkLogoutRequest;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
new file mode 100644
index 000000000..21b53a652
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKLogoutResponse.java
@@ -0,0 +1,250 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+
+public class STORKLogoutResponse implements Serializable, Cloneable {
+ private static final long serialVersionUID = 4778480781609392750L;
+
+ /** The samlId. */
+ private String samlId;
+
+ /** The destination. */
+ private String destination;
+
+ /** The distinguished name. */
+ private String distinguishedName;
+
+ /** The token saml. */
+ private byte[] tokenSaml = new byte[0];
+
+ /** The issuer. */
+ private String issuer;
+
+ /** The country. */
+ private String country;
+
+ /** The Alias used at the keystore for saving this certificate. */
+ private String alias;
+
+ /** Status code. */
+ private String statusCode;
+
+ /** Secondary status code. */
+ private String subStatusCode;
+
+ /** Status message. */
+ private String statusMessage;
+
+ /** Logout failed? */
+ private boolean fail;
+
+ /**
+ * Gets the SP's Certificate Alias.
+ *
+ * @return alias The SP's Certificate Alias.
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the SP's Certificate Alias.
+ *
+ * @param nAlias The SP's Certificate Alias.
+ */
+ public void setAlias(final String nAlias) {
+ this.alias = nAlias;
+ }
+
+ /**
+ * Gets the issuer.
+ *
+ * @return The issuer value.
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * Sets the issuer.
+ *
+ * @param samlIssuer the new issuer value.
+ */
+ public void setIssuer(final String samlIssuer) {
+ this.issuer = samlIssuer;
+ }
+
+ /**
+ * Gets the SAML Token.
+ *
+ * @return The SAML Token value.
+ */
+ public byte[] getTokenSaml() {
+ return tokenSaml.clone();
+ }
+
+ /**
+ * Sets the SAML Token.
+ *
+ * @param samlToken The new SAML Token value.
+ */
+ public void setTokenSaml(final byte[] samlToken) {
+ if (samlToken != null) {
+ this.tokenSaml = samlToken.clone();
+ }
+ }
+
+ /**
+ * Gets the country.
+ *
+ * @return The country value.
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * Sets the country.
+ *
+ * @param nCountry the new country value.
+ */
+ public void setCountry(final String nCountry) {
+ this.country = nCountry;
+ }
+
+ /**
+ * Getter for the destination value.
+ *
+ * @return The destination value.
+ */
+ public String getDestination() {
+ return destination;
+ }
+
+ /**
+ * Setter for the destination value.
+ *
+ * @param detination the new destination value.
+ */
+ public void setDestination(final String detination) {
+ this.destination = detination;
+ }
+
+ /**
+ * Getter for the samlId value.
+ *
+ * @return The samlId value.
+ */
+ public String getSamlId() {
+ return samlId;
+ }
+
+ /**
+ * Setter for the samlId value.
+ *
+ * @param newSamlId the new samlId value.
+ */
+ public void setSamlId(final String newSamlId) {
+ this.samlId = newSamlId;
+ }
+
+ /**
+ * Getter for the distinguishedName value.
+ *
+ * @return The distinguishedName value.
+ */
+ public String getDistinguishedName() {
+ return distinguishedName;
+ }
+
+ /**
+ * Setter for the distinguishedName value.
+ *
+ * @param certDN the distinguished name value.
+ */
+ public void setDistinguishedName(final String certDN) {
+ this.distinguishedName = certDN;
+ }
+
+
+ /**
+ * Getter for the fail value.
+ *
+ * @return The fail value.
+ */
+ public boolean isFail() {
+ return fail;
+ }
+
+ /**
+ * Setter for the fail value.
+ *
+ * @param failVal the new fail value.
+ */
+ public void setFail(final boolean failVal) {
+ this.fail = failVal;
+ }
+
+ /**
+ * Getter for the statusCode value.
+ *
+ * @return The statusCode value.
+ */
+ public String getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Getter for the subStatusCode.
+ *
+ * @return The subStatusCode value.
+ */
+ public String getSubStatusCode() {
+ return subStatusCode;
+ }
+
+ /**
+ * Setter for the subStatusCode.
+ *
+ * @param samlSubStatusCode the new subStatusCode value.
+ */
+ public void setSubStatusCode(final String samlSubStatusCode) {
+ this.subStatusCode = samlSubStatusCode;
+ }
+
+ /**
+ * Setter for the statusMessage value.
+ *
+ * @param status the new statusMessage value.
+ */
+ public void setStatusMessage(final String status) {
+ this.statusMessage = status;
+ }
+
+ /**
+ * Getter for the statusMessage value.
+ *
+ * @return The statusMessage value.
+ */
+ public String getStatusMessage() {
+ return statusMessage;
+ }
+
+ /**
+ * Setter for the statusCode value.
+ *
+ * @param status the new statusCode value.
+ */
+ public void setStatusCode(final String status) {
+ this.statusCode = status;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException{
+ STORKLogoutResponse storkLogoutResponse = null;
+ storkLogoutResponse = (STORKLogoutResponse) super.clone();
+ storkLogoutResponse.setTokenSaml(getTokenSaml());
+ return storkLogoutResponse;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
new file mode 100644
index 000000000..a9c4a156b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKStatusCode.java
@@ -0,0 +1,68 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKStatusCode {
+
+ /** URI for Requester status code. */
+ REQUESTER_URI("urn:oasis:names:tc:SAML:2.0:status:Requester"),
+
+ /** URI for Responder status code. */
+ RESPONDER_URI("urn:oasis:names:tc:SAML:2.0:status:Responder"),
+
+ /** URI for Success status code. */
+ SUCCESS_URI("urn:oasis:names:tc:SAML:2.0:status:Success"),
+
+ /** Attribute is Available. */
+ STATUS_AVAILABLE("Available"),
+
+ /** Attribute is NotAvailable. */
+ STATUS_NOT_AVAILABLE("NotAvailable"),
+
+ /** Attribute is Withheld. */
+ STATUS_WITHHELD("Withheld");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
new file mode 100644
index 000000000..0a711c9b7
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/STORKSubStatusCode.java
@@ -0,0 +1,71 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons;
+
+/**
+ * This enum class contains the SAML Token Sub Status Code.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.7 $, $Date: 2010-11-17 05:15:28 $
+ */
+public enum STORKSubStatusCode {
+
+ /** URI for AuthnFailed status code. */
+ AUTHN_FAILED_URI("urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"),
+
+ /** URI for InvalidAttrNameOrValue status code. */
+ INVALID_ATTR_NAME_VALUE_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"),
+
+ /** URI for InvalidNameIDPolicy status code. */
+ INVALID_NAMEID_POLICY_URI(
+ "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"),
+
+ /** URI for VersionMismatch status code. */
+ VERSION_MISMATCH_URI("urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"),
+
+ /** URI for RequestDenied status code. */
+ REQUEST_DENIED_URI("urn:oasis:names:tc:SAML:2.0:status:RequestDenied"),
+
+ /** URI for QaaNotSupported status code. */
+ QAA_NOT_SUPPORTED(
+ "http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported");
+
+ /**
+ * Represents the constant's value.
+ */
+ private String value;
+
+ /**
+ * Solo Constructor.
+ *
+ * @param val The Constant value.
+ */
+ private STORKSubStatusCode(final String val) {
+
+ this.value = val;
+ }
+
+ /**
+ * Return the Constant Value.
+ *
+ * @return The constant value.
+ */
+ public String toString() {
+
+ return value;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops
new file mode 100644
index 000000000..14f05b17c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/all-wcprops
@@ -0,0 +1,53 @@
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions
+END
+InvalidParameterPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 131
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
+END
+SecurityPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 123
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
+END
+InvalidSessionPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 129
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
+END
+CPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 116
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
+END
+StorkPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 120
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
+END
+AbstractPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 123
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
+END
+InternalErrorPEPSException.java
+K 25
+svn:wc:ra_dav:version-url
+V 128
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries
new file mode 100644
index 000000000..8ca1e325f
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/entries
@@ -0,0 +1,300 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/commons/exceptions
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+CPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+5d3cb4a7303baeaf2104aaa7da301b21
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3570
+
+StorkPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+fea01f750728ea5f15b449acb517f4b2
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1690
+
+AbstractPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+c9aedb030e6dbc9f002c7cd3d52cf03f
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4422
+
+InternalErrorPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+36d8f6310e84c550f65bef78d5dc4238
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2471
+
+InvalidParameterPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+c6ad53378b03a346ca0fc48a381ed771
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1800
+
+SecurityPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+78d50b78a69cb0c630e4e14420e3b7be
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2199
+
+InvalidSessionPEPSException.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+5fd7f04ad6f6cc121084e682b2a4e678
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1555
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.626475Z
+7055c01b74382c525c7fcf110646d8fc
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+129
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base
new file mode 100644
index 000000000..e9a96d7c2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/AbstractPEPSException.java.svn-base
@@ -0,0 +1,173 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+import java.io.Serializable;
+
+/**
+ * Abstract class to represent the various PEPS exceptions.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public abstract class AbstractPEPSException extends RuntimeException implements
+ Serializable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -1884417567740138022L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public AbstractPEPSException(final String code, final String message) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with the errorMessage as parameters and the Throwable
+ * cause.
+ *
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final Throwable cause) {
+
+ super(message, cause);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with three Strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final String samlToken) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Constructor with SAML Token as argument. Error message and error code are
+ * embedded in the SAML.
+ *
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String samlToken) {
+ super();
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Getter for errorCode.
+ *
+ * @return The errorCode value.
+ */
+ public final String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for errorCode.
+ *
+ * @param code The error code value.
+ */
+ public final void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for errorMessage.
+ *
+ * @return The error Message value.
+ */
+ public final String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for errorMessage.
+ *
+ * @param message The error message value.
+ */
+ public final void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for SAMLTokenFail.
+ *
+ * @return The error SAML Token.
+ */
+ public final String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for SAMLTokenFail.
+ *
+ * @param samlToken The error SAML token.
+ */
+ public final void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base
new file mode 100644
index 000000000..69cb20fdd
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/CPEPSException.java.svn-base
@@ -0,0 +1,143 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * This exception is thrown by the C-PEPS service and holds the relative
+ * information to present to the citizen.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CPEPSException extends RuntimeException {
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = -4012295047127999362L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message) {
+
+ super(message);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The original exception;
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+ return this.getErrorMessage() + " (" + this.getErrorCode() + ")";
+ }
+
+ /**
+ * Getter for the error code.
+ *
+ * @return The errorCode value.
+ */
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for the error code.
+ *
+ * @param code The error code.
+ */
+ public void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for the error message.
+ *
+ * @return The errorMessage value.
+ */
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for the error message.
+ *
+ * @param message The error message.
+ */
+ public void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for the samlTokenFail.
+ *
+ * @return The samlTokenFail value.
+ */
+ public String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for the samlTokenFail.
+ *
+ * @param samlToken The error Saml Token.
+ */
+ public void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base
new file mode 100644
index 000000000..67514d4fe
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InternalErrorPEPSException.java.svn-base
@@ -0,0 +1,74 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Internal Error Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class InternalErrorPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 1193001455410319795L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with three strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final String samlTokenFail) {
+
+ super(errorCode, errorMessage, samlTokenFail);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base
new file mode 100644
index 000000000..12c83b589
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidParameterPEPSException.java.svn-base
@@ -0,0 +1,54 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid Parameter Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.11 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidParameterPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2046282148740524875L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error code message value.
+ */
+ public InvalidParameterPEPSException(final String errorCode,
+ final String errorMessage) {
+ super(errorCode, errorMessage);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InvalidParameterPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base
new file mode 100644
index 000000000..800525eee
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/InvalidSessionPEPSException.java.svn-base
@@ -0,0 +1,46 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid session Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.14 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidSessionPEPSException extends InvalidParameterPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7147090160978319016L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InvalidSessionPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base
new file mode 100644
index 000000000..fc27371d2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/SecurityPEPSException.java.svn-base
@@ -0,0 +1,67 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.18 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class SecurityPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 5605743302478554967L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public SecurityPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public SecurityPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public SecurityPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base
new file mode 100644
index 000000000..a2da61a02
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/StorkPEPSException.java.svn-base
@@ -0,0 +1,53 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class StorkPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8048033129798427574L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public StorkPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+
+ return "Security Error (" + this.getErrorCode() + ") processing request : "
+ + this.getErrorMessage();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..d83068beb
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,7 @@
+/**
+ * Package for the PEPS’ Exceptions handling.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
new file mode 100644
index 000000000..e9a96d7c2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/AbstractPEPSException.java
@@ -0,0 +1,173 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+import java.io.Serializable;
+
+/**
+ * Abstract class to represent the various PEPS exceptions.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ */
+public abstract class AbstractPEPSException extends RuntimeException implements
+ Serializable {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = -1884417567740138022L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public AbstractPEPSException(final String code, final String message) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with the errorMessage as parameters and the Throwable
+ * cause.
+ *
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The throwable object.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final Throwable cause) {
+
+ super(message, cause);
+ this.errorCode = code;
+ this.errorMessage = message;
+ }
+
+ /**
+ * Exception Constructor with three Strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String code, final String message,
+ final String samlToken) {
+
+ super(message);
+ this.errorCode = code;
+ this.errorMessage = message;
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Constructor with SAML Token as argument. Error message and error code are
+ * embedded in the SAML.
+ *
+ * @param samlToken The error SAML Token.
+ */
+ public AbstractPEPSException(final String samlToken) {
+ super();
+ this.samlTokenFail = samlToken;
+ }
+
+ /**
+ * Getter for errorCode.
+ *
+ * @return The errorCode value.
+ */
+ public final String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for errorCode.
+ *
+ * @param code The error code value.
+ */
+ public final void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for errorMessage.
+ *
+ * @return The error Message value.
+ */
+ public final String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for errorMessage.
+ *
+ * @param message The error message value.
+ */
+ public final void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for SAMLTokenFail.
+ *
+ * @return The error SAML Token.
+ */
+ public final String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for SAMLTokenFail.
+ *
+ * @param samlToken The error SAML token.
+ */
+ public final void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
new file mode 100644
index 000000000..69cb20fdd
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/CPEPSException.java
@@ -0,0 +1,143 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * This exception is thrown by the C-PEPS service and holds the relative
+ * information to present to the citizen.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.9 $, $Date: 2010-11-17 05:15:28 $
+ */
+public final class CPEPSException extends RuntimeException {
+
+ /**
+ * Serial id.
+ */
+ private static final long serialVersionUID = -4012295047127999362L;
+
+ /**
+ * Error code.
+ */
+ private String errorCode;
+
+ /**
+ * Error message.
+ */
+ private String errorMessage;
+
+ /**
+ * SAML token.
+ */
+ private String samlTokenFail;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message) {
+
+ super(message);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param samlToken The SAML Token.
+ * @param code The error code value.
+ * @param message The error message value.
+ * @param cause The original exception;
+ */
+ public CPEPSException(final String samlToken, final String code,
+ final String message, final Throwable cause) {
+
+ super(message, cause);
+ this.setErrorCode(code);
+ this.setErrorMessage(message);
+ this.setSamlTokenFail(samlToken);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+ return this.getErrorMessage() + " (" + this.getErrorCode() + ")";
+ }
+
+ /**
+ * Getter for the error code.
+ *
+ * @return The errorCode value.
+ */
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Setter for the error code.
+ *
+ * @param code The error code.
+ */
+ public void setErrorCode(final String code) {
+ this.errorCode = code;
+ }
+
+ /**
+ * Getter for the error message.
+ *
+ * @return The errorMessage value.
+ */
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Setter for the error message.
+ *
+ * @param message The error message.
+ */
+ public void setErrorMessage(final String message) {
+ this.errorMessage = message;
+ }
+
+ /**
+ * Getter for the samlTokenFail.
+ *
+ * @return The samlTokenFail value.
+ */
+ public String getSamlTokenFail() {
+ return samlTokenFail;
+ }
+
+ /**
+ * Setter for the samlTokenFail.
+ *
+ * @param samlToken The error Saml Token.
+ */
+ public void setSamlTokenFail(final String samlToken) {
+ this.samlTokenFail = samlToken;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
new file mode 100644
index 000000000..67514d4fe
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InternalErrorPEPSException.java
@@ -0,0 +1,74 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Internal Error Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.13 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class InternalErrorPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 1193001455410319795L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with three strings representing the errorCode,
+ * errorMessage and encoded samlToken as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage, final String samlTokenFail) {
+
+ super(errorCode, errorMessage, samlTokenFail);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InternalErrorPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
new file mode 100644
index 000000000..12c83b589
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidParameterPEPSException.java
@@ -0,0 +1,54 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid Parameter Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.11 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidParameterPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 2046282148740524875L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error code message value.
+ */
+ public InvalidParameterPEPSException(final String errorCode,
+ final String errorMessage) {
+ super(errorCode, errorMessage);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public InvalidParameterPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
new file mode 100644
index 000000000..800525eee
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/InvalidSessionPEPSException.java
@@ -0,0 +1,46 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Invalid session Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.14 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see InvalidParameterPEPSException
+ */
+public class InvalidSessionPEPSException extends InvalidParameterPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7147090160978319016L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ */
+ public InvalidSessionPEPSException(final String errorCode,
+ final String errorMessage) {
+
+ super(errorCode, errorMessage);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
new file mode 100644
index 000000000..fc27371d2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/SecurityPEPSException.java
@@ -0,0 +1,67 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.18 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class SecurityPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 5605743302478554967L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public SecurityPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters and the Throwable cause.
+ *
+ * @param errorCode The error code value.
+ * @param errorMessage The error message value.
+ * @param cause The throwable object.
+ */
+ public SecurityPEPSException(final String errorCode,
+ final String errorMessage, final Throwable cause) {
+
+ super(errorCode, errorMessage, cause);
+ }
+
+ /**
+ * Exception Constructor with one String representing the encoded samlToken.
+ *
+ * @param samlTokenFail The error SAML Token.
+ */
+ public SecurityPEPSException(final String samlTokenFail) {
+ super(samlTokenFail);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
new file mode 100644
index 000000000..a2da61a02
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/StorkPEPSException.java
@@ -0,0 +1,53 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
+/**
+ * Security PEPS Exception class.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.15 $, $Date: 2010-11-17 05:15:28 $
+ *
+ * @see AbstractPEPSException
+ */
+public final class StorkPEPSException extends AbstractPEPSException {
+
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 8048033129798427574L;
+
+ /**
+ * Exception Constructor with two Strings representing the errorCode and
+ * errorMessage as parameters.
+ *
+ * @param errorCode The error code value.
+ * @param errorMsg The error message value.
+ */
+ public StorkPEPSException(final String errorCode, final String errorMsg) {
+ super(errorCode, errorMsg);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getMessage() {
+
+ return "Security Error (" + this.getErrorCode() + ") processing request : "
+ + this.getErrorMessage();
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
new file mode 100644
index 000000000..d83068beb
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/exceptions/package-info.java
@@ -0,0 +1,7 @@
+/**
+ * Package for the PEPS’ Exceptions handling.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons.exceptions;
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
new file mode 100644
index 000000000..19d45aaa2
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/package-info.java
@@ -0,0 +1,9 @@
+/**
+ * Common Authentication Service functionalities to be deployed in every PEPS
+ * is contained in this package.
+ * In particular, it contains the SAML Engine that implements the SAML messages
+ * management
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.commons;
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops
new file mode 100644
index 000000000..3cd5d5378
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/all-wcprops
@@ -0,0 +1,41 @@
+K 25
+svn:wc:ra_dav:version-url
+V 87
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific
+END
+IDeriveAttribute.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
+END
+IAUService.java
+K 25
+svn:wc:ra_dav:version-url
+V 103
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
+END
+INormaliseValue.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
+END
+ITranslatorService.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 104
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
+END
+ICheckAttributeValue.java
+K 25
+svn:wc:ra_dav:version-url
+V 112
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries
new file mode 100644
index 000000000..acd798b61
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/entries
@@ -0,0 +1,232 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/auth/specific
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+ITranslatorService.java
+file
+
+
+
+
+2014-01-21T08:38:55.228702Z
+c027ed5506150c744b8e586b325de5fb
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3120
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+eef7721d55c2edb02a432fc08ae9e487
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+164
+
+ICheckAttributeValue.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+b0472ff15d1c86f175da134b0f0eda71
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1321
+
+IDeriveAttribute.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+dce3856a97583f739cdf50ca78491277
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1504
+
+IAUService.java
+file
+
+
+
+
+2014-01-21T08:38:55.228702Z
+b622aaaa29b0cd72261ca7799db691b9
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7023
+
+INormaliseValue.java
+file
+
+
+
+
+2013-12-20T12:27:56.654475Z
+09f6e376875762fca294be4dfecb71f1
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1237
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base
new file mode 100644
index 000000000..5c24cc5a8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IAUService.java.svn-base
@@ -0,0 +1,215 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.Map;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+
+/**
+ * Interface for Specific Authentication methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IAUService {
+
+ /**
+ * Prepares the citizen to be redirected to the IdP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareCitizenAuthentication(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Prepares the citizen to be redirected to the PV.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] preparePVRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Authenticates a citizen.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList authenticateCitizen(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Validates a power.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List (power validated).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList powerValidation(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Prepares the Citizen browser to be redirected to the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return true in case of no error.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean prepareAPRedirect(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Returns the attributes values from the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The request attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList getAttributesFromAttributeProviders(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Get the attributes from the AP with verification.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The HTTP Parameters.
+ * @param requestAttributes The requested Attributes.
+ * @param session The session object.
+ * @param auProcessId The SAML identifier.
+ *
+ * @return true if the attributes were correctly verified.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean getAttributesWithVerification(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session, String auProcessId);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAuthnResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAuthnResponse processAuthenticationResponse(byte[] samlToken,
+ IStorkSession session);
+
+ /**
+ * Generates a SAML Response in case of error.
+ *
+ * @param inResponseTo The SAML's identifier to response.
+ * @param issuer The issuer value.
+ * @param assertionURL The assertion URL.
+ * @param code The error code.
+ * @param subcode The sub error code.
+ * @param message The error message.
+ * @param ipUserAddress The user IP address.
+ *
+ * @return byte[] containing the SAML Response.
+ */
+ byte[] generateErrorAuthenticationResponse(String inResponseTo,
+ String issuer, String assertionURL, String code, String subcode,
+ String message, String ipUserAddress);
+
+ /**
+ * Compares two given personal attribute lists.
+ *
+ * @param original The original Personal Attribute List.
+ * @param modified The modified Personal Attribute List.
+ * @return true if the original list contains the modified one. False
+ * otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean comparePersonalAttributeLists(IPersonalAttributeList original,
+ IPersonalAttributeList modified);
+
+ /**
+ * Prepares the citizen to be redirected to the AtP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareAttributeRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, IStorkSession session);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAttrQueryResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAttrQueryResponse processAttributeResponse(byte[] samlToken,
+ IStorkSession session);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base
new file mode 100644
index 000000000..31a8d78ff
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ICheckAttributeValue.java.svn-base
@@ -0,0 +1,37 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.List;
+
+/**
+ * Interface that defines the methods to work with the validation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ICheckAttributeValue {
+
+ /**
+ * Checks if the list of values contains the expected value.
+ *
+ * @param values The List of values.
+ * @param expectedValue The value to check if it exists on the list.
+ *
+ * @return boolean true, if the value is present in the list. False,
+ * otherwise.
+ */
+ boolean checkValue(List<String> values, String expectedValue);
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base
new file mode 100644
index 000000000..78eb53004
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/IDeriveAttribute.java.svn-base
@@ -0,0 +1,40 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface that defines the methods to work with derivation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IDeriveAttribute {
+
+ /**
+ * Derives the attribute value. Set the Personal Attribute value to null if
+ * the value in session or the value of age are invalid (non-numeric or null).
+ *
+ * @param personalAttrList The Personal Attribute List.
+ * @param session The session object.
+ *
+ * @see PersonalAttribute The personal Attribute
+ * @see IStorkSession The session object.
+ */
+ void deriveAttributeToData(PersonalAttribute personalAttrList,
+ IStorkSession session);
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base
new file mode 100644
index 000000000..ca2114e32
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/INormaliseValue.java.svn-base
@@ -0,0 +1,35 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface for attribute's value normalisation.
+ *
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface INormaliseValue {
+
+ /**
+ * Translates the attribute's value from local format to STORK format.
+ *
+ * @param personalAttribute The Personal Attribute to normalise the value.
+ *
+ * @see PersonalAttribute
+ */
+ void normaliseAttributeValueToStork(PersonalAttribute personalAttribute);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base
new file mode 100644
index 000000000..8a33897d8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/ITranslatorService.java.svn-base
@@ -0,0 +1,100 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+
+/**
+ * Interface for attributes normalization.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ITranslatorService {
+
+ /**
+ * Translates the attributes from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The Personal Attribute List with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes values from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised values.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeValuesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes from STORK format to local format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names To Stork format.
+ *
+ * @param personalList The Personal Attribute List,
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names from Stork format.
+ *
+ * @param session The session object.
+ * @param modifiedList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IStorkSession
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeToStork(IStorkSession session,
+ IPersonalAttributeList modifiedList);
+
+ /**
+ * Validate the values of the attributes.
+ *
+ * @param pal The attribute list
+ *
+ * @return True, if all the attributes have values. False, otherwise.
+ *
+ * @see STORKAuthnRequest
+ */
+ boolean checkAttributeValues(IPersonalAttributeList pa);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..a25c52311
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,8 @@
+/**
+ * Specific PEPS Interfaces that implements functionality of the Authentication
+ * Service.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.specific;
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
new file mode 100644
index 000000000..5c24cc5a8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IAUService.java
@@ -0,0 +1,215 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.Map;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+
+/**
+ * Interface for Specific Authentication methods.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IAUService {
+
+ /**
+ * Prepares the citizen to be redirected to the IdP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareCitizenAuthentication(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Prepares the citizen to be redirected to the PV.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The Requested attributes.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] preparePVRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Authenticates a citizen.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList authenticateCitizen(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Validates a power.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return The updated Personal Attribute List (power validated).
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList powerValidation(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Prepares the Citizen browser to be redirected to the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ * @param requestAttributes The requested attributes.
+ *
+ * @return true in case of no error.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean prepareAPRedirect(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session);
+
+ /**
+ * Returns the attributes values from the AP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param requestAttributes The request attributes.
+ *
+ * @return The updated Personal Attribute List.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList getAttributesFromAttributeProviders(
+ IPersonalAttributeList personalList, Map<String, Object> parameters,
+ Map<String, Object> requestAttributes);
+
+ /**
+ * Get the attributes from the AP with verification.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The HTTP Parameters.
+ * @param requestAttributes The requested Attributes.
+ * @param session The session object.
+ * @param auProcessId The SAML identifier.
+ *
+ * @return true if the attributes were correctly verified.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ boolean getAttributesWithVerification(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, Map<String, Object> requestAttributes,
+ IStorkSession session, String auProcessId);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAuthnResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAuthnResponse processAuthenticationResponse(byte[] samlToken,
+ IStorkSession session);
+
+ /**
+ * Generates a SAML Response in case of error.
+ *
+ * @param inResponseTo The SAML's identifier to response.
+ * @param issuer The issuer value.
+ * @param assertionURL The assertion URL.
+ * @param code The error code.
+ * @param subcode The sub error code.
+ * @param message The error message.
+ * @param ipUserAddress The user IP address.
+ *
+ * @return byte[] containing the SAML Response.
+ */
+ byte[] generateErrorAuthenticationResponse(String inResponseTo,
+ String issuer, String assertionURL, String code, String subcode,
+ String message, String ipUserAddress);
+
+ /**
+ * Compares two given personal attribute lists.
+ *
+ * @param original The original Personal Attribute List.
+ * @param modified The modified Personal Attribute List.
+ * @return true if the original list contains the modified one. False
+ * otherwise.
+ *
+ * @see IPersonalAttributeList
+ */
+ boolean comparePersonalAttributeLists(IPersonalAttributeList original,
+ IPersonalAttributeList modified);
+
+ /**
+ * Prepares the citizen to be redirected to the AtP.
+ *
+ * @param personalList The Personal Attribute List.
+ * @param parameters The parameters.
+ * @param session The session object.
+ *
+ * @return byte[] containing a SAML Request.
+ *
+ * @see IPersonalAttributeList
+ * @see IStorkSession
+ */
+ byte[] prepareAttributeRequest(IPersonalAttributeList personalList,
+ Map<String, Object> parameters, IStorkSession session);
+
+ /**
+ * Validates a SAML Response.
+ *
+ * @param samlToken The SAML Token.
+ * @param session The session object.
+ *
+ * @return the STORKAttrQueryResponse associated with the validated response.
+ *
+ * @see IStorkSession
+ */
+ STORKAttrQueryResponse processAttributeResponse(byte[] samlToken,
+ IStorkSession session);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
new file mode 100644
index 000000000..31a8d78ff
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ICheckAttributeValue.java
@@ -0,0 +1,37 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import java.util.List;
+
+/**
+ * Interface that defines the methods to work with the validation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ICheckAttributeValue {
+
+ /**
+ * Checks if the list of values contains the expected value.
+ *
+ * @param values The List of values.
+ * @param expectedValue The value to check if it exists on the list.
+ *
+ * @return boolean true, if the value is present in the list. False,
+ * otherwise.
+ */
+ boolean checkValue(List<String> values, String expectedValue);
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
new file mode 100644
index 000000000..78eb53004
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/IDeriveAttribute.java
@@ -0,0 +1,40 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface that defines the methods to work with derivation of attributes.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface IDeriveAttribute {
+
+ /**
+ * Derives the attribute value. Set the Personal Attribute value to null if
+ * the value in session or the value of age are invalid (non-numeric or null).
+ *
+ * @param personalAttrList The Personal Attribute List.
+ * @param session The session object.
+ *
+ * @see PersonalAttribute The personal Attribute
+ * @see IStorkSession The session object.
+ */
+ void deriveAttributeToData(PersonalAttribute personalAttrList,
+ IStorkSession session);
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
new file mode 100644
index 000000000..ca2114e32
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/INormaliseValue.java
@@ -0,0 +1,35 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+
+/**
+ * Interface for attribute's value normalisation.
+ *
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface INormaliseValue {
+
+ /**
+ * Translates the attribute's value from local format to STORK format.
+ *
+ * @param personalAttribute The Personal Attribute to normalise the value.
+ *
+ * @see PersonalAttribute
+ */
+ void normaliseAttributeValueToStork(PersonalAttribute personalAttribute);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
new file mode 100644
index 000000000..8a33897d8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/ITranslatorService.java
@@ -0,0 +1,100 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.auth.specific;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.IStorkSession;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+
+/**
+ * Interface for attributes normalization.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com
+ */
+public interface ITranslatorService {
+
+ /**
+ * Translates the attributes from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The Personal Attribute List with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes values from local format to STORK format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised values.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeValuesToStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Translates the attributes from STORK format to local format.
+ *
+ * @param personalList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with normalised attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList normaliseAttributeNamesFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names To Stork format.
+ *
+ * @param personalList The Personal Attribute List,
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeFromStork(
+ IPersonalAttributeList personalList);
+
+ /**
+ * Derive Attribute Names from Stork format.
+ *
+ * @param session The session object.
+ * @param modifiedList The Personal Attribute List.
+ *
+ * @return The PersonalAttributeList with derived attributes.
+ *
+ * @see IStorkSession
+ * @see IPersonalAttributeList
+ */
+ IPersonalAttributeList deriveAttributeToStork(IStorkSession session,
+ IPersonalAttributeList modifiedList);
+
+ /**
+ * Validate the values of the attributes.
+ *
+ * @param pal The attribute list
+ *
+ * @return True, if all the attributes have values. False, otherwise.
+ *
+ * @see STORKAuthnRequest
+ */
+ boolean checkAttributeValues(IPersonalAttributeList pa);
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
new file mode 100644
index 000000000..a25c52311
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/specific/package-info.java
@@ -0,0 +1,8 @@
+/**
+ * Specific PEPS Interfaces that implements functionality of the Authentication
+ * Service.
+ *
+ * @since 1.0
+ */
+package eu.stork.peps.auth.specific;
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/all-wcprops
new file mode 100644
index 000000000..d792fc132
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 81
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/entries
new file mode 100644
index 000000000..e43413c41
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/complex
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+attributes
+dir
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/all-wcprops b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/all-wcprops
new file mode 100644
index 000000000..76286973c
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/all-wcprops
@@ -0,0 +1,125 @@
+K 25
+svn:wc:ra_dav:version-url
+V 92
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes
+END
+ObjectFactory.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/ObjectFactory.java
+END
+IsTeacherOfType.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsTeacherOfType.java
+END
+CanonicalAddressType.java
+K 25
+svn:wc:ra_dav:version-url
+V 118
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/CanonicalAddressType.java
+END
+IsCourseCoordinatorType.java
+K 25
+svn:wc:ra_dav:version-url
+V 121
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsCourseCoordinatorType.java
+END
+MandateContentType.java
+K 25
+svn:wc:ra_dav:version-url
+V 116
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/MandateContentType.java
+END
+Habilitation.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/Habilitation.java
+END
+IsHCPType.java
+K 25
+svn:wc:ra_dav:version-url
+V 107
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsHCPType.java
+END
+IsAcademicStaffType.java
+K 25
+svn:wc:ra_dav:version-url
+V 117
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsAcademicStaffType.java
+END
+AttributeStatusType.java
+K 25
+svn:wc:ra_dav:version-url
+V 117
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/AttributeStatusType.java
+END
+HabilitationType.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/HabilitationType.java
+END
+IsAdminStaffType.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsAdminStaffType.java
+END
+MandateType.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/MandateType.java
+END
+HasAccountInBankType.java
+K 25
+svn:wc:ra_dav:version-url
+V 118
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/HasAccountInBankType.java
+END
+IsHealthCareProfessionalType.java
+K 25
+svn:wc:ra_dav:version-url
+V 126
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsHealthCareProfessionalType.java
+END
+IsStudentType.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/IsStudentType.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 110
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/package-info.java
+END
+AcTitleType.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/AcTitleType.java
+END
+RequestedAttributeType.java
+K 25
+svn:wc:ra_dav:version-url
+V 120
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/RequestedAttributeType.java
+END
+HasDegreeType.java
+K 25
+svn:wc:ra_dav:version-url
+V 111
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/HasDegreeType.java
+END
+RepresentationPersonType.java
+K 25
+svn:wc:ra_dav:version-url
+V 122
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes/RepresentationPersonType.java
+END
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/entries b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/entries
new file mode 100644
index 000000000..434de60f8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/entries
@@ -0,0 +1,708 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/java/eu/stork/peps/complex/attributes
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+IsHCPType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+c7794f438dce3f5e4e27e605a642a22a
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3801
+
+IsAcademicStaffType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+43d67ea6cedb4601555d0394db95417a
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3818
+
+HabilitationType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+6e9cc940cbe5298156c5e7b524936f11
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2314
+
+AttributeStatusType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+4e30a60177a9ab03aececf580482fad1
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1734
+
+IsAdminStaffType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+5a49a39f1d260a3c306216069751260f
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2341
+
+MandateType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+2fbb38548efd320e4df27959a9842731
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3581
+
+HasAccountInBankType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+f71b4c28dd5c9580fb87c3573435837b
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2339
+
+IsHealthCareProfessionalType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+2a4106ac8c87cc056b853b7f9ffb6fbc
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3834
+
+package-info.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+5a2f7df8040e53c9e0dc7beacc8f3457
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+549
+
+IsStudentType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+a576b2ef395482c49cb968e91e33ec89
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3714
+
+AcTitleType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+df18729d7dbd509aeeac2f17ef036e19
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2388
+
+RequestedAttributeType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+c6ada26a7ff439713e9a4588d1b62b0a
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6089
+
+HasDegreeType.java
+file
+
+
+
+
+2014-03-05T09:36:07.894515Z
+3a54a31f40c97b44d31f1a70e0767daa
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4432
+
+RepresentationPersonType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+84b6c9432085cf590c3ed06e58b4307f
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7205
+
+ObjectFactory.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+bc36df4b11e93ab03119dfb25626bfb1
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+18679
+
+IsTeacherOfType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+1575bd6840471d713bd61c5d337d3900
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3668
+
+CanonicalAddressType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+63bc0e23343775a0c252a03a5a3b09d1
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6847
+
+IsCourseCoordinatorType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+9927ea145575d05bd2984bee0e3550be
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2423
+
+MandateContentType.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+debc98ce374d669b7621dea674120dfc
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6205
+
+Habilitation.java
+file
+
+
+
+
+2014-03-05T09:36:07.898515Z
+248b26e8c89ddc3366c528cf3852d27b
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2298
+
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AcTitleType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AcTitleType.java.svn-base
new file mode 100644
index 000000000..3c214cb7b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AcTitleType.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for acTitleType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="acTitleType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="titleNormalised" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}titleNormalisedType"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "acTitleType", propOrder = {
+ "titleNormalised",
+ "aqaa"
+})
+public class AcTitleType {
+
+ @XmlElement(required = true)
+ protected String titleNormalised;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the titleNormalised property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitleNormalised() {
+ return titleNormalised;
+ }
+
+ /**
+ * Sets the value of the titleNormalised property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitleNormalised(String value) {
+ this.titleNormalised = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AttributeStatusType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AttributeStatusType.java.svn-base
new file mode 100644
index 000000000..1a815e944
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/AttributeStatusType.java.svn-base
@@ -0,0 +1,61 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AttributeStatusType.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="AttributeStatusType">
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * &lt;enumeration value="Available"/>
+ * &lt;enumeration value="NotAvailable"/>
+ * &lt;enumeration value="Withheld"/>
+ * &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ *
+ */
+@XmlType(name = "AttributeStatusType")
+@XmlEnum
+public enum AttributeStatusType {
+
+ @XmlEnumValue("Available")
+ AVAILABLE("Available"),
+ @XmlEnumValue("NotAvailable")
+ NOT_AVAILABLE("NotAvailable"),
+ @XmlEnumValue("Withheld")
+ WITHHELD("Withheld");
+ private final String value;
+
+ AttributeStatusType(String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ public static AttributeStatusType fromValue(String v) {
+ for (AttributeStatusType c: AttributeStatusType.values()) {
+ if (c.value.equals(v)) {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/CanonicalAddressType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/CanonicalAddressType.java.svn-base
new file mode 100644
index 000000000..fa0289cfa
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/CanonicalAddressType.java.svn-base
@@ -0,0 +1,264 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for canonicalAddressType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="canonicalAddressType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="countryCodeAddress" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}CountryCodeType"/>
+ * &lt;element name="state" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="municipalityCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="town" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="postalCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="streetName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="streetNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="apartmentNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "canonicalAddressType", propOrder = {
+ "countryCodeAddress",
+ "state",
+ "municipalityCode",
+ "town",
+ "postalCode",
+ "streetName",
+ "streetNumber",
+ "apartmentNumber"
+})
+public class CanonicalAddressType {
+
+ @XmlElement(required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String countryCodeAddress;
+ protected String state;
+ protected String municipalityCode;
+ @XmlElement(required = true)
+ protected String town;
+ @XmlElement(required = true)
+ protected String postalCode;
+ @XmlElement(required = true)
+ protected String streetName;
+ protected String streetNumber;
+ protected String apartmentNumber;
+
+ /**
+ * Gets the value of the countryCodeAddress property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCountryCodeAddress() {
+ return countryCodeAddress;
+ }
+
+ /**
+ * Sets the value of the countryCodeAddress property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCountryCodeAddress(String value) {
+ this.countryCodeAddress = value;
+ }
+
+ /**
+ * Gets the value of the state property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * Sets the value of the state property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setState(String value) {
+ this.state = value;
+ }
+
+ /**
+ * Gets the value of the municipalityCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMunicipalityCode() {
+ return municipalityCode;
+ }
+
+ /**
+ * Sets the value of the municipalityCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMunicipalityCode(String value) {
+ this.municipalityCode = value;
+ }
+
+ /**
+ * Gets the value of the town property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTown() {
+ return town;
+ }
+
+ /**
+ * Sets the value of the town property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTown(String value) {
+ this.town = value;
+ }
+
+ /**
+ * Gets the value of the postalCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPostalCode() {
+ return postalCode;
+ }
+
+ /**
+ * Sets the value of the postalCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPostalCode(String value) {
+ this.postalCode = value;
+ }
+
+ /**
+ * Gets the value of the streetName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreetName() {
+ return streetName;
+ }
+
+ /**
+ * Sets the value of the streetName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreetName(String value) {
+ this.streetName = value;
+ }
+
+ /**
+ * Gets the value of the streetNumber property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreetNumber() {
+ return streetNumber;
+ }
+
+ /**
+ * Sets the value of the streetNumber property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreetNumber(String value) {
+ this.streetNumber = value;
+ }
+
+ /**
+ * Gets the value of the apartmentNumber property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getApartmentNumber() {
+ return apartmentNumber;
+ }
+
+ /**
+ * Sets the value of the apartmentNumber property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setApartmentNumber(String value) {
+ this.apartmentNumber = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/Habilitation.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/Habilitation.java.svn-base
new file mode 100644
index 000000000..3d99c9600
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/Habilitation.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for habilitation complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="habilitation">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="ability" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "habilitation", propOrder = {
+ "ability",
+ "aqaa"
+})
+public class Habilitation {
+
+ @XmlElement(required = true)
+ protected String ability;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the ability property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAbility() {
+ return ability;
+ }
+
+ /**
+ * Sets the value of the ability property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAbility(String value) {
+ this.ability = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HabilitationType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HabilitationType.java.svn-base
new file mode 100644
index 000000000..6a5cb7b00
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HabilitationType.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for habilitationType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="habilitationType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="ability" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "habilitationType", propOrder = {
+ "ability",
+ "aqaa"
+})
+public class HabilitationType {
+
+ @XmlElement(required = true)
+ protected String ability;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the ability property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAbility() {
+ return ability;
+ }
+
+ /**
+ * Sets the value of the ability property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAbility(String value) {
+ this.ability = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasAccountInBankType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasAccountInBankType.java.svn-base
new file mode 100644
index 000000000..cc09f0486
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasAccountInBankType.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for hasAccountInBankType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="hasAccountInBankType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="bankName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "hasAccountInBankType", propOrder = {
+ "bankName",
+ "aqaa"
+})
+public class HasAccountInBankType {
+
+ @XmlElement(required = true)
+ protected String bankName;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the bankName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getBankName() {
+ return bankName;
+ }
+
+ /**
+ * Sets the value of the bankName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setBankName(String value) {
+ this.bankName = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasDegreeType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasDegreeType.java.svn-base
new file mode 100644
index 000000000..ea466cb18
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/HasDegreeType.java.svn-base
@@ -0,0 +1,174 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for hasDegreeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="hasDegreeType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="study" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}studyType"/>
+ * &lt;element name="level" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}LevelType"/>
+ * &lt;element name="yearObtained" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "hasDegreeType", propOrder = {
+ "study",
+ "level",
+ "yearObtained",
+ "nameOfInstitution",
+ "aqaa"
+})
+public class HasDegreeType {
+
+ @XmlElement(required = true)
+ protected String study;
+ @XmlElement(required = true)
+ protected String level;
+ @XmlElement(required = true)
+ protected BigInteger yearObtained;
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the study property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStudy() {
+ return study;
+ }
+
+ /**
+ * Sets the value of the study property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStudy(String value) {
+ this.study = value;
+ }
+
+ /**
+ * Gets the value of the level property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLevel() {
+ return level;
+ }
+
+ /**
+ * Sets the value of the level property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLevel(String value) {
+ this.level = value;
+ }
+
+ /**
+ * Gets the value of the yearObtained property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getYearObtained() {
+ return yearObtained;
+ }
+
+ /**
+ * Sets the value of the yearObtained property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setYearObtained(BigInteger value) {
+ this.yearObtained = value;
+ }
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAcademicStaffType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAcademicStaffType.java.svn-base
new file mode 100644
index 000000000..02d9286d8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAcademicStaffType.java.svn-base
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isAcademicStaffType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isAcademicStaffType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="occupation" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}occupationType"/>
+ * &lt;element name="knowledgearea" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isAcademicStaffType", propOrder = {
+ "nameOfInstitution",
+ "occupation",
+ "knowledgearea",
+ "aqaa"
+})
+public class IsAcademicStaffType {
+
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected String occupation;
+ @XmlElement(required = true)
+ protected String knowledgearea;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the occupation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getOccupation() {
+ return occupation;
+ }
+
+ /**
+ * Sets the value of the occupation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setOccupation(String value) {
+ this.occupation = value;
+ }
+
+ /**
+ * Gets the value of the knowledgearea property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKnowledgearea() {
+ return knowledgearea;
+ }
+
+ /**
+ * Sets the value of the knowledgearea property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKnowledgearea(String value) {
+ this.knowledgearea = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAdminStaffType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAdminStaffType.java.svn-base
new file mode 100644
index 000000000..0de16ee77
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsAdminStaffType.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isAdminStaffType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isAdminStaffType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="adminStaff" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isAdminStaffType", propOrder = {
+ "adminStaff",
+ "aqaa"
+})
+public class IsAdminStaffType {
+
+ @XmlElement(required = true)
+ protected String adminStaff;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the adminStaff property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAdminStaff() {
+ return adminStaff;
+ }
+
+ /**
+ * Sets the value of the adminStaff property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAdminStaff(String value) {
+ this.adminStaff = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsCourseCoordinatorType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsCourseCoordinatorType.java.svn-base
new file mode 100644
index 000000000..58caa2f22
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsCourseCoordinatorType.java.svn-base
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isCourseCoordinatorType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isCourseCoordinatorType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="courseCoodinator" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isCourseCoordinatorType", propOrder = {
+ "courseCoodinator",
+ "aqaa"
+})
+public class IsCourseCoordinatorType {
+
+ @XmlElement(required = true)
+ protected String courseCoodinator;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the courseCoodinator property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourseCoodinator() {
+ return courseCoodinator;
+ }
+
+ /**
+ * Sets the value of the courseCoodinator property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourseCoodinator(String value) {
+ this.courseCoodinator = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHCPType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHCPType.java.svn-base
new file mode 100644
index 000000000..17e315d2d
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHCPType.java.svn-base
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isHCPType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isHCPType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfOrganisation" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="HCPType" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}HCPType"/>
+ * &lt;element name="specialisation" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}specialisationType"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isHCPType", propOrder = {
+ "nameOfOrganisation",
+ "hcpType",
+ "specialisation",
+ "aqaa"
+})
+public class IsHCPType {
+
+ @XmlElement(required = true)
+ protected String nameOfOrganisation;
+ @XmlElement(name = "HCPType", required = true)
+ protected String hcpType;
+ @XmlElement(required = true)
+ protected String specialisation;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfOrganisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfOrganisation() {
+ return nameOfOrganisation;
+ }
+
+ /**
+ * Sets the value of the nameOfOrganisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfOrganisation(String value) {
+ this.nameOfOrganisation = value;
+ }
+
+ /**
+ * Gets the value of the hcpType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHCPType() {
+ return hcpType;
+ }
+
+ /**
+ * Sets the value of the hcpType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHCPType(String value) {
+ this.hcpType = value;
+ }
+
+ /**
+ * Gets the value of the specialisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSpecialisation() {
+ return specialisation;
+ }
+
+ /**
+ * Sets the value of the specialisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSpecialisation(String value) {
+ this.specialisation = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHealthCareProfessionalType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHealthCareProfessionalType.java.svn-base
new file mode 100644
index 000000000..de2003a3f
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsHealthCareProfessionalType.java.svn-base
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isHealthCareProfessionalType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isHealthCareProfessionalType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfOrganisation" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}HCPType"/>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}specialisation"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isHealthCareProfessionalType", propOrder = {
+ "nameOfOrganisation",
+ "hcpType",
+ "specialisation",
+ "aqaa"
+})
+public class IsHealthCareProfessionalType {
+
+ @XmlElement(required = true)
+ protected String nameOfOrganisation;
+ @XmlElement(name = "HCPType", required = true)
+ protected String hcpType;
+ @XmlElement(required = true)
+ protected String specialisation;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfOrganisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfOrganisation() {
+ return nameOfOrganisation;
+ }
+
+ /**
+ * Sets the value of the nameOfOrganisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfOrganisation(String value) {
+ this.nameOfOrganisation = value;
+ }
+
+ /**
+ * Gets the value of the hcpType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHCPType() {
+ return hcpType;
+ }
+
+ /**
+ * Sets the value of the hcpType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHCPType(String value) {
+ this.hcpType = value;
+ }
+
+ /**
+ * Gets the value of the specialisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSpecialisation() {
+ return specialisation;
+ }
+
+ /**
+ * Sets the value of the specialisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSpecialisation(String value) {
+ this.specialisation = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsStudentType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsStudentType.java.svn-base
new file mode 100644
index 000000000..6a7dc838a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsStudentType.java.svn-base
@@ -0,0 +1,146 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isStudentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isStudentType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}study"/>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="course" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isStudentType", propOrder = {
+ "study",
+ "nameOfInstitution",
+ "course",
+ "aqaa"
+})
+public class IsStudentType {
+
+ @XmlElement(required = true)
+ protected String study;
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected BigInteger course;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the study property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStudy() {
+ return study;
+ }
+
+ /**
+ * Sets the value of the study property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStudy(String value) {
+ this.study = value;
+ }
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the course property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getCourse() {
+ return course;
+ }
+
+ /**
+ * Sets the value of the course property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setCourse(BigInteger value) {
+ this.course = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsTeacherOfType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsTeacherOfType.java.svn-base
new file mode 100644
index 000000000..810f652c1
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/IsTeacherOfType.java.svn-base
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isTeacherOfType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isTeacherOfType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="course" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="role" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isTeacherOfType", propOrder = {
+ "nameOfInstitution",
+ "course",
+ "role",
+ "aqaa"
+})
+public class IsTeacherOfType {
+
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected String course;
+ @XmlElement(required = true)
+ protected String role;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the course property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourse() {
+ return course;
+ }
+
+ /**
+ * Sets the value of the course property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourse(String value) {
+ this.course = value;
+ }
+
+ /**
+ * Gets the value of the role property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRole() {
+ return role;
+ }
+
+ /**
+ * Sets the value of the role property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRole(String value) {
+ this.role = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateContentType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateContentType.java.svn-base
new file mode 100644
index 000000000..84ce2727b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateContentType.java.svn-base
@@ -0,0 +1,233 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for mandateContentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="mandateContentType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="validFrom" type="{http://www.w3.org/2001/XMLSchema}date"/>
+ * &lt;element name="validTo" type="{http://www.w3.org/2001/XMLSchema}date"/>
+ * &lt;element name="transactionLimit" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="transactionLimitCurrency" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}currencyType"/>
+ * &lt;element name="isJoint" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="ischained" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * &lt;element name="typePower" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "mandateContentType", propOrder = {
+ "validFrom",
+ "validTo",
+ "transactionLimit",
+ "transactionLimitCurrency",
+ "isJoint",
+ "ischained",
+ "typePower"
+})
+public class MandateContentType {
+
+ @XmlElement(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar validFrom;
+ @XmlElement(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar validTo;
+ @XmlElement(required = true)
+ protected BigInteger transactionLimit;
+ @XmlElement(required = true)
+ protected String transactionLimitCurrency;
+ @XmlElement(required = true)
+ protected String isJoint;
+ protected boolean ischained;
+ @XmlElement(required = true)
+ protected String typePower;
+
+ /**
+ * Gets the value of the validFrom property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getValidFrom() {
+ return validFrom;
+ }
+
+ /**
+ * Sets the value of the validFrom property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setValidFrom(XMLGregorianCalendar value) {
+ this.validFrom = value;
+ }
+
+ /**
+ * Gets the value of the validTo property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getValidTo() {
+ return validTo;
+ }
+
+ /**
+ * Sets the value of the validTo property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setValidTo(XMLGregorianCalendar value) {
+ this.validTo = value;
+ }
+
+ /**
+ * Gets the value of the transactionLimit property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getTransactionLimit() {
+ return transactionLimit;
+ }
+
+ /**
+ * Sets the value of the transactionLimit property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setTransactionLimit(BigInteger value) {
+ this.transactionLimit = value;
+ }
+
+ /**
+ * Gets the value of the transactionLimitCurrency property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTransactionLimitCurrency() {
+ return transactionLimitCurrency;
+ }
+
+ /**
+ * Sets the value of the transactionLimitCurrency property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTransactionLimitCurrency(String value) {
+ this.transactionLimitCurrency = value;
+ }
+
+ /**
+ * Gets the value of the isJoint property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIsJoint() {
+ return isJoint;
+ }
+
+ /**
+ * Sets the value of the isJoint property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIsJoint(String value) {
+ this.isJoint = value;
+ }
+
+ /**
+ * Gets the value of the ischained property.
+ *
+ */
+ public boolean isIschained() {
+ return ischained;
+ }
+
+ /**
+ * Sets the value of the ischained property.
+ *
+ */
+ public void setIschained(boolean value) {
+ this.ischained = value;
+ }
+
+ /**
+ * Gets the value of the typePower property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTypePower() {
+ return typePower;
+ }
+
+ /**
+ * Sets the value of the typePower property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTypePower(String value) {
+ this.typePower = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateType.java.svn-base
new file mode 100644
index 000000000..26597dc6b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/MandateType.java.svn-base
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for mandateType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="mandateType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="represented" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}representationPersonType"/>
+ * &lt;element name="representing" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}representationPersonType"/>
+ * &lt;element name="mandateContent" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}mandateContentType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "mandateType", propOrder = {
+ "represented",
+ "representing",
+ "mandateContent"
+})
+public class MandateType {
+
+ @XmlElement(required = true)
+ protected RepresentationPersonType represented;
+ @XmlElement(required = true)
+ protected RepresentationPersonType representing;
+ @XmlElement(required = true)
+ protected MandateContentType mandateContent;
+
+ /**
+ * Gets the value of the represented property.
+ *
+ * @return
+ * possible object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType getRepresented() {
+ return represented;
+ }
+
+ /**
+ * Sets the value of the represented property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public void setRepresented(RepresentationPersonType value) {
+ this.represented = value;
+ }
+
+ /**
+ * Gets the value of the representing property.
+ *
+ * @return
+ * possible object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType getRepresenting() {
+ return representing;
+ }
+
+ /**
+ * Sets the value of the representing property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public void setRepresenting(RepresentationPersonType value) {
+ this.representing = value;
+ }
+
+ /**
+ * Gets the value of the mandateContent property.
+ *
+ * @return
+ * possible object is
+ * {@link MandateContentType }
+ *
+ */
+ public MandateContentType getMandateContent() {
+ return mandateContent;
+ }
+
+ /**
+ * Sets the value of the mandateContent property.
+ *
+ * @param value
+ * allowed object is
+ * {@link MandateContentType }
+ *
+ */
+ public void setMandateContent(MandateContentType value) {
+ this.mandateContent = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/ObjectFactory.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/ObjectFactory.java.svn-base
new file mode 100644
index 000000000..eca4ca3de
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/ObjectFactory.java.svn-base
@@ -0,0 +1,433 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the eu.stork.peps.complex.attributes package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Habilitation_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "habilitation");
+ private final static QName _HasDegree_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "hasDegree");
+ private final static QName _SpApplication_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spApplication");
+ private final static QName _Specialisation_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "specialisation");
+ private final static QName _IsStudent_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isStudent");
+ private final static QName _AQAA_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "AQAA");
+ private final static QName _HCPType_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "HCPType");
+ private final static QName _CanonicalResidenceAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "canonicalResidenceAddress");
+ private final static QName _AcTitle_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "acTitle");
+ private final static QName _QualityAuthenticationAssuranceLevel_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "QualityAuthenticationAssuranceLevel");
+ private final static QName _IsAcademicStaff_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isAcademicStaff");
+ private final static QName _IsTeacherOf_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isTeacherOf");
+ private final static QName _IsCourseCoordinator_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isCourseCoordinator");
+ private final static QName _CanonicalRegisteredAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "canonicalRegisteredAddress");
+ private final static QName _SpCountry_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spCountry");
+ private final static QName _IsAdminStaff_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isAdminStaff");
+ private final static QName _CitizenCountryCode_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "CitizenCountryCode");
+ private final static QName _AttributeValue_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "AttributeValue");
+ private final static QName _HasAccountInBank_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "hasAccountInBank");
+ private final static QName _CountryCodeAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "countryCodeAddress");
+ private final static QName _Study_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "study");
+ private final static QName _IsHealthCareProfessional_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isHealthCareProfessional");
+ private final static QName _Mandate_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "mandate");
+ private final static QName _RequestedAttribute_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "RequestedAttribute");
+ private final static QName _SpSector_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spSector");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: eu.stork.peps.complex.attributes
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link RequestedAttributeType }
+ *
+ */
+ public RequestedAttributeType createRequestedAttributeType() {
+ return new RequestedAttributeType();
+ }
+
+ /**
+ * Create an instance of {@link MandateType }
+ *
+ */
+ public MandateType createMandateType() {
+ return new MandateType();
+ }
+
+ /**
+ * Create an instance of {@link HasAccountInBankType }
+ *
+ */
+ public HasAccountInBankType createHasAccountInBankType() {
+ return new HasAccountInBankType();
+ }
+
+ /**
+ * Create an instance of {@link IsHealthCareProfessionalType }
+ *
+ */
+ public IsHealthCareProfessionalType createIsHealthCareProfessionalType() {
+ return new IsHealthCareProfessionalType();
+ }
+
+ /**
+ * Create an instance of {@link IsAdminStaffType }
+ *
+ */
+ public IsAdminStaffType createIsAdminStaffType() {
+ return new IsAdminStaffType();
+ }
+
+ /**
+ * Create an instance of {@link CanonicalAddressType }
+ *
+ */
+ public CanonicalAddressType createCanonicalAddressType() {
+ return new CanonicalAddressType();
+ }
+
+ /**
+ * Create an instance of {@link IsCourseCoordinatorType }
+ *
+ */
+ public IsCourseCoordinatorType createIsCourseCoordinatorType() {
+ return new IsCourseCoordinatorType();
+ }
+
+ /**
+ * Create an instance of {@link IsAcademicStaffType }
+ *
+ */
+ public IsAcademicStaffType createIsAcademicStaffType() {
+ return new IsAcademicStaffType();
+ }
+
+ /**
+ * Create an instance of {@link IsTeacherOfType }
+ *
+ */
+ public IsTeacherOfType createIsTeacherOfType() {
+ return new IsTeacherOfType();
+ }
+
+ /**
+ * Create an instance of {@link AcTitleType }
+ *
+ */
+ public AcTitleType createAcTitleType() {
+ return new AcTitleType();
+ }
+
+ /**
+ * Create an instance of {@link IsStudentType }
+ *
+ */
+ public IsStudentType createIsStudentType() {
+ return new IsStudentType();
+ }
+
+ /**
+ * Create an instance of {@link HasDegreeType }
+ *
+ */
+ public HasDegreeType createHasDegreeType() {
+ return new HasDegreeType();
+ }
+
+ /**
+ * Create an instance of {@link HabilitationType }
+ *
+ */
+ public HabilitationType createHabilitationType() {
+ return new HabilitationType();
+ }
+
+ /**
+ * Create an instance of {@link MandateContentType }
+ *
+ */
+ public MandateContentType createMandateContentType() {
+ return new MandateContentType();
+ }
+
+ /**
+ * Create an instance of {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType createRepresentationPersonType() {
+ return new RepresentationPersonType();
+ }
+
+ /**
+ * Create an instance of {@link Habilitation }
+ *
+ */
+ public Habilitation createHabilitation() {
+ return new Habilitation();
+ }
+
+ /**
+ * Create an instance of {@link IsHCPType }
+ *
+ */
+ public IsHCPType createIsHCPType() {
+ return new IsHCPType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HabilitationType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "habilitation")
+ public JAXBElement<HabilitationType> createHabilitation(HabilitationType value) {
+ return new JAXBElement<HabilitationType>(_Habilitation_QNAME, HabilitationType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HasDegreeType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "hasDegree")
+ public JAXBElement<HasDegreeType> createHasDegree(HasDegreeType value) {
+ return new JAXBElement<HasDegreeType>(_HasDegree_QNAME, HasDegreeType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spApplication")
+ public JAXBElement<String> createSpApplication(String value) {
+ return new JAXBElement<String>(_SpApplication_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "specialisation")
+ public JAXBElement<String> createSpecialisation(String value) {
+ return new JAXBElement<String>(_Specialisation_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsStudentType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isStudent")
+ public JAXBElement<IsStudentType> createIsStudent(IsStudentType value) {
+ return new JAXBElement<IsStudentType>(_IsStudent_QNAME, IsStudentType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "AQAA")
+ public JAXBElement<Integer> createAQAA(Integer value) {
+ return new JAXBElement<Integer>(_AQAA_QNAME, Integer.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "HCPType")
+ public JAXBElement<String> createHCPType(String value) {
+ return new JAXBElement<String>(_HCPType_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CanonicalAddressType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "canonicalResidenceAddress")
+ public JAXBElement<CanonicalAddressType> createCanonicalResidenceAddress(CanonicalAddressType value) {
+ return new JAXBElement<CanonicalAddressType>(_CanonicalResidenceAddress_QNAME, CanonicalAddressType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AcTitleType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "acTitle")
+ public JAXBElement<AcTitleType> createAcTitle(AcTitleType value) {
+ return new JAXBElement<AcTitleType>(_AcTitle_QNAME, AcTitleType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "QualityAuthenticationAssuranceLevel")
+ public JAXBElement<Integer> createQualityAuthenticationAssuranceLevel(Integer value) {
+ return new JAXBElement<Integer>(_QualityAuthenticationAssuranceLevel_QNAME, Integer.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsAcademicStaffType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isAcademicStaff")
+ public JAXBElement<IsAcademicStaffType> createIsAcademicStaff(IsAcademicStaffType value) {
+ return new JAXBElement<IsAcademicStaffType>(_IsAcademicStaff_QNAME, IsAcademicStaffType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsTeacherOfType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isTeacherOf")
+ public JAXBElement<IsTeacherOfType> createIsTeacherOf(IsTeacherOfType value) {
+ return new JAXBElement<IsTeacherOfType>(_IsTeacherOf_QNAME, IsTeacherOfType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsCourseCoordinatorType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isCourseCoordinator")
+ public JAXBElement<IsCourseCoordinatorType> createIsCourseCoordinator(IsCourseCoordinatorType value) {
+ return new JAXBElement<IsCourseCoordinatorType>(_IsCourseCoordinator_QNAME, IsCourseCoordinatorType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CanonicalAddressType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "canonicalRegisteredAddress")
+ public JAXBElement<CanonicalAddressType> createCanonicalRegisteredAddress(CanonicalAddressType value) {
+ return new JAXBElement<CanonicalAddressType>(_CanonicalRegisteredAddress_QNAME, CanonicalAddressType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spCountry")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createSpCountry(String value) {
+ return new JAXBElement<String>(_SpCountry_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsAdminStaffType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isAdminStaff")
+ public JAXBElement<IsAdminStaffType> createIsAdminStaff(IsAdminStaffType value) {
+ return new JAXBElement<IsAdminStaffType>(_IsAdminStaff_QNAME, IsAdminStaffType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "CitizenCountryCode")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createCitizenCountryCode(String value) {
+ return new JAXBElement<String>(_CitizenCountryCode_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "AttributeValue")
+ public JAXBElement<Object> createAttributeValue(Object value) {
+ return new JAXBElement<Object>(_AttributeValue_QNAME, Object.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HasAccountInBankType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "hasAccountInBank")
+ public JAXBElement<HasAccountInBankType> createHasAccountInBank(HasAccountInBankType value) {
+ return new JAXBElement<HasAccountInBankType>(_HasAccountInBank_QNAME, HasAccountInBankType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "countryCodeAddress")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createCountryCodeAddress(String value) {
+ return new JAXBElement<String>(_CountryCodeAddress_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "study")
+ public JAXBElement<String> createStudy(String value) {
+ return new JAXBElement<String>(_Study_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsHealthCareProfessionalType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isHealthCareProfessional")
+ public JAXBElement<IsHealthCareProfessionalType> createIsHealthCareProfessional(IsHealthCareProfessionalType value) {
+ return new JAXBElement<IsHealthCareProfessionalType>(_IsHealthCareProfessional_QNAME, IsHealthCareProfessionalType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link MandateType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "mandate")
+ public JAXBElement<MandateType> createMandate(MandateType value) {
+ return new JAXBElement<MandateType>(_Mandate_QNAME, MandateType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link RequestedAttributeType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "RequestedAttribute")
+ public JAXBElement<RequestedAttributeType> createRequestedAttribute(RequestedAttributeType value) {
+ return new JAXBElement<RequestedAttributeType>(_RequestedAttribute_QNAME, RequestedAttributeType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spSector")
+ public JAXBElement<String> createSpSector(String value) {
+ return new JAXBElement<String>(_SpSector_QNAME, String.class, null, value);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RepresentationPersonType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RepresentationPersonType.java.svn-base
new file mode 100644
index 000000000..b1d993f89
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RepresentationPersonType.java.svn-base
@@ -0,0 +1,289 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for representationPersonType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="representationPersonType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;choice>
+ * &lt;sequence>
+ * &lt;element name="eIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="givenName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="surname" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="dateOfBirth" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;sequence>
+ * &lt;element name="eLPIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="address" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="canonicalAddress" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}canonicalAddressType"/>
+ * &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/choice>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "representationPersonType", propOrder = {
+ "eIdentifier",
+ "givenName",
+ "surname",
+ "dateOfBirth",
+ "elpIdentifier",
+ "name",
+ "address",
+ "canonicalAddress",
+ "type"
+})
+public class RepresentationPersonType {
+
+ protected String eIdentifier;
+ protected String givenName;
+ protected String surname;
+ protected String dateOfBirth;
+ @XmlElement(name = "eLPIdentifier")
+ protected String elpIdentifier;
+ protected String name;
+ protected String address;
+ protected CanonicalAddressType canonicalAddress;
+ protected String type;
+
+ /**
+ * Gets the value of the eIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getEIdentifier() {
+ return eIdentifier;
+ }
+
+ /**
+ * Sets the value of the eIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setEIdentifier(String value) {
+ this.eIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the givenName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getGivenName() {
+ return givenName;
+ }
+
+ /**
+ * Sets the value of the givenName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setGivenName(String value) {
+ this.givenName = value;
+ }
+
+ /**
+ * Gets the value of the surname property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSurname() {
+ return surname;
+ }
+
+ /**
+ * Sets the value of the surname property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSurname(String value) {
+ this.surname = value;
+ }
+
+ /**
+ * Gets the value of the dateOfBirth property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDateOfBirth() {
+ return dateOfBirth;
+ }
+
+ /**
+ * Sets the value of the dateOfBirth property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDateOfBirth(String value) {
+ this.dateOfBirth = value;
+ }
+
+ /**
+ * Gets the value of the elpIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getELPIdentifier() {
+ return elpIdentifier;
+ }
+
+ /**
+ * Sets the value of the elpIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setELPIdentifier(String value) {
+ this.elpIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAddress(String value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the canonicalAddress property.
+ *
+ * @return
+ * possible object is
+ * {@link CanonicalAddressType }
+ *
+ */
+ public CanonicalAddressType getCanonicalAddress() {
+ return canonicalAddress;
+ }
+
+ /**
+ * Sets the value of the canonicalAddress property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CanonicalAddressType }
+ *
+ */
+ public void setCanonicalAddress(CanonicalAddressType value) {
+ this.canonicalAddress = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RequestedAttributeType.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RequestedAttributeType.java.svn-base
new file mode 100644
index 000000000..6a7c0b443
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/RequestedAttributeType.java.svn-base
@@ -0,0 +1,212 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+
+/**
+ * <p>Java class for RequestedAttributeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="RequestedAttributeType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}AttributeValue" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="NameFormat" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ * &lt;attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="isRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ * &lt;anyAttribute processContents='lax' namespace='##other'/>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RequestedAttributeType", propOrder = {
+ "attributeValue"
+})
+public class RequestedAttributeType {
+
+ @XmlElement(name = "AttributeValue")
+ protected List<Object> attributeValue;
+ @XmlAttribute(name = "Name", required = true)
+ protected String name;
+ @XmlAttribute(name = "NameFormat", required = true)
+ @XmlSchemaType(name = "anyURI")
+ protected String nameFormat;
+ @XmlAttribute(name = "FriendlyName")
+ protected String friendlyName;
+ @XmlAttribute(name = "isRequired")
+ protected Boolean isRequired;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the attributeValue property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the attributeValue property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAttributeValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Object }
+ *
+ *
+ */
+ public List<Object> getAttributeValue() {
+ if (attributeValue == null) {
+ attributeValue = new ArrayList<Object>();
+ }
+ return this.attributeValue;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the nameFormat property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameFormat() {
+ return nameFormat;
+ }
+
+ /**
+ * Sets the value of the nameFormat property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameFormat(String value) {
+ this.nameFormat = value;
+ }
+
+ /**
+ * Gets the value of the friendlyName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Sets the value of the friendlyName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFriendlyName(String value) {
+ this.friendlyName = value;
+ }
+
+ /**
+ * Gets the value of the isRequired property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isIsRequired() {
+ return isRequired;
+ }
+
+ /**
+ * Sets the value of the isRequired property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setIsRequired(Boolean value) {
+ this.isRequired = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/package-info.java.svn-base b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..47e225d22
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package eu.stork.peps.complex.attributes;
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AcTitleType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AcTitleType.java
new file mode 100644
index 000000000..3c214cb7b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AcTitleType.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for acTitleType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="acTitleType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="titleNormalised" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}titleNormalisedType"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "acTitleType", propOrder = {
+ "titleNormalised",
+ "aqaa"
+})
+public class AcTitleType {
+
+ @XmlElement(required = true)
+ protected String titleNormalised;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the titleNormalised property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitleNormalised() {
+ return titleNormalised;
+ }
+
+ /**
+ * Sets the value of the titleNormalised property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitleNormalised(String value) {
+ this.titleNormalised = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AttributeStatusType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AttributeStatusType.java
new file mode 100644
index 000000000..1a815e944
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/AttributeStatusType.java
@@ -0,0 +1,61 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AttributeStatusType.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="AttributeStatusType">
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * &lt;enumeration value="Available"/>
+ * &lt;enumeration value="NotAvailable"/>
+ * &lt;enumeration value="Withheld"/>
+ * &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ *
+ */
+@XmlType(name = "AttributeStatusType")
+@XmlEnum
+public enum AttributeStatusType {
+
+ @XmlEnumValue("Available")
+ AVAILABLE("Available"),
+ @XmlEnumValue("NotAvailable")
+ NOT_AVAILABLE("NotAvailable"),
+ @XmlEnumValue("Withheld")
+ WITHHELD("Withheld");
+ private final String value;
+
+ AttributeStatusType(String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ public static AttributeStatusType fromValue(String v) {
+ for (AttributeStatusType c: AttributeStatusType.values()) {
+ if (c.value.equals(v)) {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/CanonicalAddressType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/CanonicalAddressType.java
new file mode 100644
index 000000000..fa0289cfa
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/CanonicalAddressType.java
@@ -0,0 +1,264 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for canonicalAddressType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="canonicalAddressType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="countryCodeAddress" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}CountryCodeType"/>
+ * &lt;element name="state" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="municipalityCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="town" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="postalCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="streetName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="streetNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;element name="apartmentNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "canonicalAddressType", propOrder = {
+ "countryCodeAddress",
+ "state",
+ "municipalityCode",
+ "town",
+ "postalCode",
+ "streetName",
+ "streetNumber",
+ "apartmentNumber"
+})
+public class CanonicalAddressType {
+
+ @XmlElement(required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String countryCodeAddress;
+ protected String state;
+ protected String municipalityCode;
+ @XmlElement(required = true)
+ protected String town;
+ @XmlElement(required = true)
+ protected String postalCode;
+ @XmlElement(required = true)
+ protected String streetName;
+ protected String streetNumber;
+ protected String apartmentNumber;
+
+ /**
+ * Gets the value of the countryCodeAddress property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCountryCodeAddress() {
+ return countryCodeAddress;
+ }
+
+ /**
+ * Sets the value of the countryCodeAddress property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCountryCodeAddress(String value) {
+ this.countryCodeAddress = value;
+ }
+
+ /**
+ * Gets the value of the state property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * Sets the value of the state property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setState(String value) {
+ this.state = value;
+ }
+
+ /**
+ * Gets the value of the municipalityCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMunicipalityCode() {
+ return municipalityCode;
+ }
+
+ /**
+ * Sets the value of the municipalityCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMunicipalityCode(String value) {
+ this.municipalityCode = value;
+ }
+
+ /**
+ * Gets the value of the town property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTown() {
+ return town;
+ }
+
+ /**
+ * Sets the value of the town property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTown(String value) {
+ this.town = value;
+ }
+
+ /**
+ * Gets the value of the postalCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPostalCode() {
+ return postalCode;
+ }
+
+ /**
+ * Sets the value of the postalCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPostalCode(String value) {
+ this.postalCode = value;
+ }
+
+ /**
+ * Gets the value of the streetName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreetName() {
+ return streetName;
+ }
+
+ /**
+ * Sets the value of the streetName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreetName(String value) {
+ this.streetName = value;
+ }
+
+ /**
+ * Gets the value of the streetNumber property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreetNumber() {
+ return streetNumber;
+ }
+
+ /**
+ * Sets the value of the streetNumber property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreetNumber(String value) {
+ this.streetNumber = value;
+ }
+
+ /**
+ * Gets the value of the apartmentNumber property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getApartmentNumber() {
+ return apartmentNumber;
+ }
+
+ /**
+ * Sets the value of the apartmentNumber property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setApartmentNumber(String value) {
+ this.apartmentNumber = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/Habilitation.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/Habilitation.java
new file mode 100644
index 000000000..3d99c9600
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/Habilitation.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for habilitation complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="habilitation">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="ability" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "habilitation", propOrder = {
+ "ability",
+ "aqaa"
+})
+public class Habilitation {
+
+ @XmlElement(required = true)
+ protected String ability;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the ability property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAbility() {
+ return ability;
+ }
+
+ /**
+ * Sets the value of the ability property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAbility(String value) {
+ this.ability = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HabilitationType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HabilitationType.java
new file mode 100644
index 000000000..6a5cb7b00
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HabilitationType.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for habilitationType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="habilitationType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="ability" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "habilitationType", propOrder = {
+ "ability",
+ "aqaa"
+})
+public class HabilitationType {
+
+ @XmlElement(required = true)
+ protected String ability;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the ability property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAbility() {
+ return ability;
+ }
+
+ /**
+ * Sets the value of the ability property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAbility(String value) {
+ this.ability = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasAccountInBankType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasAccountInBankType.java
new file mode 100644
index 000000000..cc09f0486
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasAccountInBankType.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for hasAccountInBankType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="hasAccountInBankType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="bankName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "hasAccountInBankType", propOrder = {
+ "bankName",
+ "aqaa"
+})
+public class HasAccountInBankType {
+
+ @XmlElement(required = true)
+ protected String bankName;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the bankName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getBankName() {
+ return bankName;
+ }
+
+ /**
+ * Sets the value of the bankName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setBankName(String value) {
+ this.bankName = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasDegreeType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasDegreeType.java
new file mode 100644
index 000000000..ea466cb18
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/HasDegreeType.java
@@ -0,0 +1,174 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for hasDegreeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="hasDegreeType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="study" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}studyType"/>
+ * &lt;element name="level" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}LevelType"/>
+ * &lt;element name="yearObtained" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "hasDegreeType", propOrder = {
+ "study",
+ "level",
+ "yearObtained",
+ "nameOfInstitution",
+ "aqaa"
+})
+public class HasDegreeType {
+
+ @XmlElement(required = true)
+ protected String study;
+ @XmlElement(required = true)
+ protected String level;
+ @XmlElement(required = true)
+ protected BigInteger yearObtained;
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the study property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStudy() {
+ return study;
+ }
+
+ /**
+ * Sets the value of the study property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStudy(String value) {
+ this.study = value;
+ }
+
+ /**
+ * Gets the value of the level property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLevel() {
+ return level;
+ }
+
+ /**
+ * Sets the value of the level property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLevel(String value) {
+ this.level = value;
+ }
+
+ /**
+ * Gets the value of the yearObtained property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getYearObtained() {
+ return yearObtained;
+ }
+
+ /**
+ * Sets the value of the yearObtained property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setYearObtained(BigInteger value) {
+ this.yearObtained = value;
+ }
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAcademicStaffType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAcademicStaffType.java
new file mode 100644
index 000000000..02d9286d8
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAcademicStaffType.java
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isAcademicStaffType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isAcademicStaffType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="occupation" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}occupationType"/>
+ * &lt;element name="knowledgearea" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isAcademicStaffType", propOrder = {
+ "nameOfInstitution",
+ "occupation",
+ "knowledgearea",
+ "aqaa"
+})
+public class IsAcademicStaffType {
+
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected String occupation;
+ @XmlElement(required = true)
+ protected String knowledgearea;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the occupation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getOccupation() {
+ return occupation;
+ }
+
+ /**
+ * Sets the value of the occupation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setOccupation(String value) {
+ this.occupation = value;
+ }
+
+ /**
+ * Gets the value of the knowledgearea property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKnowledgearea() {
+ return knowledgearea;
+ }
+
+ /**
+ * Sets the value of the knowledgearea property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKnowledgearea(String value) {
+ this.knowledgearea = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAdminStaffType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAdminStaffType.java
new file mode 100644
index 000000000..0de16ee77
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsAdminStaffType.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isAdminStaffType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isAdminStaffType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="adminStaff" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isAdminStaffType", propOrder = {
+ "adminStaff",
+ "aqaa"
+})
+public class IsAdminStaffType {
+
+ @XmlElement(required = true)
+ protected String adminStaff;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the adminStaff property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAdminStaff() {
+ return adminStaff;
+ }
+
+ /**
+ * Sets the value of the adminStaff property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAdminStaff(String value) {
+ this.adminStaff = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsCourseCoordinatorType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsCourseCoordinatorType.java
new file mode 100644
index 000000000..58caa2f22
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsCourseCoordinatorType.java
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isCourseCoordinatorType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isCourseCoordinatorType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="courseCoodinator" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isCourseCoordinatorType", propOrder = {
+ "courseCoodinator",
+ "aqaa"
+})
+public class IsCourseCoordinatorType {
+
+ @XmlElement(required = true)
+ protected String courseCoodinator;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the courseCoodinator property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourseCoodinator() {
+ return courseCoodinator;
+ }
+
+ /**
+ * Sets the value of the courseCoodinator property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourseCoodinator(String value) {
+ this.courseCoodinator = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHCPType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHCPType.java
new file mode 100644
index 000000000..17e315d2d
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHCPType.java
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isHCPType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isHCPType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfOrganisation" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="HCPType" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}HCPType"/>
+ * &lt;element name="specialisation" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}specialisationType"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isHCPType", propOrder = {
+ "nameOfOrganisation",
+ "hcpType",
+ "specialisation",
+ "aqaa"
+})
+public class IsHCPType {
+
+ @XmlElement(required = true)
+ protected String nameOfOrganisation;
+ @XmlElement(name = "HCPType", required = true)
+ protected String hcpType;
+ @XmlElement(required = true)
+ protected String specialisation;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfOrganisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfOrganisation() {
+ return nameOfOrganisation;
+ }
+
+ /**
+ * Sets the value of the nameOfOrganisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfOrganisation(String value) {
+ this.nameOfOrganisation = value;
+ }
+
+ /**
+ * Gets the value of the hcpType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHCPType() {
+ return hcpType;
+ }
+
+ /**
+ * Sets the value of the hcpType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHCPType(String value) {
+ this.hcpType = value;
+ }
+
+ /**
+ * Gets the value of the specialisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSpecialisation() {
+ return specialisation;
+ }
+
+ /**
+ * Sets the value of the specialisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSpecialisation(String value) {
+ this.specialisation = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHealthCareProfessionalType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHealthCareProfessionalType.java
new file mode 100644
index 000000000..de2003a3f
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsHealthCareProfessionalType.java
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isHealthCareProfessionalType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isHealthCareProfessionalType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfOrganisation" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}HCPType"/>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}specialisation"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isHealthCareProfessionalType", propOrder = {
+ "nameOfOrganisation",
+ "hcpType",
+ "specialisation",
+ "aqaa"
+})
+public class IsHealthCareProfessionalType {
+
+ @XmlElement(required = true)
+ protected String nameOfOrganisation;
+ @XmlElement(name = "HCPType", required = true)
+ protected String hcpType;
+ @XmlElement(required = true)
+ protected String specialisation;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfOrganisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfOrganisation() {
+ return nameOfOrganisation;
+ }
+
+ /**
+ * Sets the value of the nameOfOrganisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfOrganisation(String value) {
+ this.nameOfOrganisation = value;
+ }
+
+ /**
+ * Gets the value of the hcpType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHCPType() {
+ return hcpType;
+ }
+
+ /**
+ * Sets the value of the hcpType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHCPType(String value) {
+ this.hcpType = value;
+ }
+
+ /**
+ * Gets the value of the specialisation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSpecialisation() {
+ return specialisation;
+ }
+
+ /**
+ * Sets the value of the specialisation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSpecialisation(String value) {
+ this.specialisation = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsStudentType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsStudentType.java
new file mode 100644
index 000000000..6a7dc838a
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsStudentType.java
@@ -0,0 +1,146 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isStudentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isStudentType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}study"/>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="course" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isStudentType", propOrder = {
+ "study",
+ "nameOfInstitution",
+ "course",
+ "aqaa"
+})
+public class IsStudentType {
+
+ @XmlElement(required = true)
+ protected String study;
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected BigInteger course;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the study property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStudy() {
+ return study;
+ }
+
+ /**
+ * Sets the value of the study property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStudy(String value) {
+ this.study = value;
+ }
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the course property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getCourse() {
+ return course;
+ }
+
+ /**
+ * Sets the value of the course property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setCourse(BigInteger value) {
+ this.course = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsTeacherOfType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsTeacherOfType.java
new file mode 100644
index 000000000..810f652c1
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/IsTeacherOfType.java
@@ -0,0 +1,145 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for isTeacherOfType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="isTeacherOfType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="nameOfInstitution" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="course" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="role" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="AQAA" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}QualityAuthenticationAssuranceLevelType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "isTeacherOfType", propOrder = {
+ "nameOfInstitution",
+ "course",
+ "role",
+ "aqaa"
+})
+public class IsTeacherOfType {
+
+ @XmlElement(required = true)
+ protected String nameOfInstitution;
+ @XmlElement(required = true)
+ protected String course;
+ @XmlElement(required = true)
+ protected String role;
+ @XmlElement(name = "AQAA")
+ protected int aqaa;
+
+ /**
+ * Gets the value of the nameOfInstitution property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameOfInstitution() {
+ return nameOfInstitution;
+ }
+
+ /**
+ * Sets the value of the nameOfInstitution property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameOfInstitution(String value) {
+ this.nameOfInstitution = value;
+ }
+
+ /**
+ * Gets the value of the course property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourse() {
+ return course;
+ }
+
+ /**
+ * Sets the value of the course property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourse(String value) {
+ this.course = value;
+ }
+
+ /**
+ * Gets the value of the role property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRole() {
+ return role;
+ }
+
+ /**
+ * Sets the value of the role property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRole(String value) {
+ this.role = value;
+ }
+
+ /**
+ * Gets the value of the aqaa property.
+ *
+ */
+ public int getAQAA() {
+ return aqaa;
+ }
+
+ /**
+ * Sets the value of the aqaa property.
+ *
+ */
+ public void setAQAA(int value) {
+ this.aqaa = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateContentType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateContentType.java
new file mode 100644
index 000000000..84ce2727b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateContentType.java
@@ -0,0 +1,233 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.math.BigInteger;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for mandateContentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="mandateContentType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="validFrom" type="{http://www.w3.org/2001/XMLSchema}date"/>
+ * &lt;element name="validTo" type="{http://www.w3.org/2001/XMLSchema}date"/>
+ * &lt;element name="transactionLimit" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * &lt;element name="transactionLimitCurrency" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}currencyType"/>
+ * &lt;element name="isJoint" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="ischained" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * &lt;element name="typePower" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "mandateContentType", propOrder = {
+ "validFrom",
+ "validTo",
+ "transactionLimit",
+ "transactionLimitCurrency",
+ "isJoint",
+ "ischained",
+ "typePower"
+})
+public class MandateContentType {
+
+ @XmlElement(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar validFrom;
+ @XmlElement(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar validTo;
+ @XmlElement(required = true)
+ protected BigInteger transactionLimit;
+ @XmlElement(required = true)
+ protected String transactionLimitCurrency;
+ @XmlElement(required = true)
+ protected String isJoint;
+ protected boolean ischained;
+ @XmlElement(required = true)
+ protected String typePower;
+
+ /**
+ * Gets the value of the validFrom property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getValidFrom() {
+ return validFrom;
+ }
+
+ /**
+ * Sets the value of the validFrom property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setValidFrom(XMLGregorianCalendar value) {
+ this.validFrom = value;
+ }
+
+ /**
+ * Gets the value of the validTo property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getValidTo() {
+ return validTo;
+ }
+
+ /**
+ * Sets the value of the validTo property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setValidTo(XMLGregorianCalendar value) {
+ this.validTo = value;
+ }
+
+ /**
+ * Gets the value of the transactionLimit property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getTransactionLimit() {
+ return transactionLimit;
+ }
+
+ /**
+ * Sets the value of the transactionLimit property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setTransactionLimit(BigInteger value) {
+ this.transactionLimit = value;
+ }
+
+ /**
+ * Gets the value of the transactionLimitCurrency property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTransactionLimitCurrency() {
+ return transactionLimitCurrency;
+ }
+
+ /**
+ * Sets the value of the transactionLimitCurrency property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTransactionLimitCurrency(String value) {
+ this.transactionLimitCurrency = value;
+ }
+
+ /**
+ * Gets the value of the isJoint property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIsJoint() {
+ return isJoint;
+ }
+
+ /**
+ * Sets the value of the isJoint property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIsJoint(String value) {
+ this.isJoint = value;
+ }
+
+ /**
+ * Gets the value of the ischained property.
+ *
+ */
+ public boolean isIschained() {
+ return ischained;
+ }
+
+ /**
+ * Sets the value of the ischained property.
+ *
+ */
+ public void setIschained(boolean value) {
+ this.ischained = value;
+ }
+
+ /**
+ * Gets the value of the typePower property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTypePower() {
+ return typePower;
+ }
+
+ /**
+ * Sets the value of the typePower property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTypePower(String value) {
+ this.typePower = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateType.java
new file mode 100644
index 000000000..26597dc6b
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/MandateType.java
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for mandateType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="mandateType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="represented" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}representationPersonType"/>
+ * &lt;element name="representing" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}representationPersonType"/>
+ * &lt;element name="mandateContent" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}mandateContentType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "mandateType", propOrder = {
+ "represented",
+ "representing",
+ "mandateContent"
+})
+public class MandateType {
+
+ @XmlElement(required = true)
+ protected RepresentationPersonType represented;
+ @XmlElement(required = true)
+ protected RepresentationPersonType representing;
+ @XmlElement(required = true)
+ protected MandateContentType mandateContent;
+
+ /**
+ * Gets the value of the represented property.
+ *
+ * @return
+ * possible object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType getRepresented() {
+ return represented;
+ }
+
+ /**
+ * Sets the value of the represented property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public void setRepresented(RepresentationPersonType value) {
+ this.represented = value;
+ }
+
+ /**
+ * Gets the value of the representing property.
+ *
+ * @return
+ * possible object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType getRepresenting() {
+ return representing;
+ }
+
+ /**
+ * Sets the value of the representing property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepresentationPersonType }
+ *
+ */
+ public void setRepresenting(RepresentationPersonType value) {
+ this.representing = value;
+ }
+
+ /**
+ * Gets the value of the mandateContent property.
+ *
+ * @return
+ * possible object is
+ * {@link MandateContentType }
+ *
+ */
+ public MandateContentType getMandateContent() {
+ return mandateContent;
+ }
+
+ /**
+ * Sets the value of the mandateContent property.
+ *
+ * @param value
+ * allowed object is
+ * {@link MandateContentType }
+ *
+ */
+ public void setMandateContent(MandateContentType value) {
+ this.mandateContent = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/ObjectFactory.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/ObjectFactory.java
new file mode 100644
index 000000000..eca4ca3de
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/ObjectFactory.java
@@ -0,0 +1,433 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the eu.stork.peps.complex.attributes package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Habilitation_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "habilitation");
+ private final static QName _HasDegree_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "hasDegree");
+ private final static QName _SpApplication_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spApplication");
+ private final static QName _Specialisation_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "specialisation");
+ private final static QName _IsStudent_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isStudent");
+ private final static QName _AQAA_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "AQAA");
+ private final static QName _HCPType_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "HCPType");
+ private final static QName _CanonicalResidenceAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "canonicalResidenceAddress");
+ private final static QName _AcTitle_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "acTitle");
+ private final static QName _QualityAuthenticationAssuranceLevel_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "QualityAuthenticationAssuranceLevel");
+ private final static QName _IsAcademicStaff_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isAcademicStaff");
+ private final static QName _IsTeacherOf_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isTeacherOf");
+ private final static QName _IsCourseCoordinator_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isCourseCoordinator");
+ private final static QName _CanonicalRegisteredAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "canonicalRegisteredAddress");
+ private final static QName _SpCountry_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spCountry");
+ private final static QName _IsAdminStaff_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isAdminStaff");
+ private final static QName _CitizenCountryCode_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "CitizenCountryCode");
+ private final static QName _AttributeValue_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "AttributeValue");
+ private final static QName _HasAccountInBank_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "hasAccountInBank");
+ private final static QName _CountryCodeAddress_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "countryCodeAddress");
+ private final static QName _Study_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "study");
+ private final static QName _IsHealthCareProfessional_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "isHealthCareProfessional");
+ private final static QName _Mandate_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "mandate");
+ private final static QName _RequestedAttribute_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "RequestedAttribute");
+ private final static QName _SpSector_QNAME = new QName("urn:eu:stork:names:tc:STORK:1.0:assertion", "spSector");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: eu.stork.peps.complex.attributes
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link RequestedAttributeType }
+ *
+ */
+ public RequestedAttributeType createRequestedAttributeType() {
+ return new RequestedAttributeType();
+ }
+
+ /**
+ * Create an instance of {@link MandateType }
+ *
+ */
+ public MandateType createMandateType() {
+ return new MandateType();
+ }
+
+ /**
+ * Create an instance of {@link HasAccountInBankType }
+ *
+ */
+ public HasAccountInBankType createHasAccountInBankType() {
+ return new HasAccountInBankType();
+ }
+
+ /**
+ * Create an instance of {@link IsHealthCareProfessionalType }
+ *
+ */
+ public IsHealthCareProfessionalType createIsHealthCareProfessionalType() {
+ return new IsHealthCareProfessionalType();
+ }
+
+ /**
+ * Create an instance of {@link IsAdminStaffType }
+ *
+ */
+ public IsAdminStaffType createIsAdminStaffType() {
+ return new IsAdminStaffType();
+ }
+
+ /**
+ * Create an instance of {@link CanonicalAddressType }
+ *
+ */
+ public CanonicalAddressType createCanonicalAddressType() {
+ return new CanonicalAddressType();
+ }
+
+ /**
+ * Create an instance of {@link IsCourseCoordinatorType }
+ *
+ */
+ public IsCourseCoordinatorType createIsCourseCoordinatorType() {
+ return new IsCourseCoordinatorType();
+ }
+
+ /**
+ * Create an instance of {@link IsAcademicStaffType }
+ *
+ */
+ public IsAcademicStaffType createIsAcademicStaffType() {
+ return new IsAcademicStaffType();
+ }
+
+ /**
+ * Create an instance of {@link IsTeacherOfType }
+ *
+ */
+ public IsTeacherOfType createIsTeacherOfType() {
+ return new IsTeacherOfType();
+ }
+
+ /**
+ * Create an instance of {@link AcTitleType }
+ *
+ */
+ public AcTitleType createAcTitleType() {
+ return new AcTitleType();
+ }
+
+ /**
+ * Create an instance of {@link IsStudentType }
+ *
+ */
+ public IsStudentType createIsStudentType() {
+ return new IsStudentType();
+ }
+
+ /**
+ * Create an instance of {@link HasDegreeType }
+ *
+ */
+ public HasDegreeType createHasDegreeType() {
+ return new HasDegreeType();
+ }
+
+ /**
+ * Create an instance of {@link HabilitationType }
+ *
+ */
+ public HabilitationType createHabilitationType() {
+ return new HabilitationType();
+ }
+
+ /**
+ * Create an instance of {@link MandateContentType }
+ *
+ */
+ public MandateContentType createMandateContentType() {
+ return new MandateContentType();
+ }
+
+ /**
+ * Create an instance of {@link RepresentationPersonType }
+ *
+ */
+ public RepresentationPersonType createRepresentationPersonType() {
+ return new RepresentationPersonType();
+ }
+
+ /**
+ * Create an instance of {@link Habilitation }
+ *
+ */
+ public Habilitation createHabilitation() {
+ return new Habilitation();
+ }
+
+ /**
+ * Create an instance of {@link IsHCPType }
+ *
+ */
+ public IsHCPType createIsHCPType() {
+ return new IsHCPType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HabilitationType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "habilitation")
+ public JAXBElement<HabilitationType> createHabilitation(HabilitationType value) {
+ return new JAXBElement<HabilitationType>(_Habilitation_QNAME, HabilitationType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HasDegreeType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "hasDegree")
+ public JAXBElement<HasDegreeType> createHasDegree(HasDegreeType value) {
+ return new JAXBElement<HasDegreeType>(_HasDegree_QNAME, HasDegreeType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spApplication")
+ public JAXBElement<String> createSpApplication(String value) {
+ return new JAXBElement<String>(_SpApplication_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "specialisation")
+ public JAXBElement<String> createSpecialisation(String value) {
+ return new JAXBElement<String>(_Specialisation_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsStudentType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isStudent")
+ public JAXBElement<IsStudentType> createIsStudent(IsStudentType value) {
+ return new JAXBElement<IsStudentType>(_IsStudent_QNAME, IsStudentType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "AQAA")
+ public JAXBElement<Integer> createAQAA(Integer value) {
+ return new JAXBElement<Integer>(_AQAA_QNAME, Integer.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "HCPType")
+ public JAXBElement<String> createHCPType(String value) {
+ return new JAXBElement<String>(_HCPType_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CanonicalAddressType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "canonicalResidenceAddress")
+ public JAXBElement<CanonicalAddressType> createCanonicalResidenceAddress(CanonicalAddressType value) {
+ return new JAXBElement<CanonicalAddressType>(_CanonicalResidenceAddress_QNAME, CanonicalAddressType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AcTitleType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "acTitle")
+ public JAXBElement<AcTitleType> createAcTitle(AcTitleType value) {
+ return new JAXBElement<AcTitleType>(_AcTitle_QNAME, AcTitleType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "QualityAuthenticationAssuranceLevel")
+ public JAXBElement<Integer> createQualityAuthenticationAssuranceLevel(Integer value) {
+ return new JAXBElement<Integer>(_QualityAuthenticationAssuranceLevel_QNAME, Integer.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsAcademicStaffType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isAcademicStaff")
+ public JAXBElement<IsAcademicStaffType> createIsAcademicStaff(IsAcademicStaffType value) {
+ return new JAXBElement<IsAcademicStaffType>(_IsAcademicStaff_QNAME, IsAcademicStaffType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsTeacherOfType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isTeacherOf")
+ public JAXBElement<IsTeacherOfType> createIsTeacherOf(IsTeacherOfType value) {
+ return new JAXBElement<IsTeacherOfType>(_IsTeacherOf_QNAME, IsTeacherOfType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsCourseCoordinatorType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isCourseCoordinator")
+ public JAXBElement<IsCourseCoordinatorType> createIsCourseCoordinator(IsCourseCoordinatorType value) {
+ return new JAXBElement<IsCourseCoordinatorType>(_IsCourseCoordinator_QNAME, IsCourseCoordinatorType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CanonicalAddressType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "canonicalRegisteredAddress")
+ public JAXBElement<CanonicalAddressType> createCanonicalRegisteredAddress(CanonicalAddressType value) {
+ return new JAXBElement<CanonicalAddressType>(_CanonicalRegisteredAddress_QNAME, CanonicalAddressType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spCountry")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createSpCountry(String value) {
+ return new JAXBElement<String>(_SpCountry_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsAdminStaffType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isAdminStaff")
+ public JAXBElement<IsAdminStaffType> createIsAdminStaff(IsAdminStaffType value) {
+ return new JAXBElement<IsAdminStaffType>(_IsAdminStaff_QNAME, IsAdminStaffType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "CitizenCountryCode")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createCitizenCountryCode(String value) {
+ return new JAXBElement<String>(_CitizenCountryCode_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "AttributeValue")
+ public JAXBElement<Object> createAttributeValue(Object value) {
+ return new JAXBElement<Object>(_AttributeValue_QNAME, Object.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link HasAccountInBankType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "hasAccountInBank")
+ public JAXBElement<HasAccountInBankType> createHasAccountInBank(HasAccountInBankType value) {
+ return new JAXBElement<HasAccountInBankType>(_HasAccountInBank_QNAME, HasAccountInBankType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "countryCodeAddress")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public JAXBElement<String> createCountryCodeAddress(String value) {
+ return new JAXBElement<String>(_CountryCodeAddress_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "study")
+ public JAXBElement<String> createStudy(String value) {
+ return new JAXBElement<String>(_Study_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IsHealthCareProfessionalType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "isHealthCareProfessional")
+ public JAXBElement<IsHealthCareProfessionalType> createIsHealthCareProfessional(IsHealthCareProfessionalType value) {
+ return new JAXBElement<IsHealthCareProfessionalType>(_IsHealthCareProfessional_QNAME, IsHealthCareProfessionalType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link MandateType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "mandate")
+ public JAXBElement<MandateType> createMandate(MandateType value) {
+ return new JAXBElement<MandateType>(_Mandate_QNAME, MandateType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link RequestedAttributeType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "RequestedAttribute")
+ public JAXBElement<RequestedAttributeType> createRequestedAttribute(RequestedAttributeType value) {
+ return new JAXBElement<RequestedAttributeType>(_RequestedAttribute_QNAME, RequestedAttributeType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", name = "spSector")
+ public JAXBElement<String> createSpSector(String value) {
+ return new JAXBElement<String>(_SpSector_QNAME, String.class, null, value);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RepresentationPersonType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RepresentationPersonType.java
new file mode 100644
index 000000000..b1d993f89
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RepresentationPersonType.java
@@ -0,0 +1,289 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for representationPersonType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="representationPersonType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;choice>
+ * &lt;sequence>
+ * &lt;element name="eIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="givenName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="surname" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="dateOfBirth" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;sequence>
+ * &lt;element name="eLPIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="address" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="canonicalAddress" type="{urn:eu:stork:names:tc:STORK:1.0:assertion}canonicalAddressType"/>
+ * &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/choice>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "representationPersonType", propOrder = {
+ "eIdentifier",
+ "givenName",
+ "surname",
+ "dateOfBirth",
+ "elpIdentifier",
+ "name",
+ "address",
+ "canonicalAddress",
+ "type"
+})
+public class RepresentationPersonType {
+
+ protected String eIdentifier;
+ protected String givenName;
+ protected String surname;
+ protected String dateOfBirth;
+ @XmlElement(name = "eLPIdentifier")
+ protected String elpIdentifier;
+ protected String name;
+ protected String address;
+ protected CanonicalAddressType canonicalAddress;
+ protected String type;
+
+ /**
+ * Gets the value of the eIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getEIdentifier() {
+ return eIdentifier;
+ }
+
+ /**
+ * Sets the value of the eIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setEIdentifier(String value) {
+ this.eIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the givenName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getGivenName() {
+ return givenName;
+ }
+
+ /**
+ * Sets the value of the givenName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setGivenName(String value) {
+ this.givenName = value;
+ }
+
+ /**
+ * Gets the value of the surname property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSurname() {
+ return surname;
+ }
+
+ /**
+ * Sets the value of the surname property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSurname(String value) {
+ this.surname = value;
+ }
+
+ /**
+ * Gets the value of the dateOfBirth property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDateOfBirth() {
+ return dateOfBirth;
+ }
+
+ /**
+ * Sets the value of the dateOfBirth property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDateOfBirth(String value) {
+ this.dateOfBirth = value;
+ }
+
+ /**
+ * Gets the value of the elpIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getELPIdentifier() {
+ return elpIdentifier;
+ }
+
+ /**
+ * Sets the value of the elpIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setELPIdentifier(String value) {
+ this.elpIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAddress(String value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the canonicalAddress property.
+ *
+ * @return
+ * possible object is
+ * {@link CanonicalAddressType }
+ *
+ */
+ public CanonicalAddressType getCanonicalAddress() {
+ return canonicalAddress;
+ }
+
+ /**
+ * Sets the value of the canonicalAddress property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CanonicalAddressType }
+ *
+ */
+ public void setCanonicalAddress(CanonicalAddressType value) {
+ this.canonicalAddress = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RequestedAttributeType.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RequestedAttributeType.java
new file mode 100644
index 000000000..6a7c0b443
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/RequestedAttributeType.java
@@ -0,0 +1,212 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+
+package eu.stork.peps.complex.attributes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+
+/**
+ * <p>Java class for RequestedAttributeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="RequestedAttributeType">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{urn:eu:stork:names:tc:STORK:1.0:assertion}AttributeValue" maxOccurs="unbounded" minOccurs="0"/>
+ * &lt;/sequence>
+ * &lt;attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="NameFormat" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ * &lt;attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="isRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ * &lt;anyAttribute processContents='lax' namespace='##other'/>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RequestedAttributeType", propOrder = {
+ "attributeValue"
+})
+public class RequestedAttributeType {
+
+ @XmlElement(name = "AttributeValue")
+ protected List<Object> attributeValue;
+ @XmlAttribute(name = "Name", required = true)
+ protected String name;
+ @XmlAttribute(name = "NameFormat", required = true)
+ @XmlSchemaType(name = "anyURI")
+ protected String nameFormat;
+ @XmlAttribute(name = "FriendlyName")
+ protected String friendlyName;
+ @XmlAttribute(name = "isRequired")
+ protected Boolean isRequired;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the attributeValue property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the attributeValue property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAttributeValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Object }
+ *
+ *
+ */
+ public List<Object> getAttributeValue() {
+ if (attributeValue == null) {
+ attributeValue = new ArrayList<Object>();
+ }
+ return this.attributeValue;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the nameFormat property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNameFormat() {
+ return nameFormat;
+ }
+
+ /**
+ * Sets the value of the nameFormat property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNameFormat(String value) {
+ this.nameFormat = value;
+ }
+
+ /**
+ * Gets the value of the friendlyName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Sets the value of the friendlyName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFriendlyName(String value) {
+ this.friendlyName = value;
+ }
+
+ /**
+ * Gets the value of the isRequired property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isIsRequired() {
+ return isRequired;
+ }
+
+ /**
+ * Sets the value of the isRequired property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setIsRequired(Boolean value) {
+ this.isRequired = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and
+ * the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute
+ * by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return
+ * always non-null
+ */
+ public Map<QName, String> getOtherAttributes() {
+ return otherAttributes;
+ }
+
+}
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/package-info.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/package-info.java
new file mode 100644
index 000000000..47e225d22
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/complex/attributes/package-info.java
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.17 at 10:36:59 AM GMT
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "urn:eu:stork:names:tc:STORK:1.0:assertion", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package eu.stork.peps.complex.attributes;
diff --git a/id/server/stork2-commons/src/main/resources/.svn/all-wcprops b/id/server/stork2-commons/src/main/resources/.svn/all-wcprops
new file mode 100644
index 000000000..7f5879720
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/resources
+END
+log4j.xml
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/main/resources/log4j.xml
+END
+StorkcomplexAttributes.xsd
+K 25
+svn:wc:ra_dav:version-url
+V 91
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/main/resources/StorkcomplexAttributes.xsd
+END
diff --git a/id/server/stork2-commons/src/main/resources/.svn/entries b/id/server/stork2-commons/src/main/resources/.svn/entries
new file mode 100644
index 000000000..3cafa50cf
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/main/resources
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+log4j.xml
+file
+
+
+
+
+2013-12-20T12:27:56.554475Z
+aa8c46e41a236b8c7049713b3eeecc49
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+660
+
+StorkcomplexAttributes.xsd
+file
+
+
+
+
+2014-03-05T09:36:07.834515Z
+312be97fd22ecb2f274bf9fdebd85b29
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10938
+
diff --git a/id/server/stork2-commons/src/main/resources/.svn/text-base/StorkcomplexAttributes.xsd.svn-base b/id/server/stork2-commons/src/main/resources/.svn/text-base/StorkcomplexAttributes.xsd.svn-base
new file mode 100644
index 000000000..3c56bd318
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/.svn/text-base/StorkcomplexAttributes.xsd.svn-base
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ targetNamespace="urn:eu:stork:names:tc:STORK:1.0:assertion"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ <!--QAA -->
+ <xs:element name="QualityAuthenticationAssuranceLevel"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ <xs:element name="spSector" type="stork:SPSectorType" />
+ <xs:element name="spApplication" type="stork:SPApplicationType" />
+ <xs:element name="spCountry" type="stork:CountryCodeType" />
+ <xs:element name="CitizenCountryCode" type="stork:CountryCodeType" />
+ <xs:element name="RequestedAttribute" type="stork:RequestedAttributeType" />
+ <xs:element name="AttributeValue" type="xs:anyType" />
+ <xs:element name="canonicalResidenceAddress" type="stork:canonicalAddressType" />
+ <xs:element name="countryCodeAddress" type="stork:CountryCodeType" />
+
+ <xs:element name="hasDegree" type="stork:hasDegreeType" />
+ <xs:element name="isStudent" type="stork:isStudentType" />
+ <xs:element name="isAcademicStaff" type="stork:isAcademicStaffType" />
+ <xs:element name="isTeacherOf" type="stork:isTeacherOfType" />
+ <xs:element name="isCourseCoordinator" type="stork:isCourseCoordinatorType" />
+ <xs:element name="isAdminStaff" type="stork:isAdminStaffType" />
+ <xs:element name="habilitation" type="stork:habilitationType" />
+ <xs:element name="acTitle" type="stork:acTitleType" />
+ <xs:element name="hasAccountInBank" type="stork:hasAccountInBankType" />
+ <xs:element name="isHealthCareProfessional" type="stork:isHealthCareProfessionalType" />
+ <xs:element name="canonicalRegisteredAddress" type="stork:canonicalAddressType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ <xs:element name="mandate" type="stork:mandateType" />
+ <xs:element name="study" type="stork:studyType" />
+ <xs:element name="HCPType" type="stork:HCPType" />
+
+ <xs:attribute name="AttributeStatus" type="stork:AttributeStatusType" />
+
+ <xs:simpleType name="SPSectorType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="20" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="SPApplicationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="100" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="AttributeStatusType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Available" />
+ <xs:enumeration value="NotAvailable" />
+ <xs:enumeration value="Withheld" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="studyType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="2" />
+ <xs:maxLength value="5" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="LevelType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="currencyType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="3" />
+ <xs:maxLength value="3" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="occupationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="titleNormalisedType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="HCPType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="specialisationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+
+ <xs:simpleType name="QualityAuthenticationAssuranceLevelType">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="1" />
+ <xs:maxInclusive value="4" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="canonicalAddressType">
+ <xs:sequence>
+ <xs:element name="countryCodeAddress" type="stork:CountryCodeType" />
+ <xs:element name="state" type="xs:string" minOccurs="0" />
+ <xs:element name="municipalityCode" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="town" type="xs:string" />
+ <xs:element name="postalCode" type="xs:string" />
+ <xs:element name="streetName" type="xs:string" />
+ <xs:element name="streetNumber" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="apartmentNumber" type="xs:string"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="hasDegreeType">
+ <xs:sequence>
+ <xs:element name="study" type="stork:studyType" />
+ <xs:element name="level" type="stork:LevelType" />
+ <xs:element name="yearObtained" type="xs:integer" />
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isAcademicStaffType">
+ <xs:sequence>
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="occupation" type="stork:occupationType" />
+ <xs:element name="knowledgearea" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isTeacherOfType">
+ <xs:sequence>
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="course" type="xs:string" />
+ <xs:element name="role" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isCourseCoordinatorType">
+ <xs:sequence>
+ <xs:element name="courseCoodinator" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isAdminStaffType">
+ <xs:sequence>
+ <xs:element name="adminStaff" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="habilitation">
+ <xs:sequence>
+ <xs:element name="ability" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="acTitleType">
+ <xs:sequence>
+ <xs:element name="titleNormalised" type="stork:titleNormalisedType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="hasAccountInBankType">
+ <xs:sequence>
+ <xs:element name="bankName" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isHCPType">
+ <xs:sequence>
+ <xs:element name="nameOfOrganisation" type="xs:string" />
+ <xs:element name="HCPType" type="stork:HCPType" />
+ <xs:element name="specialisation" type="stork:specialisationType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="representationPersonType">
+ <xs:choice>
+ <xs:sequence>
+ <xs:element name="eIdentifier" type="xs:string" />
+ <xs:element name="givenName" type="xs:string" />
+ <xs:element name="surname" type="xs:string" />
+ <xs:element name="dateOfBirth" type="xs:string" />
+ </xs:sequence>
+ <xs:sequence>
+ <xs:element name="eLPIdentifier" type="xs:string" />
+ <xs:element name="name" type="xs:string" />
+ <xs:element name="address" type="xs:string" />
+ <xs:element name="canonicalAddress" type="stork:canonicalAddressType" />
+ <xs:element name="type" type="xs:string" />
+ </xs:sequence>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="mandateType">
+ <xs:sequence>
+ <xs:element name="represented" type="stork:representationPersonType" />
+ <xs:element name="representing" type="stork:representationPersonType" />
+ <xs:element name="mandateContent" type="stork:mandateContentType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="mandateContentType">
+ <xs:sequence>
+ <xs:element name="validFrom" type="xs:date" />
+ <xs:element name="validTo" type="xs:date" />
+ <xs:element name="transactionLimit" type="xs:integer" />
+ <xs:element name="transactionLimitCurrency" type="stork:currencyType" />
+ <xs:element name="isJoint" type="xs:string" />
+ <xs:element name="ischained" type="xs:boolean" />
+ <xs:element name="typePower" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:simpleType name="CountryCodeType">
+ <xs:restriction base="xs:token">
+ <xs:pattern value="[A-Z]{2}" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="RequestedAttributeType">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="stork:AttributeValue" />
+ </xs:sequence>
+ <xs:attribute name="Name" use="required" type="xs:string" />
+ <xs:attribute name="NameFormat" use="required" type="xs:anyURI" />
+ <xs:attribute name="FriendlyName" use="optional" type="xs:string" />
+ <xs:attribute name="isRequired" use="optional" type="xs:boolean" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+
+ <xs:complexType name="isStudentType">
+ <xs:sequence>
+ <xs:element ref="stork:study" />
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="course" type="xs:integer" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="habilitationType">
+ <xs:sequence>
+ <xs:element name="ability" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isHealthCareProfessionalType">
+ <xs:sequence>
+ <xs:element name="nameOfOrganisation" type="xs:string" />
+ <xs:element ref="stork:HCPType" />
+ <xs:element ref="stork:specialisation" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="specialisation" type="stork:specialisationType" />
+ <xs:simpleType name="medical">
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="2" />
+ <xs:minLength value="2" />
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
diff --git a/id/server/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base b/id/server/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base
new file mode 100644
index 000000000..8bce0bec0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/.svn/text-base/log4j.xml.svn-base
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="/opt/storklogs/stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/stork2-commons/src/main/resources/StorkcomplexAttributes.xsd b/id/server/stork2-commons/src/main/resources/StorkcomplexAttributes.xsd
new file mode 100644
index 000000000..3c56bd318
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/StorkcomplexAttributes.xsd
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ targetNamespace="urn:eu:stork:names:tc:STORK:1.0:assertion"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ <!--QAA -->
+ <xs:element name="QualityAuthenticationAssuranceLevel"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ <xs:element name="spSector" type="stork:SPSectorType" />
+ <xs:element name="spApplication" type="stork:SPApplicationType" />
+ <xs:element name="spCountry" type="stork:CountryCodeType" />
+ <xs:element name="CitizenCountryCode" type="stork:CountryCodeType" />
+ <xs:element name="RequestedAttribute" type="stork:RequestedAttributeType" />
+ <xs:element name="AttributeValue" type="xs:anyType" />
+ <xs:element name="canonicalResidenceAddress" type="stork:canonicalAddressType" />
+ <xs:element name="countryCodeAddress" type="stork:CountryCodeType" />
+
+ <xs:element name="hasDegree" type="stork:hasDegreeType" />
+ <xs:element name="isStudent" type="stork:isStudentType" />
+ <xs:element name="isAcademicStaff" type="stork:isAcademicStaffType" />
+ <xs:element name="isTeacherOf" type="stork:isTeacherOfType" />
+ <xs:element name="isCourseCoordinator" type="stork:isCourseCoordinatorType" />
+ <xs:element name="isAdminStaff" type="stork:isAdminStaffType" />
+ <xs:element name="habilitation" type="stork:habilitationType" />
+ <xs:element name="acTitle" type="stork:acTitleType" />
+ <xs:element name="hasAccountInBank" type="stork:hasAccountInBankType" />
+ <xs:element name="isHealthCareProfessional" type="stork:isHealthCareProfessionalType" />
+ <xs:element name="canonicalRegisteredAddress" type="stork:canonicalAddressType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ <xs:element name="mandate" type="stork:mandateType" />
+ <xs:element name="study" type="stork:studyType" />
+ <xs:element name="HCPType" type="stork:HCPType" />
+
+ <xs:attribute name="AttributeStatus" type="stork:AttributeStatusType" />
+
+ <xs:simpleType name="SPSectorType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="20" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="SPApplicationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="100" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="AttributeStatusType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Available" />
+ <xs:enumeration value="NotAvailable" />
+ <xs:enumeration value="Withheld" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="studyType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="2" />
+ <xs:maxLength value="5" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="LevelType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="currencyType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="3" />
+ <xs:maxLength value="3" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="occupationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="titleNormalisedType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="HCPType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="specialisationType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ <xs:maxLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+
+
+ <xs:simpleType name="QualityAuthenticationAssuranceLevelType">
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="1" />
+ <xs:maxInclusive value="4" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="canonicalAddressType">
+ <xs:sequence>
+ <xs:element name="countryCodeAddress" type="stork:CountryCodeType" />
+ <xs:element name="state" type="xs:string" minOccurs="0" />
+ <xs:element name="municipalityCode" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="town" type="xs:string" />
+ <xs:element name="postalCode" type="xs:string" />
+ <xs:element name="streetName" type="xs:string" />
+ <xs:element name="streetNumber" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="apartmentNumber" type="xs:string"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="hasDegreeType">
+ <xs:sequence>
+ <xs:element name="study" type="stork:studyType" />
+ <xs:element name="level" type="stork:LevelType" />
+ <xs:element name="yearObtained" type="xs:integer" />
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isAcademicStaffType">
+ <xs:sequence>
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="occupation" type="stork:occupationType" />
+ <xs:element name="knowledgearea" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isTeacherOfType">
+ <xs:sequence>
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="course" type="xs:string" />
+ <xs:element name="role" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isCourseCoordinatorType">
+ <xs:sequence>
+ <xs:element name="courseCoodinator" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isAdminStaffType">
+ <xs:sequence>
+ <xs:element name="adminStaff" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="habilitation">
+ <xs:sequence>
+ <xs:element name="ability" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="acTitleType">
+ <xs:sequence>
+ <xs:element name="titleNormalised" type="stork:titleNormalisedType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="hasAccountInBankType">
+ <xs:sequence>
+ <xs:element name="bankName" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isHCPType">
+ <xs:sequence>
+ <xs:element name="nameOfOrganisation" type="xs:string" />
+ <xs:element name="HCPType" type="stork:HCPType" />
+ <xs:element name="specialisation" type="stork:specialisationType" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="representationPersonType">
+ <xs:choice>
+ <xs:sequence>
+ <xs:element name="eIdentifier" type="xs:string" />
+ <xs:element name="givenName" type="xs:string" />
+ <xs:element name="surname" type="xs:string" />
+ <xs:element name="dateOfBirth" type="xs:string" />
+ </xs:sequence>
+ <xs:sequence>
+ <xs:element name="eLPIdentifier" type="xs:string" />
+ <xs:element name="name" type="xs:string" />
+ <xs:element name="address" type="xs:string" />
+ <xs:element name="canonicalAddress" type="stork:canonicalAddressType" />
+ <xs:element name="type" type="xs:string" />
+ </xs:sequence>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="mandateType">
+ <xs:sequence>
+ <xs:element name="represented" type="stork:representationPersonType" />
+ <xs:element name="representing" type="stork:representationPersonType" />
+ <xs:element name="mandateContent" type="stork:mandateContentType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="mandateContentType">
+ <xs:sequence>
+ <xs:element name="validFrom" type="xs:date" />
+ <xs:element name="validTo" type="xs:date" />
+ <xs:element name="transactionLimit" type="xs:integer" />
+ <xs:element name="transactionLimitCurrency" type="stork:currencyType" />
+ <xs:element name="isJoint" type="xs:string" />
+ <xs:element name="ischained" type="xs:boolean" />
+ <xs:element name="typePower" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:simpleType name="CountryCodeType">
+ <xs:restriction base="xs:token">
+ <xs:pattern value="[A-Z]{2}" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="RequestedAttributeType">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="stork:AttributeValue" />
+ </xs:sequence>
+ <xs:attribute name="Name" use="required" type="xs:string" />
+ <xs:attribute name="NameFormat" use="required" type="xs:anyURI" />
+ <xs:attribute name="FriendlyName" use="optional" type="xs:string" />
+ <xs:attribute name="isRequired" use="optional" type="xs:boolean" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+
+ <xs:complexType name="isStudentType">
+ <xs:sequence>
+ <xs:element ref="stork:study" />
+ <xs:element name="nameOfInstitution" type="xs:string" />
+ <xs:element name="course" type="xs:integer" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="habilitationType">
+ <xs:sequence>
+ <xs:element name="ability" type="xs:string" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="isHealthCareProfessionalType">
+ <xs:sequence>
+ <xs:element name="nameOfOrganisation" type="xs:string" />
+ <xs:element ref="stork:HCPType" />
+ <xs:element ref="stork:specialisation" />
+ <xs:element name="AQAA"
+ type="stork:QualityAuthenticationAssuranceLevelType" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="specialisation" type="stork:specialisationType" />
+ <xs:simpleType name="medical">
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="2" />
+ <xs:minLength value="2" />
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
diff --git a/id/server/stork2-commons/src/main/resources/log4j.xml b/id/server/stork2-commons/src/main/resources/log4j.xml
new file mode 100644
index 000000000..8bce0bec0
--- /dev/null
+++ b/id/server/stork2-commons/src/main/resources/log4j.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="/opt/storklogs/stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/stork2-commons/src/test/.svn/all-wcprops b/id/server/stork2-commons/src/test/.svn/all-wcprops
new file mode 100644
index 000000000..20c6abf40
--- /dev/null
+++ b/id/server/stork2-commons/src/test/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 54
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test
+END
diff --git a/id/server/stork2-commons/src/test/.svn/entries b/id/server/stork2-commons/src/test/.svn/entries
new file mode 100644
index 000000000..2340f1ba0
--- /dev/null
+++ b/id/server/stork2-commons/src/test/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+resources
+dir
+
+java
+dir
+
diff --git a/id/server/stork2-commons/src/test/java/.svn/all-wcprops b/id/server/stork2-commons/src/test/java/.svn/all-wcprops
new file mode 100644
index 000000000..0539c7776
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java
+END
diff --git a/id/server/stork2-commons/src/test/java/.svn/entries b/id/server/stork2-commons/src/test/java/.svn/entries
new file mode 100644
index 000000000..022ccbba6
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+eu
+dir
+
diff --git a/id/server/stork2-commons/src/test/java/eu/.svn/all-wcprops b/id/server/stork2-commons/src/test/java/eu/.svn/all-wcprops
new file mode 100644
index 000000000..1074db391
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java/eu
+END
diff --git a/id/server/stork2-commons/src/test/java/eu/.svn/entries b/id/server/stork2-commons/src/test/java/eu/.svn/entries
new file mode 100644
index 000000000..b692975a3
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+stork
+dir
+
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops b/id/server/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops
new file mode 100644
index 000000000..7b9321684
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java/eu/stork
+END
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/.svn/entries b/id/server/stork2-commons/src/test/java/eu/stork/.svn/entries
new file mode 100644
index 000000000..1b9026249
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+peps
+dir
+
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops b/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops
new file mode 100644
index 000000000..1a4a3889b
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java/eu/stork/peps
+END
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/entries b/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/entries
new file mode 100644
index 000000000..568fa8c62
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork/peps
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+tests
+dir
+
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops
new file mode 100644
index 000000000..fd0288d3a
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/all-wcprops
@@ -0,0 +1,59 @@
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java/eu/stork/peps/tests
+END
+AttributeSourceTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 108
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
+END
+ComplexAttributesMarshalling.java
+K 25
+svn:wc:ra_dav:version-url
+V 113
+/CITnet/svn/STORK2/!svn/ver/721/trunk/Commons/src/test/java/eu/stork/peps/tests/ComplexAttributesMarshalling.java
+END
+PEPSUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
+END
+PersonalAttributeTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 109
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
+END
+package-info.java
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/package-info.java
+END
+DateUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 100
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
+END
+AttributeProvidersMapTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/712/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
+END
+AttributeUtilTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 105
+/CITnet/svn/STORK2/!svn/ver/96/trunk/Commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
+END
+PersonalAttributeListTestCase.java
+K 25
+svn:wc:ra_dav:version-url
+V 114
+/CITnet/svn/STORK2/!svn/ver/484/trunk/Commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
+END
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries
new file mode 100644
index 000000000..7c5cf8a9d
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/entries
@@ -0,0 +1,334 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/java/eu/stork/peps/tests
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+PersonalAttributeTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+77386880d5ffadd21c9b3a3c7d51b990
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5449
+
+package-info.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+04f136539bda0caa3d5ccdfee912cfce
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+92
+
+DateUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+244cc6104660a7835dbf72dadb305d71
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8907
+
+AttributeProvidersMapTestCase.java
+file
+
+
+
+
+2014-03-05T09:36:07.758515Z
+1490c44149a87308c4a6cc0e2af88a85
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3995
+
+AttributeUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+6037f125adf7f4c2f6873a0d99ab0705
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16318
+
+PersonalAttributeListTestCase.java
+file
+
+
+
+
+2014-01-21T08:38:55.140702Z
+ae552dce95a6b83d15e381306e2f5e59
+2014-01-15T09:44:59.969756Z
+484
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+24508
+
+AttributeSourceTestCase.java
+file
+
+
+
+
+2014-03-05T09:36:07.758515Z
+1505085e4fd6c684d4f6a8db3d5ba233
+2014-03-03T15:10:40.224759Z
+712
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2465
+
+ComplexAttributesMarshalling.java
+file
+
+
+
+
+2014-03-05T09:36:07.758515Z
+aca1d76d312b0dc5026f852bb14ab5a5
+2014-03-04T14:10:03.192908Z
+721
+emrepisja
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6363
+
+PEPSUtilTestCase.java
+file
+
+
+
+
+2013-12-20T12:27:56.518475Z
+f54beadeab9af936f44af326eb1116d2
+2013-11-01T20:35:30.927048Z
+96
+emferreri
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16714
+
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base
new file mode 100644
index 000000000..89f5adbed
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeProvidersMapTestCase.java.svn-base
@@ -0,0 +1,134 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeProvidersMap;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+import eu.stork.peps.auth.commons.IAttributeProvidersMap;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public class AttributeProvidersMapTestCase {
+
+ @Test
+ public void testObjectOK1() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK2() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ if ( map.get(source)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK3() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK4() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ if ( map.get(target)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectNOK1() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+
+ @Test
+ public void testObjectNOK2() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base
new file mode 100644
index 000000000..e0f685ade
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeSourceTestCase.java.svn-base
@@ -0,0 +1,88 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeSourceTestCase {
+ private final AttributeSource ap1 = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL1");
+ private final AttributeSource ap2 = new AttributeSource(new AttributeProvider("ID2", "Name 2", null), "URL2");
+ private final AttributeSource ap3 = new AttributeSource(new AttributeProvider("ID1", "Name 2", null), "URL2");
+ private final AttributeSource ap4 = new AttributeSource(new AttributeProvider("ID1", "Name 2", null), "URL1");
+ private final AttributeSource ap5 = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL1");
+
+ private final AttributeSource c1 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+ private final AttributeSource c2 = new AttributeSource(new Country("ID2", "Name 2"), "URL2");
+ private final AttributeSource c3 = new AttributeSource(new Country("ID1", "Name 2"), "URL2");
+ private final AttributeSource c4 = new AttributeSource(new Country("ID1", "Name 2"), "URL1");
+ private final AttributeSource c5 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+
+ @Test
+ public void testNotEquals1() {
+ assertFalse(ap1.equals(ap2));
+ }
+
+ @Test
+ public void testNotEquals2() {
+ assertFalse(ap1.equals(c1));
+ }
+
+ @Test
+ public void testNotEquals3() {
+ assertFalse(c1.equals(c2));
+ }
+
+ @Test
+ public void testEquals1() {
+ assertTrue(ap1.equals(ap3));
+ }
+
+ @Test
+ public void testEquals2() {
+ assertTrue(ap1.equals(ap4));
+ }
+
+ @Test
+ public void testEquals3() {
+ assertTrue(ap1.equals(ap5));
+ }
+
+ @Test
+ public void testEquals4() {
+ assertTrue(c1.equals(c3));
+ }
+
+ @Test
+ public void testEquals5() {
+ assertTrue(c1.equals(c4));
+ }
+
+ @Test
+ public void testEquals6() {
+ assertTrue(c1.equals(c5));
+ }
+
+ @Test
+ public void testEquals7() {
+ final Object obj = ap5;
+ assertTrue(ap1.equals(obj));
+ }
+
+ @Test
+ public void testEquals8() {
+ final Object obj = c5;
+ assertTrue(c1.equals(obj));
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base
new file mode 100644
index 000000000..77fc4b9c2
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/AttributeUtilTestCase.java.svn-base
@@ -0,0 +1,537 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeUtil;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSValues;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeUtilTestCase {
+
+ /**
+ * Empty String to be used on the tests.
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * Tuple value sample to be used on the tests.
+ */
+ private static final String[] TUPLE_STRING = new String[] { "age", "true",
+ "[18]", "Available" };
+
+ /**
+ * Complex value to be used on escape/unescape tests.
+ */
+ private static final String COMPLEX_VAL = "postalCode=4100,"
+ + "apartmentNumber=A,state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,";
+
+ /**
+ * Escaped Complex value to be used on escape/unescape tests.
+ */
+ private static final String ESC_COMPLEX_VAL = "postalCode=4100%44"
+ + "apartmentNumber=A%44state=Porto%44countryCodeAddress=PT%44"
+ + "streetNumber=379%44streetName=Avenida Sidonio Pais%44town=Porto%44";
+
+ /**
+ * Simple value to be used on escape/unescape tests.
+ */
+ private static final String SIMPLE_VAL = "Avenida da Boavista, Porto";
+
+ /**
+ * Escaped simple value to be used on escape/unescape tests.
+ */
+ private static final String ESC_SIMPLE_VAL = "Avenida da Boavista%44 Porto";
+
+ /**
+ * Simple text to be used on escape/unescape tests. Must match the escaped
+ * text.
+ */
+ private static final String SIMPLE_TEXT = "John Doe";
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given complex
+ * attribute value (canonical address' example attribute value).
+ */
+ @Test
+ public void testEscapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.escape(COMPLEX_VAL), ESC_COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given
+ * attribute value.
+ */
+ @Test
+ public void testEscapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.escape(SIMPLE_VAL), ESC_SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to escape.
+ */
+ @Test
+ public void testEscapeNormalChars() {
+ assertEquals(AttributeUtil.escape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#unescape(String)} method for the given
+ * escape complex attribute value (canonical address' example attribute
+ * value).
+ */
+ @Test
+ public void testUnescapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.unescape(ESC_COMPLEX_VAL), COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given escape
+ * attribute value.
+ */
+ @Test
+ public void testUnescapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.unescape(ESC_SIMPLE_VAL), SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to unescape.
+ */
+ @Test
+ public void testUnescapeNormalChars() {
+ assertEquals(AttributeUtil.unescape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given empty string.
+ */
+ @Test
+ public void testAppendIfNotNullEmptyStr() {
+ final StringBuilder strBuilder = new StringBuilder(SIMPLE_TEXT);
+ AttributeUtil.appendIfNotNull(strBuilder, EMPTY_STRING);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given string.
+ */
+ @Test
+ public void testAppendIfNotNullStr() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, SIMPLE_TEXT);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given null value.
+ */
+ @Test
+ public void testAppendIfNotNull() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, null);
+ assertEquals(strBuilder.toString(), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with two values.
+ */
+ @Test
+ public void testListToStringTwoVals() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+ vals.add(SIMPLE_TEXT);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one values.
+ */
+ @Test
+ public void testListToStringOneVal() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one value.
+ */
+ @Test
+ public void testListToStringEmptyVal() {
+ final List<String> vals = new ArrayList<String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given Map with one value.
+ */
+ @Test
+ public void testMapToStringOneVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+ vals.put("CanonicalAddress", COMPLEX_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("CanonicalAddress=");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given empty Map.
+ */
+ @Test
+ public void testMapToStringEmptyVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid List.
+ */
+ @Test
+ public void testIsValidValueInvalidList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * null value.
+ */
+ @Test
+ public void testIsValidValueNullList() {
+ assertFalse(AttributeUtil.isValidValue(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyList() {
+ assertTrue(AttributeUtil.isValidValue("[]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyCommaList() {
+ assertTrue(AttributeUtil.isValidValue("[,]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * multi value List.
+ */
+ @Test
+ public void testIsValidValueMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid multi value List.
+ */
+ @Test
+ public void testIsValidValueInvalidMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * true type.
+ */
+ @Test
+ public void testIsValidTypetrue() {
+ assertTrue(AttributeUtil.isValidType("true"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * True type.
+ */
+ @Test
+ public void testIsValidTypeTrue() {
+ assertTrue(AttributeUtil.isValidType("True"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * TRUE type.
+ */
+ @Test
+ public void testIsValidTypeTRUE() {
+ assertTrue(AttributeUtil.isValidType("TRUE"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * invalid type.
+ */
+ @Test
+ public void testIsValidTypeInvalidType() {
+ assertFalse(AttributeUtil.isValidType("str"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * false type.
+ */
+ @Test
+ public void testIsValidTypefalse() {
+ assertTrue(AttributeUtil.isValidType("false"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * False type.
+ */
+ @Test
+ public void testIsValidTypeFalse() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * FALSE type.
+ */
+ @Test
+ public void testIsValidTypeFALSEVal() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * null.
+ */
+ @Test
+ public void testIsValidTypeNullVal() {
+ assertFalse(AttributeUtil.isValidType(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given valid tuple.
+ */
+ @Test
+ public void testHasValidTuples() {
+ assertTrue(AttributeUtil.hasValidTuples(TUPLE_STRING));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple.
+ */
+ @Test
+ public void testHasValidTuplesInvalid() {
+ final String[] tuple = new String[]{"name", "type"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple with valid size.
+ */
+ @Test
+ public void testHasValidTuplesSameSizeInvalidValues() {
+ final String[] tuple = new String[] { "age", "type", "[18]", "Available"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given null value.
+ */
+ @Test
+ public void testHasValidTuplesNull() {
+ assertFalse(AttributeUtil.hasValidTuples(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list..
+ */
+ @Test
+ public void testCheckMandatoryAttributes() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[18,]:Available;");
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testCheckMandatoryAttributesNullAttrList() {
+ assertTrue(AttributeUtil.checkMandatoryAttributes(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given empty attribute list.
+ */
+ @Test
+ public void testCheckMandatoryAttributesEmptyAttrList() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list (missing mandatory attribute).
+ */
+ @Test
+ public void testCheckMandatoryAttributesMissingAttr() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[]:NotAvailable;");
+ assertFalse(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/ComplexAttributesMarshalling.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/ComplexAttributesMarshalling.java.svn-base
new file mode 100644
index 000000000..c7e195fa6
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/ComplexAttributesMarshalling.java.svn-base
@@ -0,0 +1,187 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * ---
+ *
+ * Test cases for marshalling complex attributes.
+ *
+ * Implemented are two testcases for marshalling and unmarshalling. These testcases are
+ * for canonical residenc address and has bank account.
+ */
+
+package eu.stork.peps.tests;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
+
+import org.junit.Test;
+
+import eu.stork.peps.complex.attributes.CanonicalAddressType;
+import eu.stork.peps.complex.attributes.HasAccountInBankType;
+import eu.stork.peps.complex.attributes.ObjectFactory;
+
+/**
+ * @author Advania
+ *
+ * Examples on how to use the jaxb marshaller.
+ *
+ * The classes are created from the StorkcomplexAttributes.xsd schema located in resources.
+ *
+ * @version $Revision: 1.00 $, $Date: 2014-17-02 11:15:00 $
+ *
+ */
+
+public class ComplexAttributesMarshalling {
+
+ /**
+ * Test marshalling canonical address
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <canonicalResidenceAddress xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <countryCodeAddress>IS</countryCodeAddress>
+ * <state>Reykjavik</state>
+ * <municipalityCode>RVK</municipalityCode>
+ * <town>Reykjavik</town>
+ * <postalCode>101</postalCode>
+ * <streetName>Laugavegur</streetName>
+ * <streetNumber>1</streetNumber>
+ * <apartmentNumber>10</apartmentNumber>
+ * </canonicalResidenceAddress>
+ */
+ @Test
+ public void testMarshallCanonicalResidencAddress()
+ {
+ try
+ {
+ final CanonicalAddressType object = new CanonicalAddressType();
+ object.setApartmentNumber("10");
+ object.setCountryCodeAddress("IS");
+ object.setMunicipalityCode("RVK");
+ object.setPostalCode("101");
+ object.setState("Reykjavik");
+ object.setStreetName("Laugavegur");
+ object.setStreetNumber("1");
+ object.setTown("Reykjavik");
+
+ final JAXBContext context = JAXBContext.newInstance(CanonicalAddressType.class);
+ final Marshaller m = context.createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ final ObjectFactory objf = new ObjectFactory();
+
+ m.marshal(objf.createCanonicalResidenceAddress(object), new FileOutputStream("CanonicalAddressType.xml"));
+ m.marshal(objf.createCanonicalResidenceAddress(object), System.out);
+ }
+ catch (JAXBException | FileNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Test unmarshalling canonical address
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <canonicalResidenceAddress xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <countryCodeAddress>IS</countryCodeAddress>
+ * <state>Reykjavik</state>
+ * <municipalityCode>RVK</municipalityCode>
+ * <town>Reykjavik</town>
+ * <postalCode>101</postalCode>
+ * <streetName>Laugavegur</streetName>
+ * <streetNumber>1</streetNumber>
+ * <apartmentNumber>10</apartmentNumber>
+ * </canonicalResidenceAddress>
+ */
+ @Test
+ public void testUnmarshallCanonicalAddress()
+ {
+ JAXBContext uContext;
+ try
+ {
+ uContext = JAXBContext.newInstance(CanonicalAddressType.class);
+ final Unmarshaller u = uContext.createUnmarshaller();
+ final File file = new File("CanonicalAddressType.xml");
+
+ final JAXBElement<CanonicalAddressType> root = u.unmarshal(new StreamSource(file), CanonicalAddressType.class);
+ final CanonicalAddressType foo = root.getValue();
+
+ final String A = foo.getStreetName();
+ final String B = foo.getStreetNumber();
+
+ System.out.println("Streetname: " + A);
+ System.out.println("Streetnumber: " + B);
+
+ }
+ catch (final JAXBException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Test marshalling has bank account
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <hasAccountInBank xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <bankName>Arion</bankName>
+ * <AQAA>3</AQAA>
+ * </hasAccountInBank>
+ */
+ @Test
+ public void testMarshallHasBankAccount()
+ {
+ try
+ {
+ final HasAccountInBankType object = new HasAccountInBankType();
+ object.setAQAA(3);
+ object.setBankName("Arion Bank");
+ final JAXBContext context = JAXBContext.newInstance(HasAccountInBankType.class);
+ final Marshaller m = context.createMarshaller();
+ final ObjectFactory o = new ObjectFactory();
+ m.marshal(o.createHasAccountInBank(object), new FileOutputStream ("hasbankaccount.xml"));
+ m.marshal(o.createHasAccountInBank(object), System.out);
+
+ } catch (JAXBException | FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * Test unmarshalling has bank account
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <hasAccountInBank xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <bankName>Arion</bankName>
+ * <AQAA>3</AQAA>
+ * </hasAccountInBank>
+ */
+ @Test
+ public void testUnmarshallHasBankAccount()
+ {
+ try
+ {
+ final JAXBContext context = JAXBContext.newInstance(HasAccountInBankType.class);
+ final Unmarshaller um = context.createUnmarshaller();
+ final File file = new File("hasbankaccount.xml");
+ final JAXBElement<HasAccountInBankType> root = um.unmarshal(new StreamSource(file), HasAccountInBankType.class);
+ final HasAccountInBankType foo = root.getValue();
+ System.out.println(foo.getBankName());
+ } catch (final JAXBException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base
new file mode 100644
index 000000000..5d2296997
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/DateUtilTestCase.java.svn-base
@@ -0,0 +1,294 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.sql.Timestamp;
+import java.util.Properties;
+
+import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.DateUtil;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class DateUtilTestCase {
+
+ /**
+ * Stork Format date.
+ */
+ private static final String FORMAT = "yyyyMMdd";
+
+ /**
+ * Expected 10 value.
+ */
+ private static final int TEN = 10;
+
+ /**
+ * Expected 11 value.
+ */
+ private static final int ELEVEN = 11;
+
+ /**
+ * The testing Date ("current" date).
+ */
+ private static final DateTime TESTDATE = new DateTime(2011, 10, 10, 15, 20,
+ 0, 0);
+
+ /**
+ * Init DateUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Properties configs = new Properties();
+ configs.setProperty("invalidAgeDateValue.code", "35");
+ configs.setProperty("invalidAttributeValue.code", "34");
+ configs
+ .setProperty(
+ "invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ PEPSUtil.createInstance(configs);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year against
+ * the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromYear() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("2000", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyMonth() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("200001", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromSameMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200010", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyFullDate() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20000101", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromSameDay() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20001010", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterFullDate() {
+ Assert.assertTrue(TEN == DateUtil
+ .calculateAge("20001011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDate() {
+ DateUtil.calculateAge("200", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidMonth() {
+ DateUtil.calculateAge("200013", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDay() {
+ DateUtil.calculateAge("20000230", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullDate() {
+ DateUtil.calculateAge(null, TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullCurDate() {
+ DateUtil.calculateAge("2000", null, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullFormat() {
+ DateUtil.calculateAge("2000", TESTDATE, null);
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return true
+ */
+ @Test
+ public void isValidFormatDateFromYear() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("2000", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year and
+ * month. Must return true.
+ */
+ @Test
+ public void isValidFormatDateFromMonth() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("200001", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDate() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("20000101", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidYear() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidMonth() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200013", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("20010229", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate(null, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullFormat() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("2000", null));
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampBefore() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertNotSame(ts, DateUtil.currentTimeStamp());
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampAfter() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertEquals(DateUtil.currentTimeStamp(), ts);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base
new file mode 100644
index 000000000..d4841ed43
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PEPSUtilTestCase.java.svn-base
@@ -0,0 +1,553 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSErrors;
+import eu.stork.peps.auth.commons.PEPSParameters;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * The PEPSUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class PEPSUtilTestCase {
+
+ /**
+ * Message example.
+ */
+ private static final String MESSAGE_SAMPLE = "003002 - Authentication Failed";
+
+ /**
+ * Error message example.
+ */
+ private static final String ERROR_MESSAGE_SAMPLE = "Authentication Failed";
+
+ /**
+ * Error code example.
+ */
+ private static final String ERROR_CODE_SAMPLE = "003002";
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS1 = new Properties();
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS2 = new Properties();
+
+ /**
+ * The empty string value: "".
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * The empty byte value: [].
+ */
+ private static final byte[] EMPTY_BYTE = new byte[] {};
+
+ /**
+ * The empty byte hash value.
+ */
+ private static final byte[] EMPTY_HASH_BYTE = new byte[] { -49, -125, -31,
+ 53, 126, -17, -72, -67, -15, 84, 40, 80, -42, 109, -128, 7, -42, 32, -28,
+ 5, 11, 87, 21, -36, -125, -12, -87, 33, -45, 108, -23, -50, 71, -48, -47,
+ 60, 93, -123, -14, -80, -1, -125, 24, -46, -121, 126, -20, 47, 99, -71, 49,
+ -67, 71, 65, 122, -127, -91, 56, 50, 122, -7, 39, -38, 62 };
+
+ /**
+ * The SAML example byte[] value.
+ */
+ private static final byte[] SAML_BYTE_SAMPLE = new byte[] { 60, 115, 97, 109,
+ 108, 62, 46, 46, 46, 60, 47, 115, 97, 109, 108 };
+
+ /**
+ * The SAML's Base64 example value.
+ */
+ private static final String SAML_BASE64_SAMPLE = "PHNhbWw+Li4uPC9zYW1s";
+
+ /**
+ * The SAML's Base64 byte[] example value.
+ */
+ private static byte[] SAML_BASE64_BYTE_SAMPLE = new byte[] { 80, 72, 78, 104,
+ 98, 87, 119, 43, 76, 105, 52, 117, 80, 67, 57, 122, 89, 87, 49, 115 };
+
+ /**
+ * The SAML's Base64 Hash byte[] example value.
+ */
+ private static byte[] HASH_BYTE_SAMPLE = new byte[] { 67, 38, 11, 115, 49,
+ -5, 54, -85, 38, 43, -99, 96, 71, -41, 50, -96, 71, -86, 90, -97, 66, -67,
+ 90, 101, 30, 82, -13, 60, -106, -72, -103, -75, 19, 2, -107, 107, -6, -56,
+ 34, -111, -44, -57, -26, -5, 33, 78, -1, 30, 21, 74, -26, 118, -46, -12,
+ -102, 12, -56, 30, -59, -104, -21, -42, -103, 82 };
+
+ /**
+ * Init PEPSUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+
+ CONFIGS1.setProperty("max.attrList.size", "20000");
+ CONFIGS1.setProperty("attrList.code", "202005");
+ CONFIGS1.setProperty("attrList.message", "invalid.attrList.parameter");
+
+ CONFIGS1.setProperty("max.qaaLevel.size", "1");
+ CONFIGS1.setProperty("max.spUrl.size", "inv");
+ CONFIGS1.setProperty("validation.active", "true");
+ CONFIGS1.setProperty("hashDigest.className",
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ CONFIGS1.setProperty("invalidAgeDateValue.code", "35");
+ CONFIGS1.setProperty("invalidAttributeValue.code", "34");
+ CONFIGS1.setProperty("invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#createInstance(Properties)} method for the given
+ * properties object.
+ */
+ @Test
+ public void testCreateInstance() {
+ Assert.assertNotNull(PEPSUtil.createInstance(CONFIGS2));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigs() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertEquals(pepsUtils.getConfigs(), CONFIGS1);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigsDifferent() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertNotSame(pepsUtils.getConfigs(), CONFIGS2);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given existing
+ * config.
+ */
+ @Test
+ public void testGetConfigExists() {
+ assertEquals(PEPSUtil.getConfig("hashDigest.className"),
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given not
+ * existing config.
+ */
+ @Test
+ public void testGetConfigNoExists() {
+ assertNull(PEPSUtil.getConfig("doesnt.exists"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given null
+ * value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testGetConfigNull() {
+ assertNull(PEPSUtil.getConfig(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExists() {
+ assertTrue(PEPSUtil.isValidParameter("qaaLevel", "1"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsGreat() {
+ assertFalse(PEPSUtil.isValidParameter("qaaLevel", "12"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsIvalidConf() {
+ assertFalse(PEPSUtil
+ .isValidParameter("spUrl", "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNotExists() {
+ assertFalse(PEPSUtil.isValidParameter("doesntexists",
+ "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamName() {
+ assertFalse(PEPSUtil.isValidParameter(null, "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamValue() {
+ assertFalse(PEPSUtil.isValidParameter("spUrl", null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given object values.
+ */
+ @Test
+ public void testValidateParameterValid() {
+ final IPersonalAttributeList persAttrList = new PersonalAttributeList();
+ persAttrList.populate("isAgeOver:true:[15,]:Available;");
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), persAttrList);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNull() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), null);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, String)} method
+ * for the given string values.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameter() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, PEPSErrors)}
+ * method for the given string value and {@link PEPSErrors} enum.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameterPEPSErrors() {
+ PEPSUtil.validateParameter("CountrySelectorAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;",
+ PEPSErrors.SP_COUNTRY_SELECTOR_INVALID_ATTR);
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test
+ public void testValidateParameterValidParams() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "10",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "doesnt.exists", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", null, "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", null,
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * string value.
+ */
+ @Test
+ public void testEncodeSAMLToken() {
+ assertEquals(PEPSUtil.encodeSAMLToken(SAML_BYTE_SAMPLE), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * null.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testEncodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.encodeSAMLToken(null), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * empty byte[] value.
+ */
+ @Test
+ public void testEncodeSAMLTokenEmpty() {
+ assertEquals(PEPSUtil.encodeSAMLToken(EMPTY_BYTE), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testDecodeSAMLToken() {
+ assertArrayEquals(PEPSUtil.decodeSAMLToken(SAML_BASE64_SAMPLE),
+ SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testDecodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.decodeSAMLToken(null), SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * empty string value.
+ */
+ @Test(expected = StringIndexOutOfBoundsException.class)
+ public void testDecodeSAMLTokenEmpty() {
+ assertTrue(PEPSUtil.decodeSAMLToken(EMPTY_STRING) == EMPTY_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testHashPersonalToken() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(SAML_BASE64_BYTE_SAMPLE),
+ HASH_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = InternalErrorPEPSException.class)
+ public void testHashPersonalTokenNull() {
+ assertNull(PEPSUtil.hashPersonalToken(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * empty value.
+ */
+ @Test
+ public void testHashPersonalTokenEmpty() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(EMPTY_BYTE), EMPTY_HASH_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * correct message.
+ */
+ @Test
+ public void testGetStorkErrorCodeExists() {
+ assertEquals(PEPSUtil.getStorkErrorCode(MESSAGE_SAMPLE), ERROR_CODE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNoExists() {
+ assertNull(PEPSUtil.getStorkErrorCode(ERROR_MESSAGE_SAMPLE));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * empty message.
+ */
+ @Test
+ public void testGetStorkErrorCodeEmpty() {
+ assertNull(PEPSUtil.getStorkErrorCode(EMPTY_STRING));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * null message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNull() {
+ assertNull(PEPSUtil.getStorkErrorCode(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("-"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepAndCodeFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("000001 -"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given correct message.
+ */
+ @Test
+ public void testGetStorkErrorMessageExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNoExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(ERROR_MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given empty message.
+ */
+ @Test
+ public void testGetStorkErrorMessageEmpty() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(EMPTY_STRING),
+ EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given null message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNull() {
+ assertNull(PEPSUtil.getStorkErrorMessage(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("-"),"-");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepAndCodeFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("000001 -"),"000001 -");
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base
new file mode 100644
index 000000000..7052b320a
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeListTestCase.java.svn-base
@@ -0,0 +1,747 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttributeList's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-11-17 05:17:02 $
+ */
+public final class PersonalAttributeListTestCase {
+
+ /**
+ * isAgeOver constant value.
+ */
+ private static final String ISAGEOVER_CONS = "isAgeOver";
+
+ /**
+ * 1 constant value.
+ */
+ private static final int ONE_CONS = 1;
+
+ /**
+ * 2 constant value.
+ */
+ private static final int TWO_CONS = 2;
+
+ /**
+ * An empty attribute.
+ */
+ @SuppressWarnings("unused")
+ private static final PersonalAttributeList EMPTY_ATTR_LIST =
+ new PersonalAttributeList(0);
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST =
+ "isAgeOver:true:[15,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST2 =
+ "isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3 =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3_REVERSE =
+ "isAgeOver:true:[18,]:Available;isAgeOver:true:[15,]:Available;";
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String COMPLEX_ATTRLIST =
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=Ed. B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;";
+ /**
+ * Mix attribute list string.
+ */
+ private static final String STR_MIX_ATTR_LIST =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:"
+ + "Available;";
+
+ /**
+ * Mix attribute list 2 string.
+ */
+ private static final String STR_MIX_ATTR_LIST2 =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:Available;"
+ + "mandateContent:true:["
+ + "isJoint=\"isjoint\",typeOfPower=\"power\",ValidTo=\"validto\",validfrom=\"validfrom\",AQAA=\"3\",isChained=\"ischained\",]:"
+ + "Available;";
+
+ /**
+ * Attribute List example.
+ */
+ @SuppressWarnings({ "serial" })
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeListTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "Ed. B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testAddSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testAddCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testAddNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Simple Value.
+ */
+ @Test
+ public void testPutSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Complex Value.
+ */
+ @Test
+ public void testPutComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testPutNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put("", null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testGetSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertEquals(ATTR_VALUE, attrList.get(ATTR_VALUE.getName()));
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testGetCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertEquals(complexAttrValue.toString(),
+ attrList.get(complexAttrValue.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testGetIsAgeOverAttr() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST,
+ attrList.get(attrValueUnder.getName()).toString());
+ Assert.assertEquals(SIMPLE_ATTRLIST2,
+ attrList.get(attrValueOver.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple attribute.
+ */
+ @Test
+ public void testPopulateSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Complex attribute.
+ */
+ @Test
+ public void testPopulateComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple and Complex attribute.
+ */
+ @Test
+ public void testPopulateMixAttrs() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using put.
+ *
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromSimplePopulate() {
+ final String strAttrList = "isAgeOver:true";
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(strAttrList);
+ Assert.assertEquals("isAgeOver:true:[]:;", attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromPopulate() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST3);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid values.
+ */
+ @Test
+ public void testPopulateWithInvalidValuesFormat() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type:values:status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid format.
+ */
+ @Test
+ public void testPopulateWithInvalidFormat() {
+
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type::status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using put.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using populate.
+ */
+ @Test
+ public void testCloneFromPopulate() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertNotSame(pal, pal.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List iterator.
+ */
+ @Test
+ public void testIterator() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ final Iterator<PersonalAttribute> itAttr = pal.iterator();
+ while (itAttr.hasNext()) {
+ final PersonalAttribute attr = itAttr.next();
+ Assert.assertEquals(ISAGEOVER_CONS, attr.getName());
+ }
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetOptionalAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method without optional attributes.
+ */
+ @Test
+ public void testGetOptionalAttributesWithoutOptional() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with one optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOneOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:true:[15,]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with two optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOnlyOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method without mandatory attributes.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithoutMandatory() {
+ final String strAttrList =
+ "isAgeOver:false:[15,]:Available;isAgeOver:false:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with one mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOneMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:false:[15,]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOnlyMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method without simple attributes.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method with one simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOneSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOnlySimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetComplexAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method without complex attributes.
+ */
+ @Test
+ public void testGetComplexAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST2);
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method with one complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOneComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getComplexAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with only two Complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOnlyComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST2);
+ Assert.assertTrue(pal.getComplexAttributes().size() == TWO_CONS);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base
new file mode 100644
index 000000000..458d510e0
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/PersonalAttributeTestCase.java.svn-base
@@ -0,0 +1,182 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class PersonalAttributeTestCase {
+
+ /**
+ * An empty attribute.
+ */
+ private static final PersonalAttribute EMPTYATTR = new PersonalAttribute();
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * An attribute with a simple value (age).
+ */
+ @SuppressWarnings("serial")
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given simple
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringValues() {
+ Assert.assertEquals("age:true:[15,]:Available;", ATTR_VALUE.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given complex
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringComplexValues() {
+ Assert.assertEquals(
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;",
+ complexAttrValue.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithNull() {
+ Assert.assertTrue(EMPTYATTR.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * new attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithEmptyString() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setStatus("");
+ Assert.assertTrue(attr.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setValue(null);
+ Assert.assertTrue(attr.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setComplexValue(null);
+ Assert.assertTrue(attr.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithEmptyComplexValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToComplexValue() {
+ Assert.assertNotSame(complexAttrValue, complexAttrValue.clone());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToValue() {
+ Assert.assertNotSame(ATTR_VALUE, ATTR_VALUE.clone());
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base
new file mode 100644
index 000000000..452602210
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/.svn/text-base/package-info.java.svn-base
@@ -0,0 +1,5 @@
+/**
+ * This package provides all JUnit test classes.
+ */
+package eu.stork.peps.tests;
+
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
new file mode 100644
index 000000000..89f5adbed
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeProvidersMapTestCase.java
@@ -0,0 +1,134 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeProvidersMap;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+import eu.stork.peps.auth.commons.IAttributeProvidersMap;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public class AttributeProvidersMapTestCase {
+
+ @Test
+ public void testObjectOK1() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK2() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(source) ) {
+ if ( map.get(source)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK3() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectOK4() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ if ( map.get(target)!=null ) {
+ outcome = true;
+ }
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public void testObjectNOK1() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new Country("ID1", "Name 1"), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+
+ @Test
+ public void testObjectNOK2() {
+ final IAttributeProvidersMap map = new AttributeProvidersMap();
+ final AttributeSource source = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL");
+ final AttributeSource target = new AttributeSource(new AttributeProvider("ID2", "Name 1", null), "URL");
+ final IPersonalAttributeList pal = new PersonalAttributeList();
+ boolean outcome = false;
+
+ //Add a single item
+ map.put(source, pal);
+
+ if ( map.containsKey(target) ) {
+ outcome = true;
+ }
+
+ assertFalse(outcome);
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
new file mode 100644
index 000000000..e0f685ade
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeSourceTestCase.java
@@ -0,0 +1,88 @@
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeProvider;
+import eu.stork.peps.auth.commons.AttributeSource;
+import eu.stork.peps.auth.commons.Country;
+
+/**
+ * The AttributeSource's Test Case.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeSourceTestCase {
+ private final AttributeSource ap1 = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL1");
+ private final AttributeSource ap2 = new AttributeSource(new AttributeProvider("ID2", "Name 2", null), "URL2");
+ private final AttributeSource ap3 = new AttributeSource(new AttributeProvider("ID1", "Name 2", null), "URL2");
+ private final AttributeSource ap4 = new AttributeSource(new AttributeProvider("ID1", "Name 2", null), "URL1");
+ private final AttributeSource ap5 = new AttributeSource(new AttributeProvider("ID1", "Name 1", null), "URL1");
+
+ private final AttributeSource c1 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+ private final AttributeSource c2 = new AttributeSource(new Country("ID2", "Name 2"), "URL2");
+ private final AttributeSource c3 = new AttributeSource(new Country("ID1", "Name 2"), "URL2");
+ private final AttributeSource c4 = new AttributeSource(new Country("ID1", "Name 2"), "URL1");
+ private final AttributeSource c5 = new AttributeSource(new Country("ID1", "Name 1"), "URL1");
+
+ @Test
+ public void testNotEquals1() {
+ assertFalse(ap1.equals(ap2));
+ }
+
+ @Test
+ public void testNotEquals2() {
+ assertFalse(ap1.equals(c1));
+ }
+
+ @Test
+ public void testNotEquals3() {
+ assertFalse(c1.equals(c2));
+ }
+
+ @Test
+ public void testEquals1() {
+ assertTrue(ap1.equals(ap3));
+ }
+
+ @Test
+ public void testEquals2() {
+ assertTrue(ap1.equals(ap4));
+ }
+
+ @Test
+ public void testEquals3() {
+ assertTrue(ap1.equals(ap5));
+ }
+
+ @Test
+ public void testEquals4() {
+ assertTrue(c1.equals(c3));
+ }
+
+ @Test
+ public void testEquals5() {
+ assertTrue(c1.equals(c4));
+ }
+
+ @Test
+ public void testEquals6() {
+ assertTrue(c1.equals(c5));
+ }
+
+ @Test
+ public void testEquals7() {
+ final Object obj = ap5;
+ assertTrue(ap1.equals(obj));
+ }
+
+ @Test
+ public void testEquals8() {
+ final Object obj = c5;
+ assertTrue(c1.equals(obj));
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
new file mode 100644
index 000000000..77fc4b9c2
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/AttributeUtilTestCase.java
@@ -0,0 +1,537 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.AttributeUtil;
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSValues;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+
+/**
+ * The AttributeUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class AttributeUtilTestCase {
+
+ /**
+ * Empty String to be used on the tests.
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * Tuple value sample to be used on the tests.
+ */
+ private static final String[] TUPLE_STRING = new String[] { "age", "true",
+ "[18]", "Available" };
+
+ /**
+ * Complex value to be used on escape/unescape tests.
+ */
+ private static final String COMPLEX_VAL = "postalCode=4100,"
+ + "apartmentNumber=A,state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,";
+
+ /**
+ * Escaped Complex value to be used on escape/unescape tests.
+ */
+ private static final String ESC_COMPLEX_VAL = "postalCode=4100%44"
+ + "apartmentNumber=A%44state=Porto%44countryCodeAddress=PT%44"
+ + "streetNumber=379%44streetName=Avenida Sidonio Pais%44town=Porto%44";
+
+ /**
+ * Simple value to be used on escape/unescape tests.
+ */
+ private static final String SIMPLE_VAL = "Avenida da Boavista, Porto";
+
+ /**
+ * Escaped simple value to be used on escape/unescape tests.
+ */
+ private static final String ESC_SIMPLE_VAL = "Avenida da Boavista%44 Porto";
+
+ /**
+ * Simple text to be used on escape/unescape tests. Must match the escaped
+ * text.
+ */
+ private static final String SIMPLE_TEXT = "John Doe";
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given complex
+ * attribute value (canonical address' example attribute value).
+ */
+ @Test
+ public void testEscapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.escape(COMPLEX_VAL), ESC_COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given
+ * attribute value.
+ */
+ @Test
+ public void testEscapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.escape(SIMPLE_VAL), ESC_SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to escape.
+ */
+ @Test
+ public void testEscapeNormalChars() {
+ assertEquals(AttributeUtil.escape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#unescape(String)} method for the given
+ * escape complex attribute value (canonical address' example attribute
+ * value).
+ */
+ @Test
+ public void testUnescapeSpecialCharsComplexVal() {
+ assertEquals(AttributeUtil.unescape(ESC_COMPLEX_VAL), COMPLEX_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given escape
+ * attribute value.
+ */
+ @Test
+ public void testUnescapeSpecialCharsVal() {
+ assertEquals(AttributeUtil.unescape(ESC_SIMPLE_VAL), SIMPLE_VAL);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#escape(String)} method for the given simple
+ * text: no special characters to unescape.
+ */
+ @Test
+ public void testUnescapeNormalChars() {
+ assertEquals(AttributeUtil.unescape(SIMPLE_TEXT), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given empty string.
+ */
+ @Test
+ public void testAppendIfNotNullEmptyStr() {
+ final StringBuilder strBuilder = new StringBuilder(SIMPLE_TEXT);
+ AttributeUtil.appendIfNotNull(strBuilder, EMPTY_STRING);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given string.
+ */
+ @Test
+ public void testAppendIfNotNullStr() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, SIMPLE_TEXT);
+ assertEquals(strBuilder.toString(), SIMPLE_TEXT);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#appendIfNotNull(StringBuilder, Object)}
+ * method for the given null value.
+ */
+ @Test
+ public void testAppendIfNotNull() {
+ final StringBuilder strBuilder = new StringBuilder();
+ AttributeUtil.appendIfNotNull(strBuilder, null);
+ assertEquals(strBuilder.toString(), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with two values.
+ */
+ @Test
+ public void testListToStringTwoVals() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+ vals.add(SIMPLE_TEXT);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one values.
+ */
+ @Test
+ public void testListToStringOneVal() {
+ final List<String> vals = new ArrayList<String>();
+ vals.add(SIMPLE_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#listToString(List, String)} method for the
+ * given List with one value.
+ */
+ @Test
+ public void testListToStringEmptyVal() {
+ final List<String> vals = new ArrayList<String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(
+ AttributeUtil.listToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given Map with one value.
+ */
+ @Test
+ public void testMapToStringOneVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+ vals.put("CanonicalAddress", COMPLEX_VAL);
+
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("CanonicalAddress=");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#mapToString(java.util.Map, String)} method
+ * for the given empty Map.
+ */
+ @Test
+ public void testMapToStringEmptyVal() {
+ final Map<String, String> vals = new HashMap<String, String>();
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ assertEquals(AttributeUtil.mapToString(vals,
+ PEPSValues.ATTRIBUTE_VALUE_SEP.toString()), strBuilder.toString());
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid List.
+ */
+ @Test
+ public void testIsValidValueInvalidList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * null value.
+ */
+ @Test
+ public void testIsValidValueNullList() {
+ assertFalse(AttributeUtil.isValidValue(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyList() {
+ assertTrue(AttributeUtil.isValidValue("[]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * empty List.
+ */
+ @Test
+ public void testIsValidValueEmptyCommaList() {
+ assertTrue(AttributeUtil.isValidValue("[,]"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one simple value List.
+ */
+ @Test
+ public void testIsValidValueOneValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * one complex value List.
+ */
+ @Test
+ public void testIsValidValueOneComplexValueCommaList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_COMPLEX_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * multi value List.
+ */
+ @Test
+ public void testIsValidValueMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append("[");
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertTrue(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidValue(String)} method for the given
+ * invalid multi value List.
+ */
+ @Test
+ public void testIsValidValueInvalidMultiValueList() {
+ final StringBuilder strBuilder = new StringBuilder();
+ strBuilder.append(ESC_SIMPLE_VAL);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append(SIMPLE_TEXT);
+ strBuilder.append(PEPSValues.ATTRIBUTE_VALUE_SEP.toString());
+ strBuilder.append("]");
+ assertFalse(AttributeUtil.isValidValue(strBuilder.toString()));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * true type.
+ */
+ @Test
+ public void testIsValidTypetrue() {
+ assertTrue(AttributeUtil.isValidType("true"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * True type.
+ */
+ @Test
+ public void testIsValidTypeTrue() {
+ assertTrue(AttributeUtil.isValidType("True"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * TRUE type.
+ */
+ @Test
+ public void testIsValidTypeTRUE() {
+ assertTrue(AttributeUtil.isValidType("TRUE"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * invalid type.
+ */
+ @Test
+ public void testIsValidTypeInvalidType() {
+ assertFalse(AttributeUtil.isValidType("str"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * false type.
+ */
+ @Test
+ public void testIsValidTypefalse() {
+ assertTrue(AttributeUtil.isValidType("false"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * False type.
+ */
+ @Test
+ public void testIsValidTypeFalse() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * FALSE type.
+ */
+ @Test
+ public void testIsValidTypeFALSEVal() {
+ assertTrue(AttributeUtil.isValidType("False"));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#isValidType(String)} method for the given
+ * null.
+ */
+ @Test
+ public void testIsValidTypeNullVal() {
+ assertFalse(AttributeUtil.isValidType(null));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given valid tuple.
+ */
+ @Test
+ public void testHasValidTuples() {
+ assertTrue(AttributeUtil.hasValidTuples(TUPLE_STRING));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple.
+ */
+ @Test
+ public void testHasValidTuplesInvalid() {
+ final String[] tuple = new String[]{"name", "type"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given invalid tuple with valid size.
+ */
+ @Test
+ public void testHasValidTuplesSameSizeInvalidValues() {
+ final String[] tuple = new String[] { "age", "type", "[18]", "Available"};
+ assertFalse(AttributeUtil.hasValidTuples(tuple));
+ }
+
+ /**
+ * Tests the {@link AttributeUtil#hasValidTuples(String[])} method for the
+ * given null value.
+ */
+ @Test
+ public void testHasValidTuplesNull() {
+ assertFalse(AttributeUtil.hasValidTuples(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list..
+ */
+ @Test
+ public void testCheckMandatoryAttributes() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[18,]:Available;");
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testCheckMandatoryAttributesNullAttrList() {
+ assertTrue(AttributeUtil.checkMandatoryAttributes(null));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given empty attribute list.
+ */
+ @Test
+ public void testCheckMandatoryAttributesEmptyAttrList() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ assertTrue(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+ /**
+ * Tests the
+ * {@link AttributeUtil#checkMandatoryAttributes(IPersonalAttributeList)}
+ * method for the given attribute list (missing mandatory attribute).
+ */
+ @Test
+ public void testCheckMandatoryAttributesMissingAttr() {
+ final IPersonalAttributeList attrList = new PersonalAttributeList();
+ attrList.populate("isAgeOver:true:[]:NotAvailable;");
+ assertFalse(AttributeUtil.checkMandatoryAttributes(attrList));
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/ComplexAttributesMarshalling.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/ComplexAttributesMarshalling.java
new file mode 100644
index 000000000..c7e195fa6
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/ComplexAttributesMarshalling.java
@@ -0,0 +1,187 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * ---
+ *
+ * Test cases for marshalling complex attributes.
+ *
+ * Implemented are two testcases for marshalling and unmarshalling. These testcases are
+ * for canonical residenc address and has bank account.
+ */
+
+package eu.stork.peps.tests;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
+
+import org.junit.Test;
+
+import eu.stork.peps.complex.attributes.CanonicalAddressType;
+import eu.stork.peps.complex.attributes.HasAccountInBankType;
+import eu.stork.peps.complex.attributes.ObjectFactory;
+
+/**
+ * @author Advania
+ *
+ * Examples on how to use the jaxb marshaller.
+ *
+ * The classes are created from the StorkcomplexAttributes.xsd schema located in resources.
+ *
+ * @version $Revision: 1.00 $, $Date: 2014-17-02 11:15:00 $
+ *
+ */
+
+public class ComplexAttributesMarshalling {
+
+ /**
+ * Test marshalling canonical address
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <canonicalResidenceAddress xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <countryCodeAddress>IS</countryCodeAddress>
+ * <state>Reykjavik</state>
+ * <municipalityCode>RVK</municipalityCode>
+ * <town>Reykjavik</town>
+ * <postalCode>101</postalCode>
+ * <streetName>Laugavegur</streetName>
+ * <streetNumber>1</streetNumber>
+ * <apartmentNumber>10</apartmentNumber>
+ * </canonicalResidenceAddress>
+ */
+ @Test
+ public void testMarshallCanonicalResidencAddress()
+ {
+ try
+ {
+ final CanonicalAddressType object = new CanonicalAddressType();
+ object.setApartmentNumber("10");
+ object.setCountryCodeAddress("IS");
+ object.setMunicipalityCode("RVK");
+ object.setPostalCode("101");
+ object.setState("Reykjavik");
+ object.setStreetName("Laugavegur");
+ object.setStreetNumber("1");
+ object.setTown("Reykjavik");
+
+ final JAXBContext context = JAXBContext.newInstance(CanonicalAddressType.class);
+ final Marshaller m = context.createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ final ObjectFactory objf = new ObjectFactory();
+
+ m.marshal(objf.createCanonicalResidenceAddress(object), new FileOutputStream("CanonicalAddressType.xml"));
+ m.marshal(objf.createCanonicalResidenceAddress(object), System.out);
+ }
+ catch (JAXBException | FileNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Test unmarshalling canonical address
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <canonicalResidenceAddress xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <countryCodeAddress>IS</countryCodeAddress>
+ * <state>Reykjavik</state>
+ * <municipalityCode>RVK</municipalityCode>
+ * <town>Reykjavik</town>
+ * <postalCode>101</postalCode>
+ * <streetName>Laugavegur</streetName>
+ * <streetNumber>1</streetNumber>
+ * <apartmentNumber>10</apartmentNumber>
+ * </canonicalResidenceAddress>
+ */
+ @Test
+ public void testUnmarshallCanonicalAddress()
+ {
+ JAXBContext uContext;
+ try
+ {
+ uContext = JAXBContext.newInstance(CanonicalAddressType.class);
+ final Unmarshaller u = uContext.createUnmarshaller();
+ final File file = new File("CanonicalAddressType.xml");
+
+ final JAXBElement<CanonicalAddressType> root = u.unmarshal(new StreamSource(file), CanonicalAddressType.class);
+ final CanonicalAddressType foo = root.getValue();
+
+ final String A = foo.getStreetName();
+ final String B = foo.getStreetNumber();
+
+ System.out.println("Streetname: " + A);
+ System.out.println("Streetnumber: " + B);
+
+ }
+ catch (final JAXBException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Test marshalling has bank account
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <hasAccountInBank xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <bankName>Arion</bankName>
+ * <AQAA>3</AQAA>
+ * </hasAccountInBank>
+ */
+ @Test
+ public void testMarshallHasBankAccount()
+ {
+ try
+ {
+ final HasAccountInBankType object = new HasAccountInBankType();
+ object.setAQAA(3);
+ object.setBankName("Arion Bank");
+ final JAXBContext context = JAXBContext.newInstance(HasAccountInBankType.class);
+ final Marshaller m = context.createMarshaller();
+ final ObjectFactory o = new ObjectFactory();
+ m.marshal(o.createHasAccountInBank(object), new FileOutputStream ("hasbankaccount.xml"));
+ m.marshal(o.createHasAccountInBank(object), System.out);
+
+ } catch (JAXBException | FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * Test unmarshalling has bank account
+ * <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ * <hasAccountInBank xmlns="urn:eu:stork:names:tc:STORK:1.0:assertion">
+ * <bankName>Arion</bankName>
+ * <AQAA>3</AQAA>
+ * </hasAccountInBank>
+ */
+ @Test
+ public void testUnmarshallHasBankAccount()
+ {
+ try
+ {
+ final JAXBContext context = JAXBContext.newInstance(HasAccountInBankType.class);
+ final Unmarshaller um = context.createUnmarshaller();
+ final File file = new File("hasbankaccount.xml");
+ final JAXBElement<HasAccountInBankType> root = um.unmarshal(new StreamSource(file), HasAccountInBankType.class);
+ final HasAccountInBankType foo = root.getValue();
+ System.out.println(foo.getBankName());
+ } catch (final JAXBException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
new file mode 100644
index 000000000..5d2296997
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/DateUtilTestCase.java
@@ -0,0 +1,294 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.sql.Timestamp;
+import java.util.Properties;
+
+import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.DateUtil;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.exceptions.SecurityPEPSException;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.2 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class DateUtilTestCase {
+
+ /**
+ * Stork Format date.
+ */
+ private static final String FORMAT = "yyyyMMdd";
+
+ /**
+ * Expected 10 value.
+ */
+ private static final int TEN = 10;
+
+ /**
+ * Expected 11 value.
+ */
+ private static final int ELEVEN = 11;
+
+ /**
+ * The testing Date ("current" date).
+ */
+ private static final DateTime TESTDATE = new DateTime(2011, 10, 10, 15, 20,
+ 0, 0);
+
+ /**
+ * Init DateUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Properties configs = new Properties();
+ configs.setProperty("invalidAgeDateValue.code", "35");
+ configs.setProperty("invalidAttributeValue.code", "34");
+ configs
+ .setProperty(
+ "invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ PEPSUtil.createInstance(configs);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year against
+ * the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromYear() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("2000", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyMonth() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("200001", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromSameMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200010", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given year and month
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterMonth() {
+ Assert.assertTrue(TEN == DateUtil.calculateAge("200011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromEarlyFullDate() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20000101", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 11.
+ */
+ @Test
+ public void calculateAgeFromSameDay() {
+ Assert.assertTrue(ELEVEN == DateUtil.calculateAge("20001010", TESTDATE,
+ FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return 10.
+ */
+ @Test
+ public void calculateAgeFromLaterFullDate() {
+ Assert.assertTrue(TEN == DateUtil
+ .calculateAge("20001011", TESTDATE, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDate() {
+ DateUtil.calculateAge("200", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidMonth() {
+ DateUtil.calculateAge("200013", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromInvalidDay() {
+ DateUtil.calculateAge("20000230", TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullDate() {
+ DateUtil.calculateAge(null, TESTDATE, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullCurDate() {
+ DateUtil.calculateAge("2000", null, FORMAT);
+ }
+
+ /**
+ * Tests the {@link DateUtil#calculateAge} method for the given full date
+ * against the testDate: 2011-10-10 15:20:00.0. Must return a
+ * SecurityPEPSException exception.
+ */
+ @Test(expected = SecurityPEPSException.class)
+ public void calculateAgeFromNullFormat() {
+ DateUtil.calculateAge("2000", TESTDATE, null);
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return true
+ */
+ @Test
+ public void isValidFormatDateFromYear() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("2000", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year and
+ * month. Must return true.
+ */
+ @Test
+ public void isValidFormatDateFromMonth() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("200001", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDate() {
+ Assert.assertTrue(DateUtil.isValidFormatDate("20000101", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidYear() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidMonth() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("200013", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateInvalidDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("20010229", FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullDate() {
+ Assert.assertFalse(DateUtil.isValidFormatDate(null, FORMAT));
+ }
+
+ /**
+ * Tests the {@link DateUtil#isValidFormatDate} method for the given year.
+ * Must return false.
+ */
+ @Test
+ public void isValidFormatDateNullFormat() {
+ Assert.assertFalse(DateUtil.isValidFormatDate("2000", null));
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampBefore() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertNotSame(ts, DateUtil.currentTimeStamp());
+ }
+
+ /**
+ * Tests the {@link DateUtil#currentTimeStamp()} method for the current
+ * TimeStamp (TS). Must return true.
+ */
+ @Test
+ public void testCurrentTimeStampAfter() {
+ Timestamp ts = DateUtil.currentTimeStamp();
+ Assert.assertEquals(DateUtil.currentTimeStamp(), ts);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
new file mode 100644
index 000000000..d4841ed43
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PEPSUtilTestCase.java
@@ -0,0 +1,553 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Properties;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSErrors;
+import eu.stork.peps.auth.commons.PEPSParameters;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.exceptions.InternalErrorPEPSException;
+import eu.stork.peps.auth.commons.exceptions.InvalidParameterPEPSException;
+
+/**
+ * The PEPSUtil's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com
+ *
+ * @version $Revision: $, $Date: $
+ */
+public final class PEPSUtilTestCase {
+
+ /**
+ * Message example.
+ */
+ private static final String MESSAGE_SAMPLE = "003002 - Authentication Failed";
+
+ /**
+ * Error message example.
+ */
+ private static final String ERROR_MESSAGE_SAMPLE = "Authentication Failed";
+
+ /**
+ * Error code example.
+ */
+ private static final String ERROR_CODE_SAMPLE = "003002";
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS1 = new Properties();
+
+ /**
+ * Properties values for testing proposes.
+ */
+ private static final Properties CONFIGS2 = new Properties();
+
+ /**
+ * The empty string value: "".
+ */
+ private static final String EMPTY_STRING = "";
+
+ /**
+ * The empty byte value: [].
+ */
+ private static final byte[] EMPTY_BYTE = new byte[] {};
+
+ /**
+ * The empty byte hash value.
+ */
+ private static final byte[] EMPTY_HASH_BYTE = new byte[] { -49, -125, -31,
+ 53, 126, -17, -72, -67, -15, 84, 40, 80, -42, 109, -128, 7, -42, 32, -28,
+ 5, 11, 87, 21, -36, -125, -12, -87, 33, -45, 108, -23, -50, 71, -48, -47,
+ 60, 93, -123, -14, -80, -1, -125, 24, -46, -121, 126, -20, 47, 99, -71, 49,
+ -67, 71, 65, 122, -127, -91, 56, 50, 122, -7, 39, -38, 62 };
+
+ /**
+ * The SAML example byte[] value.
+ */
+ private static final byte[] SAML_BYTE_SAMPLE = new byte[] { 60, 115, 97, 109,
+ 108, 62, 46, 46, 46, 60, 47, 115, 97, 109, 108 };
+
+ /**
+ * The SAML's Base64 example value.
+ */
+ private static final String SAML_BASE64_SAMPLE = "PHNhbWw+Li4uPC9zYW1s";
+
+ /**
+ * The SAML's Base64 byte[] example value.
+ */
+ private static byte[] SAML_BASE64_BYTE_SAMPLE = new byte[] { 80, 72, 78, 104,
+ 98, 87, 119, 43, 76, 105, 52, 117, 80, 67, 57, 122, 89, 87, 49, 115 };
+
+ /**
+ * The SAML's Base64 Hash byte[] example value.
+ */
+ private static byte[] HASH_BYTE_SAMPLE = new byte[] { 67, 38, 11, 115, 49,
+ -5, 54, -85, 38, 43, -99, 96, 71, -41, 50, -96, 71, -86, 90, -97, 66, -67,
+ 90, 101, 30, 82, -13, 60, -106, -72, -103, -75, 19, 2, -107, 107, -6, -56,
+ 34, -111, -44, -57, -26, -5, 33, 78, -1, 30, 21, 74, -26, 118, -46, -12,
+ -102, 12, -56, 30, -59, -104, -21, -42, -103, 82 };
+
+ /**
+ * Init PEPSUtilTestCase class.
+ */
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+
+ CONFIGS1.setProperty("max.attrList.size", "20000");
+ CONFIGS1.setProperty("attrList.code", "202005");
+ CONFIGS1.setProperty("attrList.message", "invalid.attrList.parameter");
+
+ CONFIGS1.setProperty("max.qaaLevel.size", "1");
+ CONFIGS1.setProperty("max.spUrl.size", "inv");
+ CONFIGS1.setProperty("validation.active", "true");
+ CONFIGS1.setProperty("hashDigest.className",
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ CONFIGS1.setProperty("invalidAgeDateValue.code", "35");
+ CONFIGS1.setProperty("invalidAttributeValue.code", "34");
+ CONFIGS1.setProperty("invalidAttributeValue.message",
+ "Unexpected or invalid content was encountered within a "
+ + "<saml:Attribute> or <saml:AttributeValue> element.");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#createInstance(Properties)} method for the given
+ * properties object.
+ */
+ @Test
+ public void testCreateInstance() {
+ Assert.assertNotNull(PEPSUtil.createInstance(CONFIGS2));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigs() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertEquals(pepsUtils.getConfigs(), CONFIGS1);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfigs()}.
+ */
+ @Test
+ public void testGetConfigsDifferent() {
+ final PEPSUtil pepsUtils = PEPSUtil.createInstance(CONFIGS1);
+ assertNotSame(pepsUtils.getConfigs(), CONFIGS2);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given existing
+ * config.
+ */
+ @Test
+ public void testGetConfigExists() {
+ assertEquals(PEPSUtil.getConfig("hashDigest.className"),
+ "org.bouncycastle.crypto.digests.SHA512Digest");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given not
+ * existing config.
+ */
+ @Test
+ public void testGetConfigNoExists() {
+ assertNull(PEPSUtil.getConfig("doesnt.exists"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getConfig(String)} method for the given null
+ * value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testGetConfigNull() {
+ assertNull(PEPSUtil.getConfig(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExists() {
+ assertTrue(PEPSUtil.isValidParameter("qaaLevel", "1"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsGreat() {
+ assertFalse(PEPSUtil.isValidParameter("qaaLevel", "12"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterExistsIvalidConf() {
+ assertFalse(PEPSUtil
+ .isValidParameter("spUrl", "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNotExists() {
+ assertFalse(PEPSUtil.isValidParameter("doesntexists",
+ "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamName() {
+ assertFalse(PEPSUtil.isValidParameter(null, "http://localhost:8080/SP/"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#isValidParameter(String, String)} method for the
+ * given param values.
+ */
+ @Test
+ public void testIsValidParameterNullParamValue() {
+ assertFalse(PEPSUtil.isValidParameter("spUrl", null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given object values.
+ */
+ @Test
+ public void testValidateParameterValid() {
+ final IPersonalAttributeList persAttrList = new PersonalAttributeList();
+ persAttrList.populate("isAgeOver:true:[15,]:Available;");
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), persAttrList);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, Object)} method
+ * for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNull() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(), null);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#validateParameter(String, String, String)} method
+ * for the given string values.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameter() {
+ PEPSUtil.validateParameter("ServiceProviderAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, PEPSErrors)}
+ * method for the given string value and {@link PEPSErrors} enum.
+ *
+ * The tested class just invokes
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * so further tests will be later.
+ */
+ @Test
+ public void testValidateParameterPEPSErrors() {
+ PEPSUtil.validateParameter("CountrySelectorAction",
+ PEPSParameters.ATTRIBUTE_LIST.toString(),
+ "isAgeOver:true:[15,]:Available;",
+ PEPSErrors.SP_COUNTRY_SELECTOR_INVALID_ATTR);
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test
+ public void testValidateParameterValidParams() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", "10",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterInvalidParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "doesnt.exists", "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamName() {
+ PEPSUtil.validateParameter("ServiceProviderAction", null, "1",
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the
+ * {@link PEPSUtil#validateParameter(String, String, String, String, String)}
+ * method for the given string values.
+ */
+ @Test(expected = InvalidParameterPEPSException.class)
+ public void testValidateParameterNullParamValue() {
+ PEPSUtil.validateParameter("ServiceProviderAction", "qaaLevel", null,
+ "qaaLevel.code", "qaaLevel.message");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * string value.
+ */
+ @Test
+ public void testEncodeSAMLToken() {
+ assertEquals(PEPSUtil.encodeSAMLToken(SAML_BYTE_SAMPLE), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * null.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testEncodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.encodeSAMLToken(null), SAML_BASE64_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#encodeSAMLToken(byte[])} method for the given
+ * empty byte[] value.
+ */
+ @Test
+ public void testEncodeSAMLTokenEmpty() {
+ assertEquals(PEPSUtil.encodeSAMLToken(EMPTY_BYTE), EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testDecodeSAMLToken() {
+ assertArrayEquals(PEPSUtil.decodeSAMLToken(SAML_BASE64_SAMPLE),
+ SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = NullPointerException.class)
+ public void testDecodeSAMLTokenNull() {
+ assertNotSame(PEPSUtil.decodeSAMLToken(null), SAML_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#decodeSAMLToken(byte[])} method for the given
+ * empty string value.
+ */
+ @Test(expected = StringIndexOutOfBoundsException.class)
+ public void testDecodeSAMLTokenEmpty() {
+ assertTrue(PEPSUtil.decodeSAMLToken(EMPTY_STRING) == EMPTY_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * byte[] value.
+ */
+ @Test
+ public void testHashPersonalToken() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(SAML_BASE64_BYTE_SAMPLE),
+ HASH_BYTE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * null value.
+ */
+ @Test(expected = InternalErrorPEPSException.class)
+ public void testHashPersonalTokenNull() {
+ assertNull(PEPSUtil.hashPersonalToken(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#hashPersonalToken(byte[])} method for the given
+ * empty value.
+ */
+ @Test
+ public void testHashPersonalTokenEmpty() {
+ assertArrayEquals(PEPSUtil.hashPersonalToken(EMPTY_BYTE), EMPTY_HASH_BYTE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * correct message.
+ */
+ @Test
+ public void testGetStorkErrorCodeExists() {
+ assertEquals(PEPSUtil.getStorkErrorCode(MESSAGE_SAMPLE), ERROR_CODE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNoExists() {
+ assertNull(PEPSUtil.getStorkErrorCode(ERROR_MESSAGE_SAMPLE));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * empty message.
+ */
+ @Test
+ public void testGetStorkErrorCodeEmpty() {
+ assertNull(PEPSUtil.getStorkErrorCode(EMPTY_STRING));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * null message.
+ */
+ @Test
+ public void testGetStorkErrorCodeNull() {
+ assertNull(PEPSUtil.getStorkErrorCode(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("-"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorCode(String)} method for the given
+ * invalid message.
+ */
+ @Test
+ public void testGetStorkErrorCodeWithSepAndCodeFake() {
+ assertNull(PEPSUtil.getStorkErrorCode("000001 -"));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given correct message.
+ */
+ @Test
+ public void testGetStorkErrorMessageExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNoExists() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(ERROR_MESSAGE_SAMPLE),
+ ERROR_MESSAGE_SAMPLE);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given empty message.
+ */
+ @Test
+ public void testGetStorkErrorMessageEmpty() {
+ assertEquals(PEPSUtil.getStorkErrorMessage(EMPTY_STRING),
+ EMPTY_STRING);
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given null message.
+ */
+ @Test
+ public void testGetStorkErrorMessageNull() {
+ assertNull(PEPSUtil.getStorkErrorMessage(null));
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("-"),"-");
+ }
+
+ /**
+ * Tests the {@link PEPSUtil#getStorkErrorMessage(String)} method for the
+ * given invalid message.
+ */
+ @Test
+ public void testGetStorkErrorMessageWithSepAndCodeFake() {
+ assertEquals(PEPSUtil.getStorkErrorMessage("000001 -"),"000001 -");
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
new file mode 100644
index 000000000..7052b320a
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeListTestCase.java
@@ -0,0 +1,747 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttributeList's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.5 $, $Date: 2010-11-17 05:17:02 $
+ */
+public final class PersonalAttributeListTestCase {
+
+ /**
+ * isAgeOver constant value.
+ */
+ private static final String ISAGEOVER_CONS = "isAgeOver";
+
+ /**
+ * 1 constant value.
+ */
+ private static final int ONE_CONS = 1;
+
+ /**
+ * 2 constant value.
+ */
+ private static final int TWO_CONS = 2;
+
+ /**
+ * An empty attribute.
+ */
+ @SuppressWarnings("unused")
+ private static final PersonalAttributeList EMPTY_ATTR_LIST =
+ new PersonalAttributeList(0);
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST =
+ "isAgeOver:true:[15,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST2 =
+ "isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3 =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String SIMPLE_ATTRLIST3_REVERSE =
+ "isAgeOver:true:[18,]:Available;isAgeOver:true:[15,]:Available;";
+ /**
+ * Simple attribute value list string.
+ */
+ private static final String COMPLEX_ATTRLIST =
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=Ed. B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;";
+ /**
+ * Mix attribute list string.
+ */
+ private static final String STR_MIX_ATTR_LIST =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:"
+ + "Available;";
+
+ /**
+ * Mix attribute list 2 string.
+ */
+ private static final String STR_MIX_ATTR_LIST2 =
+ "isAgeOver:true:[15,]:Available;canonicalResidenceAddress:true:["
+ + "postalCode=4100,apartmentNumber=Ed.B,state=Porto,countryCodeAddress=PT,"
+ + "streetNumber=379,streetName=Avenida Sidonio Pais,town=Porto,]:Available;"
+ + "mandateContent:true:["
+ + "isJoint=\"isjoint\",typeOfPower=\"power\",ValidTo=\"validto\",validfrom=\"validfrom\",AQAA=\"3\",isChained=\"ischained\",]:"
+ + "Available;";
+
+ /**
+ * Attribute List example.
+ */
+ @SuppressWarnings({ "serial" })
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeListTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "Ed. B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testAddSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testAddCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testAddNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Same attribute name added
+ * twice. Personal Attribute list must be size 2 - IsAgeOver attribute added
+ * twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testAddSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Simple Value.
+ */
+ @Test
+ public void testPutSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), ATTR_VALUE);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 1 - Complex Value.
+ */
+ @Test
+ public void testPutComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(ATTR_VALUE.getName(), complexAttrValue);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 0 - no attribute.
+ */
+ @Test
+ public void testPutNull() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put("", null);
+ Assert.assertTrue(attrList.size() == 0);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrName() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List put method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute added twice.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testPutSameAttrNameEmpty() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 1 - Simple attribute.
+ */
+ @Test
+ public void testGetSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(ATTR_VALUE);
+ Assert.assertEquals(ATTR_VALUE, attrList.get(ATTR_VALUE.getName()));
+ }
+
+ /**
+ * Testing Personal Attribute List add method. Personal Attribute list must be
+ * size 1 - Complex attribute.
+ */
+ @Test
+ public void testGetCompleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(complexAttrValue);
+ Assert.assertEquals(complexAttrValue.toString(),
+ attrList.get(complexAttrValue.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List get method. Personal Attribute list must be
+ * size 2 - IsAgeOver attribute.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testGetIsAgeOverAttr() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST,
+ attrList.get(attrValueUnder.getName()).toString());
+ Assert.assertEquals(SIMPLE_ATTRLIST2,
+ attrList.get(attrValueOver.getName()).toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple attribute.
+ */
+ @Test
+ public void testPopulateSimpleAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Complex attribute.
+ */
+ @Test
+ public void testPopulateComplexAttr() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(attrList.size() == 1);
+ }
+
+ /**
+ * Testing Personal Attribute List populate method. Personal Attribute list
+ * must be size 1 - Simple and Complex attribute.
+ */
+ @Test
+ public void testPopulateMixAttrs() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(attrList.size() == 2);
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using put.
+ *
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testToStringFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromSimplePopulate() {
+ final String strAttrList = "isAgeOver:true";
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(strAttrList);
+ Assert.assertEquals("isAgeOver:true:[]:;", attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List toString method using populate.
+ */
+ @Test
+ public void testToStringFromPopulate() {
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.populate(SIMPLE_ATTRLIST3);
+ Assert.assertEquals(SIMPLE_ATTRLIST3_REVERSE, attrList.toString());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid values.
+ */
+ @Test
+ public void testPopulateWithInvalidValuesFormat() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type:values:status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List populate method, with invalid format.
+ */
+ @Test
+ public void testPopulateWithInvalidFormat() {
+
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate("name:type::status;");
+ Assert.assertEquals(pal, new PersonalAttributeList());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using add.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromAdd() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.add(attrValueUnder);
+ attrList.add(attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using put.
+ */
+ @SuppressWarnings("serial")
+ @Test
+ public void testCloneFromPut() {
+ final PersonalAttribute attrValueUnder =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ final PersonalAttribute attrValueOver =
+ new PersonalAttribute(ISAGEOVER_CONS, true, new ArrayList<String>() {
+ {
+ add("18");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+ final PersonalAttributeList attrList = new PersonalAttributeList(1);
+ attrList.put(attrValueUnder.getName(), attrValueUnder);
+ attrList.put(attrValueOver.getName(), attrValueOver);
+ Assert.assertNotSame(attrList, attrList.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List clone method using populate.
+ */
+ @Test
+ public void testCloneFromPopulate() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertNotSame(pal, pal.clone());
+ }
+
+ /**
+ * Testing Personal Attribute List iterator.
+ */
+ @Test
+ public void testIterator() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ final Iterator<PersonalAttribute> itAttr = pal.iterator();
+ while (itAttr.hasNext()) {
+ final PersonalAttribute attr = itAttr.next();
+ Assert.assertEquals(ISAGEOVER_CONS, attr.getName());
+ }
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetOptionalAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method without optional attributes.
+ */
+ @Test
+ public void testGetOptionalAttributesWithoutOptional() {
+ final String strAttrList =
+ "isAgeOver:true:[15,]:Available;isAgeOver:true:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with one optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOneOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:true:[15,]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetOptionalAttributes method with two optional attribute.
+ */
+ @Test
+ public void testGetOptionalAttributesWithOnlyOptional() {
+ final String strAttrList =
+ "age:false:[]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getOptionalAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getMandatoryAttributes method without mandatory attributes.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithoutMandatory() {
+ final String strAttrList =
+ "isAgeOver:false:[15,]:Available;isAgeOver:false:[18,]:Available;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with one mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOneMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:false:[15,]:;isAgeOver:false:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two mandatory attribute.
+ */
+ @Test
+ public void testGetMandatoryAttributesWithOnlyMandatory() {
+ final String strAttrList =
+ "age:true:[]:;isAgeOver:true:[18,]:;";
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(strAttrList);
+ Assert.assertTrue(pal.getMandatoryAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method without simple attributes.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(COMPLEX_ATTRLIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getSimpleValueAttributes() method with one simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOneSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with two simple attribute.
+ */
+ @Test
+ public void testGetSimpleValueAttributesWithOnlySimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST3);
+ Assert.assertTrue(pal.getSimpleValueAttributes().size() == TWO_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexValueAttributes method with empty attribute list.
+ */
+ @Test
+ public void testGetComplexAttributesWithEmptyList() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method without complex attributes.
+ */
+ @Test
+ public void testGetComplexAttributesWithoutSimple() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(SIMPLE_ATTRLIST2);
+ Assert.assertTrue(pal.getComplexAttributes().isEmpty());
+ }
+
+ /**
+ * Testing Personal Attribute List's getComplexAttributes() method with one complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOneComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST);
+ Assert.assertTrue(pal.getComplexAttributes().size() == ONE_CONS);
+ }
+
+ /**
+ * Testing Personal Attribute List's GetMandatoryAttributes method with only two Complex attribute.
+ */
+ @Test
+ public void testGetComplexAttributesWithOnlyComplex() {
+ final PersonalAttributeList pal = new PersonalAttributeList();
+ pal.populate(STR_MIX_ATTR_LIST2);
+ Assert.assertTrue(pal.getComplexAttributes().size() == TWO_CONS);
+ }
+
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
new file mode 100644
index 000000000..458d510e0
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/PersonalAttributeTestCase.java
@@ -0,0 +1,182 @@
+/*
+ * This work is Open Source and licensed by the European Commission under the
+ * conditions of the European Public License v1.1
+ *
+ * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1);
+ *
+ * any use of this file implies acceptance of the conditions of this license.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package eu.stork.peps.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+
+/**
+ * The PersonalAttribute's Test Case.
+ *
+ * @author ricardo.ferreira@multicert.com, renato.portela@multicert.com,
+ * luis.felix@multicert.com, hugo.magalhaes@multicert.com,
+ * paulo.ribeiro@multicert.com
+ * @version $Revision: 1.4 $, $Date: 2010-11-17 05:17:03 $
+ */
+public final class PersonalAttributeTestCase {
+
+ /**
+ * An empty attribute.
+ */
+ private static final PersonalAttribute EMPTYATTR = new PersonalAttribute();
+
+ /**
+ * An attribute with a complex value (canonicalResidenceAddress).
+ */
+ private static PersonalAttribute complexAttrValue = null;
+
+ /**
+ * An attribute with a simple value (age).
+ */
+ @SuppressWarnings("serial")
+ private static final PersonalAttribute ATTR_VALUE = new PersonalAttribute(
+ "age", true, new ArrayList<String>() {
+ {
+ add("15");
+ }
+ }, STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ /**
+ * Init PersonalAttributeTestCase class.
+ */
+ @SuppressWarnings("serial")
+ @BeforeClass
+ public static void runsBeforeTheTestSuite() {
+ final Map<String, String> values = new HashMap<String, String>() {
+ {
+ put("countryCodeAddress", "PT");
+ put("state", "Porto");
+ put("town", "Porto");
+ put("postalCode", "4100");
+ put("streetName", "Avenida Sidonio Pais");
+ put("streetNumber", "379");
+ put("apartmentNumber", "B");
+ }
+ };
+
+ complexAttrValue =
+ new PersonalAttribute("canonicalResidenceAddress", true, values,
+ STORKStatusCode.STATUS_AVAILABLE.toString());
+
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given simple
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringValues() {
+ Assert.assertEquals("age:true:[15,]:Available;", ATTR_VALUE.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#toString()} method for the given complex
+ * attribute value. Values must match.
+ */
+ @Test
+ public void testToStringComplexValues() {
+ Assert.assertEquals(
+ "canonicalResidenceAddress:true:[postalCode=4100,apartmentNumber=B,"
+ + "state=Porto,countryCodeAddress=PT,streetNumber=379,"
+ + "streetName=Avenida Sidonio Pais,town=Porto,]:Available;",
+ complexAttrValue.toString());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithNull() {
+ Assert.assertTrue(EMPTYATTR.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyStatus()} method for the given
+ * new attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyStatusWithEmptyString() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setStatus("");
+ Assert.assertTrue(attr.isEmptyStatus());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setValue(null);
+ Assert.assertTrue(attr.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyValue()} method for the given
+ * empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithNull() {
+ final PersonalAttribute attr = (PersonalAttribute) EMPTYATTR.clone();
+ attr.setComplexValue(null);
+ Assert.assertTrue(attr.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#isEmptyComplexValue()} method for the
+ * given empty attribute. Must return true.
+ */
+ @Test
+ public void testToIsEmptyComplexValueWithEmptyComplexValue() {
+ Assert.assertTrue(EMPTYATTR.isEmptyComplexValue());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToComplexValue() {
+ Assert.assertNotSame(complexAttrValue, complexAttrValue.clone());
+ }
+
+ /**
+ * Tests the {@link PersonalAttribute#clone()} method for the given attribute.
+ * Must return true.
+ */
+ @Test
+ public void testCloneToValue() {
+ Assert.assertNotSame(ATTR_VALUE, ATTR_VALUE.clone());
+ }
+}
diff --git a/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java
new file mode 100644
index 000000000..452602210
--- /dev/null
+++ b/id/server/stork2-commons/src/test/java/eu/stork/peps/tests/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * This package provides all JUnit test classes.
+ */
+package eu.stork.peps.tests;
+
diff --git a/id/server/stork2-commons/src/test/resources/.svn/all-wcprops b/id/server/stork2-commons/src/test/resources/.svn/all-wcprops
new file mode 100644
index 000000000..a3a21b424
--- /dev/null
+++ b/id/server/stork2-commons/src/test/resources/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/resources
+END
+log4j.xml
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/CITnet/svn/STORK2/!svn/ver/19/trunk/Commons/src/test/resources/log4j.xml
+END
diff --git a/id/server/stork2-commons/src/test/resources/.svn/entries b/id/server/stork2-commons/src/test/resources/.svn/entries
new file mode 100644
index 000000000..9274deb98
--- /dev/null
+++ b/id/server/stork2-commons/src/test/resources/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+776
+https://webgate.ec.europa.eu/CITnet/svn/STORK2/trunk/Commons/src/test/resources
+https://webgate.ec.europa.eu/CITnet/svn/STORK2
+
+
+
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+aa842e49-f825-43fc-93ba-11ee9fd5a035
+
+log4j.xml
+file
+
+
+
+
+2013-12-20T12:27:56.542475Z
+4e990a84da0033594135b05cd01a9cdd
+2013-07-25T08:54:09.995385Z
+7
+emsomavmi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+645
+
diff --git a/id/server/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base b/id/server/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base
new file mode 100644
index 000000000..0ad2ea9a4
--- /dev/null
+++ b/id/server/stork2-commons/src/test/resources/.svn/text-base/log4j.xml.svn-base
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/stork2-commons/src/test/resources/log4j.xml b/id/server/stork2-commons/src/test/resources/log4j.xml
new file mode 100644
index 000000000..0ad2ea9a4
--- /dev/null
+++ b/id/server/stork2-commons/src/test/resources/log4j.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="MainLogger" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="stork-commons.log" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss:SSS} - %p - %C{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info" />
+ <appender-ref ref="MainLogger" />
+ </root>
+
+</log4j:configuration>
diff --git a/id/server/stork2-saml-engine/pom.xml b/id/server/stork2-saml-engine/pom.xml
index b002471db..af6dfd21c 100644
--- a/id/server/stork2-saml-engine/pom.xml
+++ b/id/server/stork2-saml-engine/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0-RC3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -13,29 +13,29 @@
<name>STORKSAMLEngine</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <saml.version>1.1.0</saml.version>
+ <saml.version>1.4.0</saml.version>
<samlspec.version>0.5.2</samlspec.version>
<samlspecacept.version>0.5.1</samlspecacept.version>
- <commons.version>1.2.0</commons.version>
+ <commons.version>1.4.0</commons.version>
<opensaml.version>2.6.0</opensaml.version>
- <timestamp>${maven.build.timestamp}</timestamp>
+ <timestamp>${maven.build.timestamp}</timestamp>
</properties>
- <version>${saml.version}</version>
+ <version>${saml.version}</version>
<description>
The STORKSAMLEngine library provides tools to support developers working with the Security Assertion Markup Language (SAML).
</description>
<repositories>
- <repository>
- <id>org.opensaml</id>
- <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
- </repository>
+ <repository>
+ <id>org.opensaml</id>
+ <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
+ </repository>
<!-- repository OpenSaml -->
<repository>
<id>shibboleth-release</id>
<name>Internet2 Releases</name>
<layout>default</layout>
- <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
+ <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
@@ -56,52 +56,52 @@
<version>${opensaml.version}</version>
<exclusions>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
</exclusion>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>jul-to-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
</exclusion>
- </exclusions>
+ </exclusions>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.5</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.5</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>1.7.5</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <version>1.7.5</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jul-to-slf4j</artifactId>
- <version>1.7.5</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
@@ -123,7 +123,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<build>
<pluginManagement>
<plugins>
@@ -132,8 +132,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
@@ -161,42 +161,42 @@
</executions>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
<archive>
- <manifestEntries>
- <SAMLEngineVersion>${saml.version}</SAMLEngineVersion>
- <SAMLSpecVersion-accept>${samlspecacept.version}</SAMLSpecVersion-accept>
- <SAMLSpecVersion-send>${samlspec.version}</SAMLSpecVersion-send>
- <SAMLSpecKnownIssues>None</SAMLSpecKnownIssues>
+ <manifestEntries>
+ <SAMLEngineVersion>${saml.version}</SAMLEngineVersion>
+ <SAMLSpecVersion-accept>${samlspecacept.version}</SAMLSpecVersion-accept>
+ <SAMLSpecVersion-send>${samlspec.version}</SAMLSpecVersion-send>
+ <SAMLSpecKnownIssues>None</SAMLSpecKnownIssues>
<timestamp>${timestamp}</timestamp>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
<profiles>
- <profile>
+ <profile>
<id>metrics</id>
<build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <formats>
- <format>html</format>
- <format>xml</format>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
</formats>
- </configuration>
- </plugin>
- </plugins>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</profile>
</profiles>
<reporting>
- </reporting>
+ </reporting>
</project>
diff --git a/id/server/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF b/id/server/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF
index 5e9495128..254272e1c 100644
--- a/id/server/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF
+++ b/id/server/stork2-saml-engine/src/main/java/META-INF/MANIFEST.MF
@@ -1,3 +1,3 @@
-Manifest-Version: 1.0
-Class-Path:
-
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
index e993c0e46..26635e337 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
@@ -1,421 +1,415 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine;
-
-import java.io.ByteArrayInputStream;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.opensaml.Configuration;
-import org.opensaml.DefaultBootstrap;
-import org.opensaml.common.SAMLObject;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.xml.ConfigurationException;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.Marshaller;
-import org.opensaml.xml.io.MarshallerFactory;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.io.Unmarshaller;
-import org.opensaml.xml.io.UnmarshallerFactory;
-import org.opensaml.xml.io.UnmarshallingException;
-import org.opensaml.xml.parse.BasicParserPool;
-import org.opensaml.xml.parse.XMLParserException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
-import eu.stork.peps.auth.engine.core.STORKSAMLCore;
-import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryMarshaller;
-import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SignModuleFactory;
-import eu.stork.peps.configuration.ConfigurationCreator;
-import eu.stork.peps.configuration.ConfigurationReader;
-import eu.stork.peps.configuration.InstanceEngine;
-import eu.stork.peps.exceptions.SAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * Class that wraps the operations over SAML tokens, both generation and
- * validation of SAML requests and SAML responses. Compliant with "OASIS Secure
- * Assertion Markup Language (SAML) 2.0, May 2005", but taking into account
- * STORK specific requirements.
- *
- * @author fjquevedo
- * @author iinigo
- */
-
-public class SAMLEngine {
-
- /** The Document Builder Factory. */
- private static javax.xml.parsers.DocumentBuilderFactory dbf = null;
-
- /** The instance of every engine SAML. */
- private static Map<String, InstanceEngine> instanceConfigs;
-
- /** The instances of SAML engine. */
- private static Map<String, Map<String, Object>> instances;
-
- /** The logger. */
- private static final Logger LOG = LoggerFactory.getLogger(SAMLEngine.class
- .getName());
-
- /** The Constant MODULE_SIGN_CONF. */
- private static final String MODULE_SIGN_CONF = "SignatureConf";
-
- /** The Constant SAML_ENGINE_SIGN_CLASS. */
- private static final String SAML_ENGINE_SIGN_CLASS = "class";
-
- /** The Constant SAML_ENGINE_CONF. */
- private static final String SAML_ENGINE_CONF = "SamlEngineConf";
-
- /** The Constant SAML_ENGINE_FILE_CONF. */
- private static final String SAML_ENGINE_FILE_CONF = "fileConfiguration";
-
- /** The codification of characters. */
- private static final String CHARACTER_ENCODING = "UTF-8";
-
- /** The SAML core. */
- private STORKSAMLCore samlCore;
-
- /** The Module of Signature. */
- private SAMLEngineSignI signer;
-
-
- /** Initializes the SAML engine. */
- /** Configure Document Builder Factory. */
-
- static {
- startUp();
- loadDocumentFactory();
- }
-
- /**
- * Load document factory.
- */
- private static void loadDocumentFactory() {
-
- try {
- dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
- dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- dbf.setNamespaceAware(true);
- dbf.setIgnoringComments(true);
- } catch (ParserConfigurationException e) {
- LOG.error("Error parser configuration.");
- throw new STORKSAMLEngineRuntimeException(e);
- }
-
- }
-
- /**
- * Method that initializes the basic services for the SAML Engine, like the
- * OpenSAML library and the BouncyCastle provider.
- */
- private static void startUp() {
-
- LOG.info("SAMLEngine: Initialize OpenSAML");
-
- //TLenz: MOA-ID uses an own Bootstrap
-// try {
-// DefaultBootstrap.bootstrap();
-// } catch (ConfigurationException e) {
-// LOG.error("Problem initializing the OpenSAML library.");
-// throw new STORKSAMLEngineRuntimeException(e);
-// }
-
- LOG.debug("Read all file configurations. (instances of SAMLEngine)");
- try {
- instanceConfigs = ConfigurationReader.readConfiguration();
- } catch (SAMLEngineException e) {
- LOG.error("Error read configuration file.");
- throw new STORKSAMLEngineRuntimeException(e);
- }
-
- LOG.debug("Create all instaces of saml engine. (instances of SAMLEngine)");
- try {
- instances = ConfigurationCreator
- .createConfiguration(instanceConfigs);
- } catch (STORKSAMLEngineException e) {
- LOG.error("Error initializing instances from Stork SAML engine.");
- throw new STORKSAMLEngineRuntimeException(e);
- }
- }
-
- /**
- * Instantiates a new SAML engine.
- */
- private SAMLEngine() {
-
- }
-
- /**
- * Instantiates a new SAML engine.
- *
- * @param nameInstance the name instance
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- protected SAMLEngine(final String nameInstance)
- throws STORKSAMLEngineException {
- LOG.info("Loading Specific Configuration.");
-
- LOG.debug("Create intance of saml messages.");
-
- Map<String, Object> instance = instances.get(nameInstance);
-
- if (instance == null || instance.isEmpty()) {
- LOG.error("Instance: " + nameInstance + " not exist.");
- throw new STORKSAMLEngineException("Instance: " + nameInstance
- + " not exist.");
- }
-
- Properties properties = (Properties) instance.get(SAML_ENGINE_CONF);
-
- if (properties == null) {
- LOG.error("SamlEngine.xml: not exist.");
- throw new STORKSAMLEngineException("SamlEngine.xml: not exist.");
- }
-
- samlCore = new STORKSAMLCore(properties);
-
- final HashMap<String, String> propertiesSign = (HashMap<String, String>) instance
- .get(MODULE_SIGN_CONF);
-
- LOG.debug("Loading Module of sign.");
- signer = SignModuleFactory.getInstance(propertiesSign
- .get(SAML_ENGINE_SIGN_CLASS));
-
- try {
- LOG.info("Initialize module of sign.");
- signer.init(propertiesSign.get(SAML_ENGINE_FILE_CONF));
- LOG.info("Load cryptographic service provider of module of sign.");
- signer.loadCryptServiceProvider();
- } catch (SAMLEngineException e) {
- LOG.error("Error create signature module: "
- + propertiesSign.get(SAML_ENGINE_FILE_CONF));
- LOG.info("Exception" + e);
- throw new STORKSAMLEngineException(e);
- }
- }
-
- /**
- * Gets the Signer properties.
- *
- * @return the SAML Sign properties
- */
- protected SAMLEngineSignI getSigner() {
- return signer;
- }
-
- /**
- * Gets the SAML core properties.
- *
- * @return the SAML core properties
- */
- protected final STORKSAMLCore getSamlCoreProperties() {
- return samlCore;
- }
-
- /**
- * Method that transform the received SAML object into a byte array
- * representation.
- *
- * @param samlToken the SAML token.
- *
- * @return the byte[] of the SAML token.
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- private byte[] marshall(final XMLObject samlToken)
- throws SAMLEngineException {
-
- try {
- javax.xml.parsers.DocumentBuilder docBuilder = null;
-
- final MarshallerFactory marshallerFactory = Configuration
- .getMarshallerFactory();
-
- final Marshaller marshaller;
- if (samlToken.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- marshaller = new CustomAttributeQueryMarshaller();
- else
- marshaller = marshallerFactory
- .getMarshaller(samlToken);
-
- docBuilder = dbf.newDocumentBuilder();
-
- final Document doc = docBuilder.newDocument();
-
- marshaller.marshall(samlToken, doc);
-
- // Obtain a byte array representation of the marshalled SAML object
- final DOMSource domSource = new DOMSource(doc);
- final StringWriter writer = new StringWriter();
- final StreamResult result = new StreamResult(writer);
- final TransformerFactory transFactory = TransformerFactory
- .newInstance();
- Transformer transformer;
-
- transformer = transFactory.newTransformer();
- transformer.transform(domSource, result);
- LOG.debug("SAML request \n"+ writer.toString());
- return writer.toString().getBytes(CHARACTER_ENCODING);
-
- } catch (ParserConfigurationException e) {
- LOG.error("ParserConfigurationException.");
- throw new SAMLEngineException(e);
- } catch (MarshallingException e) {
- LOG.error("MarshallingException.");
- throw new SAMLEngineException(e);
- } catch (TransformerConfigurationException e) {
- LOG.error("TransformerConfigurationException.");
- throw new SAMLEngineException(e);
- } catch (TransformerException e) {
- LOG.error("TransformerException.");
- throw new SAMLEngineException(e);
- } catch (UnsupportedEncodingException e) {
- LOG.error("UnsupportedEncodingException: " + CHARACTER_ENCODING);
- throw new SAMLEngineException(e);
- }
- }
-
- /**
- * Method that signs a SAML Token.
- *
- * @param tokenSaml the token SAML
- *
- * @return the SAML object sign
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- private SignableSAMLObject sign(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.debug("Sign SamlToken.");
- signer.sign(tokenSaml);
- return tokenSaml;
- }
-
- /**
- * Sign and transform to byte array.
- *
- * @param samlToken the SAML token
- *
- * @return the byte[] of the SAML token
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- protected final byte[] signAndMarshall(final SignableSAMLObject samlToken)
- throws SAMLEngineException {
- LOG.debug("Marshall Saml Token.");
- SignableSAMLObject signElement = sign(samlToken);
- return marshall(signElement);
- }
-
- /**
- * Method that unmarshalls a SAML Object from a byte array representation to
- * an XML Object.
- *
- * @param samlToken Byte array representation of a SAML Object
- *
- * @return XML Object (superclass of SAMLObject)
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- protected final XMLObject unmarshall(final byte[] samlToken)
- throws SAMLEngineException {
- try {
- // Get parser pool manager
- final BasicParserPool ppMgr = new BasicParserPool();
- // Note: this is necessary due to an unresolved Xerces deferred DOM
- // issue/bug
- final HashMap<String, Boolean> features = new HashMap<String, Boolean>();
- features.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
- ppMgr.setBuilderFeatures(features);
-
- ppMgr.setNamespaceAware(true);
-
- // Parse SAMLToken
- Document document = ppMgr.parse(new ByteArrayInputStream(samlToken));
- if (document != null){
- final Element root = document.getDocumentElement();
- // Get appropriate unmarshaller
- final UnmarshallerFactory unmarshallerFact = Configuration.getUnmarshallerFactory();
- // Unmarshall using the SAML Token root element
- if (unmarshallerFact != null && root != null){
- final Unmarshaller unmarshaller;
- if (root.getLocalName().equals(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- unmarshaller = new CustomAttributeQueryUnmarshaller();
- else
- unmarshaller = unmarshallerFact.getUnmarshaller(root);
- try {
- return unmarshaller.unmarshall(root);
- } catch (NullPointerException e){
- LOG.error("Error element tag incomplet or null.");
- throw new SAMLEngineException("NullPointerException", e);
- }
- } else {
- LOG.error("Error element tag incomplet or null.");
- throw new SAMLEngineException("NullPointerException : unmarshallerFact or root is null");
- }
- } else {
- LOG.error("Error element tag incomplet or null.");
- throw new SAMLEngineException("NullPointerException : document is null");
- }
- } catch (XMLParserException e) {
- LOG.error("XML Parsing Error.", e);
- throw new SAMLEngineException(e);
- } catch (UnmarshallingException e) {
- LOG.error("TransformerException.", e);
- throw new SAMLEngineException(e);
- } catch (NullPointerException e) {
- LOG.error("Error element tag incomplet or null.", e);
- throw new SAMLEngineException(e);
- }
- }
-
- /**
- * Method that validates an XML Signature contained in a SAML Token.
- *
- * @param samlToken the SAML token
- *
- * @return the SAML object
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- protected final SAMLObject validateSignature(
- final SignableSAMLObject samlToken) throws SAMLEngineException {
-
- LOG.info("Validate Signature");
- signer.validateSignature(samlToken);
-
- return samlToken;
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.opensaml.Configuration;
+import org.opensaml.DefaultBootstrap;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.xml.ConfigurationException;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallerFactory;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallerFactory;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.opensaml.xml.parse.XMLParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.auth.engine.core.STORKSAMLCore;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryMarshaller;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SignModuleFactory;
+import eu.stork.peps.configuration.ConfigurationCreator;
+import eu.stork.peps.configuration.ConfigurationReader;
+import eu.stork.peps.configuration.InstanceEngine;
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * Class that wraps the operations over SAML tokens, both generation and
+ * validation of SAML requests and SAML responses. Compliant with "OASIS Secure
+ * Assertion Markup Language (SAML) 2.0, May 2005", but taking into account
+ * STORK specific requirements.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ */
+
+public class SAMLEngine {
+
+ /** The Document Builder Factory. */
+ private static javax.xml.parsers.DocumentBuilderFactory dbf = null;
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SAMLEngine.class
+ .getName());
+
+ /** The Constant MODULE_SIGN_CONF. */
+ private static final String MODULE_SIGN_CONF = "SignatureConf";
+
+ /** The Constant SAML_ENGINE_SIGN_CLASS. */
+ private static final String SAML_ENGINE_SIGN_CLASS = "class";
+
+ /** The Constant SAML_ENGINE_CONF. */
+ private static final String SAML_ENGINE_CONF = "SamlEngineConf";
+
+ /** The Constant SAML_ENGINE_FILE_CONF. */
+ private static final String SAML_ENGINE_FILE_CONF = "fileConfiguration";
+
+ /** The codification of characters. */
+ private static final String CHARACTER_ENCODING = "UTF-8";
+
+ /** The SAML core. */
+ private STORKSAMLCore samlCore;
+
+ /** The Module of Signature. */
+ private SAMLEngineSignI signer;
+
+
+ /** Initializes the SAML engine. */
+ /** Configure Document Builder Factory. */
+
+ static {
+ startUp();
+ loadDocumentFactory();
+ }
+
+ /**
+ * Load document factory.
+ */
+ private static void loadDocumentFactory() {
+ try {
+ dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ dbf.setNamespaceAware(true);
+ dbf.setIgnoringComments(true);
+ } catch (ParserConfigurationException e) {
+ LOG.error("Error parser configuration.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Method that initializes the basic services for the SAML Engine, like the
+ * OpenSAML library and the BouncyCastle provider.
+ */
+ private static void startUp() {
+
+ LOG.info("SAMLEngine: Initialize OpenSAML");
+
+
+
+/* Commented because it makes a problems with PVP2 MOA-ID
+ try {
+ DefaultBootstrap.bootstrap();
+ } catch (ConfigurationException e) {
+ LOG.error("Problem initializing the OpenSAML library.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+*/
+
+ LOG.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOG.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+
+ LOG.debug("Create all instances of saml engine. (instances of SAMLEngine)");
+ try {
+ instances = ConfigurationCreator
+ .createConfiguration(instanceConfigs);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error initializing instances from Stork SAML engine.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Instantiates a new SAML engine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ protected SAMLEngine(final String nameInstance)
+ throws STORKSAMLEngineException {
+ LOG.info("Loading Specific Configuration.");
+
+ LOG.debug("Create intance of saml messages.");
+
+ Map<String, Object> instance = instances.get(nameInstance);
+
+ if (instance == null || instance.isEmpty()) {
+ LOG.error("Instance: " + nameInstance + " not exist.");
+ throw new STORKSAMLEngineException("Instance: " + nameInstance
+ + " not exist.");
+ }
+
+ Properties properties = (Properties) instance.get(SAML_ENGINE_CONF);
+
+ if (properties == null) {
+ LOG.error("SamlEngine.xml: not exist.");
+ throw new STORKSAMLEngineException("SamlEngine.xml: not exist.");
+ }
+
+ samlCore = new STORKSAMLCore(properties);
+
+ final HashMap<String, String> propertiesSign = (HashMap<String, String>) instance
+ .get(MODULE_SIGN_CONF);
+
+ LOG.debug("Loading Module of sign.");
+ signer = SignModuleFactory.getInstance(propertiesSign
+ .get(SAML_ENGINE_SIGN_CLASS));
+
+ try {
+ LOG.info("Initialize module of sign.");
+ signer.init(propertiesSign.get(SAML_ENGINE_FILE_CONF));
+ LOG.info("Load cryptographic service provider of module of sign.");
+ signer.loadCryptServiceProvider();
+ } catch (SAMLEngineException e) {
+ LOG.error("Error create signature module: "
+ + propertiesSign.get(SAML_ENGINE_FILE_CONF));
+ LOG.info("Exception" + e);
+ throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Gets the Signer properties.
+ *
+ * @return the SAML Sign properties
+ */
+ protected SAMLEngineSignI getSigner() {
+ return signer;
+ }
+
+ /**
+ * Gets the SAML core properties.
+ *
+ * @return the SAML core properties
+ */
+ protected final STORKSAMLCore getSamlCoreProperties() {
+ return samlCore;
+ }
+
+ /**
+ * Method that transform the received SAML object into a byte array
+ * representation.
+ *
+ * @param samlToken the SAML token.
+ *
+ * @return the byte[] of the SAML token.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private byte[] marshall(final XMLObject samlToken)
+ throws SAMLEngineException {
+
+ try {
+ javax.xml.parsers.DocumentBuilder docBuilder = null;
+
+ final MarshallerFactory marshallerFactory = Configuration
+ .getMarshallerFactory();
+
+ final Marshaller marshaller;
+ if (samlToken.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ marshaller = new CustomAttributeQueryMarshaller();
+ else
+ marshaller = marshallerFactory
+ .getMarshaller(samlToken);
+
+ docBuilder = dbf.newDocumentBuilder();
+
+ final Document doc = docBuilder.newDocument();
+
+ marshaller.marshall(samlToken, doc);
+
+ // Obtain a byte array representation of the marshalled SAML object
+ final DOMSource domSource = new DOMSource(doc);
+ final StringWriter writer = new StringWriter();
+ final StreamResult result = new StreamResult(writer);
+ final TransformerFactory transFactory = TransformerFactory
+ .newInstance();
+ Transformer transformer;
+
+ transformer = transFactory.newTransformer();
+ transformer.transform(domSource, result);
+ LOG.debug("SAML request \n"+ writer.toString());
+ return writer.toString().getBytes(CHARACTER_ENCODING);
+
+ } catch (ParserConfigurationException e) {
+ LOG.error("ParserConfigurationException.");
+ throw new SAMLEngineException(e);
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException.");
+ throw new SAMLEngineException(e);
+ } catch (TransformerConfigurationException e) {
+ LOG.error("TransformerConfigurationException.");
+ throw new SAMLEngineException(e);
+ } catch (TransformerException e) {
+ LOG.error("TransformerException.");
+ throw new SAMLEngineException(e);
+ } catch (UnsupportedEncodingException e) {
+ LOG.error("UnsupportedEncodingException: " + CHARACTER_ENCODING);
+ throw new SAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Method that signs a SAML Token.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the SAML object sign
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private SignableSAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.debug("Sign SamlToken.");
+ signer.sign(tokenSaml);
+ return tokenSaml;
+ }
+
+ /**
+ * Sign and transform to byte array.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the byte[] of the SAML token
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final byte[] signAndMarshall(final SignableSAMLObject samlToken)
+ throws SAMLEngineException {
+ LOG.debug("Marshall Saml Token.");
+ SignableSAMLObject signElement = sign(samlToken);
+ return marshall(signElement);
+ }
+
+ /**
+ * Method that unmarshalls a SAML Object from a byte array representation to
+ * an XML Object.
+ *
+ * @param samlToken Byte array representation of a SAML Object
+ *
+ * @return XML Object (superclass of SAMLObject)
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final XMLObject unmarshall(final byte[] samlToken)
+ throws SAMLEngineException {
+ try {
+ // Get parser pool manager
+ final BasicParserPool ppMgr = new BasicParserPool();
+ // Note: this is necessary due to an unresolved Xerces deferred DOM
+ // issue/bug
+ final HashMap<String, Boolean> features = new HashMap<String, Boolean>();
+ features.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
+ ppMgr.setBuilderFeatures(features);
+
+ ppMgr.setNamespaceAware(true);
+
+ // Parse SAMLToken
+ Document document = ppMgr.parse(new ByteArrayInputStream(samlToken));
+ if (document != null){
+ final Element root = document.getDocumentElement();
+ // Get appropriate unmarshaller
+ final UnmarshallerFactory unmarshallerFact = Configuration.getUnmarshallerFactory();
+ // Unmarshall using the SAML Token root element
+ if (unmarshallerFact != null && root != null){
+ final Unmarshaller unmarshaller;
+ if (root.getLocalName().equals(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ unmarshaller = new CustomAttributeQueryUnmarshaller();
+ else
+ unmarshaller = unmarshallerFact.getUnmarshaller(root);
+ try {
+ return unmarshaller.unmarshall(root);
+ } catch (NullPointerException e){
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException", e);
+ }
+ } else {
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException : unmarshallerFact or root is null");
+ }
+ } else {
+ LOG.error("Error element tag incomplet or null.");
+ throw new SAMLEngineException("NullPointerException : document is null");
+ }
+ } catch (XMLParserException e) {
+ LOG.error("XML Parsing Error.", e);
+ throw new SAMLEngineException(e);
+ } catch (UnmarshallingException e) {
+ LOG.error("TransformerException.", e);
+ throw new SAMLEngineException(e);
+ } catch (NullPointerException e) {
+ LOG.error("Error element tag incomplet or null.", e);
+ throw new SAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Method that validates an XML Signature contained in a SAML Token.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the SAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ protected final SAMLObject validateSignature(
+ final SignableSAMLObject samlToken) throws SAMLEngineException {
+
+ LOG.info("Validate Signature");
+ signer.validateSignature(samlToken);
+
+ return samlToken;
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java
index c77cc700a..1efbb8b32 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngineUtils.java
@@ -1,885 +1,833 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.commons.lang.StringUtils;
-import org.joda.time.DateTime;
-import org.opensaml.Configuration;
-import org.opensaml.common.SAMLVersion;
-import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
-import org.opensaml.saml2.common.Extensions;
-import org.opensaml.saml2.common.impl.ExtensionsBuilder;
-import org.opensaml.saml2.core.Assertion;
-import org.opensaml.saml2.core.Attribute;
-import org.opensaml.saml2.core.AttributeQuery;
-import org.opensaml.saml2.core.AttributeValue;
-import org.opensaml.saml2.core.AuthnContext;
-import org.opensaml.saml2.core.AuthnRequest;
-import org.opensaml.saml2.core.AuthnStatement;
-import org.opensaml.saml2.core.Issuer;
-import org.opensaml.saml2.core.LogoutRequest;
-import org.opensaml.saml2.core.LogoutResponse;
-import org.opensaml.saml2.core.NameID;
-import org.opensaml.saml2.core.Response;
-import org.opensaml.saml2.core.Status;
-import org.opensaml.saml2.core.StatusCode;
-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.core.impl.AssertionBuilder;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.schema.XSAny;
-import org.opensaml.xml.schema.XSString;
-import org.opensaml.xml.signature.KeyInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import eu.stork.peps.auth.engine.core.SAMLCore;
-import eu.stork.peps.auth.engine.core.SPApplication;
-import eu.stork.peps.auth.engine.core.SPCountry;
-import eu.stork.peps.auth.engine.core.SPInstitution;
-import eu.stork.peps.auth.engine.core.SPSector;
-import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryBuilder;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * The Class SAMLEngineUtils.
- *
- * @author fjquevedo
- * @author iinigo
- */
-public final class SAMLEngineUtils {
-
- /** The Constant UTF_8. */
- public static final String UTF_8 = "UTF-8";
-
- /** The Constant SHA_512. */
- public static final String SHA_512 = "SHA-512";
-
-
- /** The generator. */
- private static SecureRandomIdentifierGenerator generator;
-
- /** The Constant LOG. */
- private static final Logger LOG = LoggerFactory
- .getLogger(SAMLEngineUtils.class.getName());
-
- /**
- * Method that generates a random value according to NCName grammar.
- *
- * NCName ::= NCNameStartChar NCNameChar* NCNameChar ::= NameChar - ':'
- * NCNameStartChar ::= Letter | '_' NameStartChar ::= ":" | [A-Z] | "_" |
- * [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] |
- * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
- * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
- * NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] |
- * [#x203F-#x2040] Name ::= NameStartChar (NameChar)* Letter ::= BaseChar |
- * Ideographic BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] |
- * [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] |
- * [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] |
- * [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] |
- * [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] |
- * [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 |
- * [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] |
- * [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] |
- * [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] |
- * #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] |
- * [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] |
- * [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] |
- * [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] |
- * [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 |
- * [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] |
- * [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] |
- * [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] |
- * #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] |
- * [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] |
- * #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] |
- * [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D |
- * [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] |
- * [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] |
- * [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] |
- * [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] |
- * [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] |
- * [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE |
- * [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] |
- * [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 |
- * [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 |
- * [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] |
- * [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] |
- * #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] |
- * [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 |
- * [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] |
- * [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 |
- * [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 |
- * #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 |
- * #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] |
- * #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] |
- * [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] |
- * [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] |
- * [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] |
- * [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] |
- * [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E |
- * [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] |
- * [#xAC00-#xD7A3] Ideographic ::= [#x4E00-#x9FA5] | #x3007 |
- * [#x3021-#x3029]
- *
- * @return Random ID value
- */
-
- //Initialization of a generator of identifiers for all token SAML.
-
- static {
- loadRandomIdentifierGenerator();
- }
-
-
- /**
- * Load random identifier generator.
- *
- *@throws STORKSAMLEngineRuntimeException the STORKSAML engine runtime exception
- */
- private static void loadRandomIdentifierGenerator() {
-
- try {
- generator = new SecureRandomIdentifierGenerator();
- } catch (NoSuchAlgorithmException ex) {
- LOG.error("Error init SecureRandomIdentifierGenerator", ex);
- throw new STORKSAMLEngineRuntimeException(ex);
- }
-
- }
-
- /**
- * Creates the SAML object.
- *
- * @param qname the QName
- *
- * @return the XML object
- */
- public static XMLObject createSamlObject(final QName qname) {
- if (qname.toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- CustomAttributeQueryBuilder builder = new CustomAttributeQueryBuilder();
- return builder.buildObject(qname);
- }
- else
- {
- return Configuration.getBuilderFactory().getBuilder(qname).buildObject(
- qname);
- }
- }
-
- /**
- * Creates the SAML object.
- *
- * @param qname the quality name
- * @param qname1 the qname1
- *
- * @return the xML object
- */
- public static XMLObject createSamlObject(final QName qname,
- final QName qname1) {
- return Configuration.getBuilderFactory().getBuilder(qname1)
- .buildObject(qname, qname1);
- }
-
- /**
- * Encode value with an specific algorithm.
- *
- * @param value the value
- * @param alg the algorithm
- *
- * @return the string
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static String encode(final String value, final String alg)
- throws STORKSAMLEngineException {
- LOG.debug("Encode value with " + alg + " algorithm.");
- byte[] buffer;
-
- final StringBuffer hash = new StringBuffer("");
- try {
- buffer = value.getBytes(UTF_8);
- MessageDigest msgDig;
- msgDig = MessageDigest.getInstance(alg);
-
-
- msgDig.update(buffer);
- final byte[] digest = msgDig.digest();
-
- final int signedByte = 0xff;
- for (byte aux : digest) {
- final int byt = aux & signedByte;
- if (Integer.toHexString(byt).length() == 1) {
- hash.append('0');
- }
- hash.append(Integer.toHexString(byt));
- }
-
- } catch (UnsupportedEncodingException e1) {
- LOG.error("UnsupportedEncodingException: " + UTF_8);
- throw new STORKSAMLEngineException(e1);
- } catch (NoSuchAlgorithmException e) {
- LOG.error("NoSuchAlgorithmException: " + alg);
- throw new STORKSAMLEngineException(e);
- }
-
- return hash.toString();
- }
-
- /**
- * Generate assertion.
- *
- * @param version the version
- * @param identifier the identifier
- * @param issueInstant the issue instant
- * @param issuer the issuer
- *
- * @return the assertion
- */
- public static Assertion generateAssertion(final SAMLVersion version,
- final String identifier, final DateTime issueInstant,
- final Issuer issuer) {
- final AssertionBuilder assertionBuilder = new AssertionBuilder();
- final Assertion assertion = assertionBuilder.buildObject();
- assertion.setVersion(version);
- assertion.setID(identifier);
- assertion.setIssueInstant(issueInstant);
-
- // <saml:Issuer>
- assertion.setIssuer(issuer);
- return assertion;
- }
-
- /**
- * Generate authentication statement.
- *
- * @param authnInstant the authentication instant
- * @param authnContext the authentication context
- *
- * @return the authentication statement
- */
- public static AuthnStatement generateAthnStatement(final DateTime authnInstant,
- final AuthnContext authnContext) {
- // <saml:AuthnStatement>
- final AuthnStatement authnStatement = (AuthnStatement) SAMLEngineUtils
- .createSamlObject(AuthnStatement.DEFAULT_ELEMENT_NAME);
-
- authnStatement.setAuthnInstant(authnInstant);
- authnStatement.setAuthnContext(authnContext);
-
- return authnStatement;
- }
-
-
-
-
-
- /**
- * Generate attribute from a list of values.
- *
- * @param name the name of the attribute.
- * @param status the status of the parameter: "Available", "NotAvailable" or
- * "Withheld".
- * @param values the value of the attribute.
- * @param isHashing the is hashing with "SHA-512" algorithm.
- * @return the attribute
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static Attribute generateAttrComplex(final String name,
- final String status, final Map<String, String> values,
- final boolean isHashing) throws STORKSAMLEngineException {
- LOG.debug("Generate attribute complex: " + name);
- final Attribute attribute = (Attribute) SAMLEngineUtils
- .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
-
- attribute.setName(name);
- attribute.setNameFormat(Attribute.URI_REFERENCE);
-
- attribute.getUnknownAttributes().put(
- new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
- SAMLCore.STORK10_PREFIX.getValue()), status);
-
- if (!values.isEmpty()) {
- LOG.debug("Add attribute values.");
-
- // Create an attribute that contains all XSAny elements.
- final XSAny attrValue = (XSAny) SAMLEngineUtils.createSamlObject(
- AttributeValue.DEFAULT_ELEMENT_NAME, XSAny.TYPE_NAME);
-
- final Iterator<Entry<String, String>> iterator = values.entrySet()
- .iterator();
- while (iterator.hasNext()) {
- final Map.Entry<String, String> pairs = iterator.next();
-
- final String value = pairs.getValue();
-
- if (StringUtils.isNotBlank(value)) {
- // Create the attribute statement
- final XSAny attrValueSimple = (XSAny) SAMLEngineUtils
- .createSamlObject(new QName(SAMLCore.STORK10_NS.getValue(),
- pairs.getKey().toString(),
- SAMLCore.STORK10_PREFIX.getValue()), XSAny.TYPE_NAME);
-
- // if it's necessary encode the information.
- if (isHashing) {
- attrValueSimple
- .setTextContent(encode(value, SHA_512));
- } else {
- attrValueSimple.setTextContent(value);
- }
-
- attrValue.getUnknownXMLObjects().add(attrValueSimple);
- attribute.getAttributeValues().add(attrValue);
- }
- }
-
- }
- return attribute;
- }
-
- /**
- * Generate extension.
- *
- * @return the extensions
- */
- public static Extensions generateExtension() {
- final ExtensionsBuilder extensionsBuilder = new ExtensionsBuilder();
- return extensionsBuilder.buildObject(
- "urn:oasis:names:tc:SAML:2.0:protocol", "Extensions", "saml2p");
- }
-
-
-
-
- /**
- * Generate issuer.
- *
- * @return the issuer
- */
- public static Issuer generateIssuer() {
- return (Issuer) SAMLEngineUtils
- .createSamlObject(Issuer.DEFAULT_ELEMENT_NAME);
- }
-
- /**
- * Generate key info.
- *
- * @return the key info
- */
- public static KeyInfo generateKeyInfo() {
- return (KeyInfo) SAMLEngineUtils
- .createSamlObject(KeyInfo.DEFAULT_ELEMENT_NAME);
- }
-
- /**
- * Generate name id.
- *
- * @return the name id
- */
- public static NameID generateNameID() {
- return (NameID) SAMLEngineUtils
- .createSamlObject(NameID.DEFAULT_ELEMENT_NAME);
- }
-
- /**
- * Generate name id.
- *
- * @param nameQualifier the name qualifier
- * @param format the format
- * @param spNameQualifier the sP name qualifier
- *
- * @return the name id
- */
- public static NameID generateNameID(final String nameQualifier,
- final String format, final String spNameQualifier) {
- // <saml:NameID>
- final NameID nameId = (NameID) Configuration.getBuilderFactory()
- .getBuilder(NameID.DEFAULT_ELEMENT_NAME).buildObject(
- NameID.DEFAULT_ELEMENT_NAME);
-
- // optional
- nameId.setNameQualifier(nameQualifier);
-
- // optional
- nameId.setFormat(format);
-
- // optional
- nameId.setSPNameQualifier(spNameQualifier);
-
- return nameId;
- }
-
- /**
- * Generate NCName.
- *
- * @return the string
- */
- public static String generateNCName() {
- return generator.generateIdentifier();
- }
-
-
- /**
- * Generate the quality authentication assurance level.
- *
- * @param qaal the level of quality authentication assurance.
- *
- * @return the quality authentication assurance attribute
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static QAAAttribute generateQAAAttribute(final int qaal)
- throws STORKSAMLEngineException {
- LOG.debug("Generate QAAAttribute.");
-
- final QAAAttribute qaaAttribute = (QAAAttribute) SAMLEngineUtils
- .createSamlObject(QAAAttribute.DEF_ELEMENT_NAME);
- qaaAttribute.setQaaLevel(String.valueOf(qaal));
- return qaaAttribute;
- }
-
- /**
- * Generate requested attribute.
- *
- * @param name the name
- * @param friendlyName the friendly name
- * @param isRequired the is required
- * @param value the value
- *
- * @return the requested attribute
- */
- public static RequestedAttribute generateReqAuthnAttributeSimple(
- final String name, final String friendlyName,
- final String isRequired, final List<String> value) {
- LOG.debug("Generate the requested attribute.");
-
- final RequestedAttribute requested = (RequestedAttribute) SAMLEngineUtils
- .createSamlObject(RequestedAttribute.DEF_ELEMENT_NAME);
- requested.setName(name);
- requested.setNameFormat(RequestedAttribute.URI_REFERENCE);
-
- requested.setFriendlyName(friendlyName);
-
- requested.setIsRequired(isRequired);
-
- // The value is optional in an authentication request.
- if (!value.isEmpty()) {
- for (int nextValue = 0; nextValue < value.size(); nextValue++) {
- final String valor = value.get(nextValue);
- if (StringUtils.isNotBlank(valor)) {
-
- if(!name.equals("http://www.stork.gov.eu/1.0/signedDoc")){
-
- // Create the attribute statement
- final XSAny attrValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- new QName(SAMLCore.STORK10_NS.getValue(),
- "AttributeValue",
- SAMLCore.STORK10_PREFIX.getValue()),
- XSAny.TYPE_NAME);
-
- attrValue.setTextContent(valor.trim());
- requested.getAttributeValues().add(attrValue);
-
- }else{
-
- DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
- domFactory.setNamespaceAware(true);
- Document document = null;
- DocumentBuilder builder;
-
- // Parse the signedDoc value into an XML DOM Document
- try {
- builder = domFactory.newDocumentBuilder();
- InputStream is;
- is = new ByteArrayInputStream(valor.trim().getBytes("UTF-8"));
- document = builder.parse(is);
- is.close();
- } catch (SAXException e1) {
- LOG.error("SAX Error while parsing signModule attribute", e1);
- throw new STORKSAMLEngineRuntimeException(e1);
- } catch (ParserConfigurationException e2) {
- LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
- throw new STORKSAMLEngineRuntimeException(e2);
- } catch (UnsupportedEncodingException e3) {
- LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
- throw new STORKSAMLEngineRuntimeException(e3);
- } catch (IOException e4) {
- LOG.error("IO Error while parsing signModule attribute", e4);
- throw new STORKSAMLEngineRuntimeException(e4);
- }
-
- // Create the XML statement(this will be overwritten with the previous DOM structure)
- final XSAny xmlValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- new QName(SAMLCore.STORK10_NS.getValue(),
- "XMLValue",
- SAMLCore.STORK10_PREFIX.getValue()),
- XSAny.TYPE_NAME);
-
- //Set the signedDoc XML content to this element
- xmlValue.setDOM(document.getDocumentElement());
-
- // Create the attribute statement
- final XSAny attrValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- new QName(SAMLCore.STORK10_NS.getValue(),
- "AttributeValue",
- SAMLCore.STORK10_PREFIX.getValue()),
- XSAny.TYPE_NAME);
-
- //Add previous signedDocXML to the AttributeValue Element
- attrValue.getUnknownXMLObjects().add(xmlValue);
-
- requested.getAttributeValues().add(attrValue);
- }
-
-
- }
- }
- }
-
- return requested;
- }
-
- /**
- * Generate response.
- *
- * @param version the version
- * @param identifier the identifier
- * @param issueInstant the issue instant
- * @param status the status
- *
- * @return the response
- */
- public static Response generateResponse(final SAMLVersion version,
- final String identifier, final DateTime issueInstant,
- final Status status) {
- final Response response = (Response) SAMLEngineUtils
- .createSamlObject(Response.DEFAULT_ELEMENT_NAME);
- response.setID(identifier);
- response.setIssueInstant(issueInstant);
- response.setStatus(status);
- return response;
- }
-
- /**
- * Method that generates a SAML Authentication Request basing on the
- * provided information.
- *
- * @param identifier the identifier
- * @param version the version
- * @param issueInstant the issue instant
- *
- * @return the authentication request
- */
- public static AuthnRequest generateSAMLAuthnRequest(final String identifier,
- final SAMLVersion version, final DateTime issueInstant) {
- LOG.debug("Generate basic authentication request.");
- final AuthnRequest authnRequest = (AuthnRequest) SAMLEngineUtils
- .createSamlObject(AuthnRequest.DEFAULT_ELEMENT_NAME);
-
- authnRequest.setID(identifier);
- authnRequest.setVersion(version);
- authnRequest.setIssueInstant(issueInstant);
- return authnRequest;
- }
-
- /*public static AttributeQuery generateSAMLAttrQueryRequest(final String identifier,
- final SAMLVersion version, final DateTime issueInstant) {
- LOG.debug("Generate attribute query request.");
- final AttributeQuery attrQueryRequest = (AttributeQuery) SAMLEngineUtils
- .createSamlObject(AttributeQuery.DEFAULT_ELEMENT_NAME);
-
- attrQueryRequest.setID(identifier);
- attrQueryRequest.setVersion(version);
- attrQueryRequest.setIssueInstant(issueInstant);
- return attrQueryRequest;
- }*/
-
- public static CustomAttributeQuery generateSAMLAttrQueryRequest(final String identifier,
- final SAMLVersion version, final DateTime issueInstant) {
- LOG.debug("Generate attribute query request.");
- final CustomAttributeQuery attrQueryRequest = (CustomAttributeQuery) SAMLEngineUtils
- .createSamlObject(CustomAttributeQuery.DEFAULT_ELEMENT_NAME);
-
- attrQueryRequest.setID(identifier);
- attrQueryRequest.setVersion(version);
- attrQueryRequest.setIssueInstant(issueInstant);
- return attrQueryRequest;
- }
-
- public static LogoutRequest generateSAMLLogoutRequest(final String identifier,
- final SAMLVersion version, final DateTime issueInstant) {
- LOG.debug("Generate logout request.");
- final LogoutRequest logoutRequest = (LogoutRequest)SAMLEngineUtils.
- createSamlObject(LogoutRequest.DEFAULT_ELEMENT_NAME);
-
-
- logoutRequest.setID(identifier);
- logoutRequest.setVersion(version);
- logoutRequest.setIssueInstant(issueInstant);
- return logoutRequest;
- }
-
- public static LogoutResponse generateSAMLLogoutResponse(final String identifier,
- final SAMLVersion version, final DateTime issueInstant,
- final Status status, final String inResponseTo) {
- LOG.debug("Generate logout response.");
- final LogoutResponse logoutResponse = (LogoutResponse)SAMLEngineUtils.
- createSamlObject(LogoutResponse.DEFAULT_ELEMENT_NAME);
-
- logoutResponse.setInResponseTo(inResponseTo);
- logoutResponse.setStatus(status);
- logoutResponse.setID(identifier);
- logoutResponse.setVersion(version);
- logoutResponse.setIssueInstant(issueInstant);
- return logoutResponse;
- }
-
- /**
- * Generate service provider application.
- *
- * @param spApplication the service provider application
- *
- * @return the sP application
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static SPApplication generateSPApplication(final String spApplication)
- throws STORKSAMLEngineException {
- LOG.debug("Generate SPApplication.");
-
- final SPApplication applicationAttr = (SPApplication) SAMLEngineUtils
- .createSamlObject(SPApplication.DEF_ELEMENT_NAME);
- applicationAttr.setSPApplication(spApplication);
- return applicationAttr;
- }
-
- /**
- * Generate service provider country.
- *
- * @param spCountry the service provider country
- *
- * @return the service provider country
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static SPCountry generateSPCountry(final String spCountry)
- throws STORKSAMLEngineException {
- LOG.debug("Generate SPApplication.");
-
- final SPCountry countryAttribute = (SPCountry) SAMLEngineUtils
- .createSamlObject(SPCountry.DEF_ELEMENT_NAME);
- countryAttribute.setSPCountry(spCountry);
- return countryAttribute;
- }
-
- /**
- * Generate service provider institution.
- *
- * @param spInstitution the service provider institution
- *
- * @return the service provider institution
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static SPInstitution generateSPInstitution(final String spInstitution)
- throws STORKSAMLEngineException {
- LOG.debug("Generate SPInstitution.");
-
- final SPInstitution institutionAttr = (SPInstitution) SAMLEngineUtils
- .createSamlObject(SPInstitution.DEF_ELEMENT_NAME);
- institutionAttr.setSPInstitution(spInstitution);
- return institutionAttr;
- }
-
- /**
- * Generate service provider sector.
- *
- * @param spSector the service provider sector
- *
- * @return the service provider sector
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static SPSector generateSPSector(final String spSector)
- throws STORKSAMLEngineException {
- LOG.debug("Generate SPSector.");
-
- final SPSector sectorAttribute = (SPSector) SAMLEngineUtils
- .createSamlObject(SPSector.DEF_ELEMENT_NAME);
- sectorAttribute.setSPSector(spSector);
- return sectorAttribute;
- }
-
- /**
- * Generate status.
- *
- * @param statusCode the status code
- *
- * @return the status
- */
- public static Status generateStatus(final StatusCode statusCode) {
- final Status status = (Status) SAMLEngineUtils
- .createSamlObject(Status.DEFAULT_ELEMENT_NAME);
- status.setStatusCode(statusCode);
- return status;
- }
-
- /**
- * Generate status code.
- *
- * @param value the value
- *
- * @return the status code
- */
- public static StatusCode generateStatusCode(final String value) {
- final StatusCode statusCode = (StatusCode) SAMLEngineUtils
- .createSamlObject(StatusCode.DEFAULT_ELEMENT_NAME);
- statusCode.setValue(value);
- return statusCode;
- }
-
-
- /**
- * Generate status message.
- *
- * @param message the message
- *
- * @return the status message
- */
- public static StatusMessage generateStatusMessage(final String message) {
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .createSamlObject(StatusMessage.DEFAULT_ELEMENT_NAME);
- statusMessage.setMessage(message);
- return statusMessage;
- }
-
- /**
- * Generate subject.
- *
- * @return the subject
- */
- public static Subject generateSubject() {
- return (Subject) SAMLEngineUtils
- .createSamlObject(Subject.DEFAULT_ELEMENT_NAME);
- }
-
- /**
- * Generate subject confirmation.
- *
- * @param method the method
- * @param data the data
- *
- * @return the subject confirmation
- */
- public static SubjectConfirmation generateSubjectConfirmation(
- final String method, final SubjectConfirmationData data) {
- final SubjectConfirmation subjectConf = (SubjectConfirmation) Configuration
- .getBuilderFactory().getBuilder(
- SubjectConfirmation.DEFAULT_ELEMENT_NAME).buildObject(
- SubjectConfirmation.DEFAULT_ELEMENT_NAME);
-
- subjectConf.setMethod(method);
-
- subjectConf.setSubjectConfirmationData(data);
-
- return subjectConf;
- }
-
-
- /**
- * Generate subject confirmation data.
- *
- * @param notOnOrAfter the not on or after
- * @param recipient the recipient
- * @param inResponseTo the in response to
- *
- * @return the subject confirmation data
- */
- public static SubjectConfirmationData generateSubjectConfirmationData(
- final DateTime notOnOrAfter, final String recipient,
- final String inResponseTo) {
- final SubjectConfirmationData subjectConfData = (SubjectConfirmationData) SAMLEngineUtils
- .createSamlObject(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
- subjectConfData.setNotOnOrAfter(notOnOrAfter);
- subjectConfData.setRecipient(recipient);
- subjectConfData.setInResponseTo(inResponseTo);
- return subjectConfData;
- }
-
-
- /**
- * Generate subject locality.
- *
- * @param address the address
- *
- * @return the subject locality
- */
- public static SubjectLocality generateSubjectLocality(final String address) {
- final SubjectLocality subjectLocality = (SubjectLocality) SAMLEngineUtils
- .createSamlObject(SubjectLocality.DEFAULT_ELEMENT_NAME);
- subjectLocality.setAddress(address);
- return subjectLocality;
- }
-
-
-
-
- /**
- * Method that returns the current time.
- *
- * @return the current time
- */
- public static DateTime getCurrentTime() {
- return new DateTime();
- }
-
-
- /**
- * Instantiates a new SAML engine utilities.
- */
- private SAMLEngineUtils() {
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.lang.StringUtils;
+import org.joda.time.DateTime;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.common.impl.ExtensionsBuilder;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.AttributeValue;
+import org.opensaml.saml2.core.AuthnContext;
+import org.opensaml.saml2.core.AuthnRequest;
+import org.opensaml.saml2.core.AuthnStatement;
+import org.opensaml.saml2.core.Issuer;
+import org.opensaml.saml2.core.LogoutRequest;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.saml2.core.Status;
+import org.opensaml.saml2.core.StatusCode;
+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.core.impl.AssertionBuilder;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSAny;
+import org.opensaml.xml.signature.KeyInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.SPApplication;
+import eu.stork.peps.auth.engine.core.SPCountry;
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import eu.stork.peps.auth.engine.core.SPSector;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryBuilder;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class SAMLEngineUtils.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ *
+ */
+public final class SAMLEngineUtils {
+
+ /** The Constant UTF_8. */
+ public static final String UTF_8 = "UTF-8";
+
+ /** The Constant SHA_512. */
+ public static final String SHA_512 = "SHA-512";
+
+ /** The generator. */
+ private static SecureRandomIdentifierGenerator generator;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(SAMLEngineUtils.class.getName());
+
+ /**
+ * Method that generates a random value according to NCName grammar.
+ *
+ * NCName ::= NCNameStartChar NCNameChar* NCNameChar ::= NameChar - ':'
+ * NCNameStartChar ::= Letter | '_' NameStartChar ::= ":" | [A-Z] | "_" |
+ * [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] |
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+ * NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] |
+ * [#x203F-#x2040] Name ::= NameStartChar (NameChar)* Letter ::= BaseChar |
+ * Ideographic BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] |
+ * [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] |
+ * [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-#x01C3] |
+ * [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8] |
+ * [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] |
+ * [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 |
+ * [#x03E2-#x03F3] | [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] |
+ * [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] |
+ * [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] |
+ * #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] |
+ * [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] |
+ * [#x06C0-#x06CE] | [#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] |
+ * [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C] |
+ * [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 |
+ * [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] |
+ * [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] |
+ * [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39] | [#x0A59-#x0A5C] |
+ * #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] |
+ * [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] |
+ * #x0ABD | #x0AE0 | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] |
+ * [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D |
+ * [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] |
+ * [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] |
+ * [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] |
+ * [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] |
+ * [#x0C35-#x0C39] | [#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] |
+ * [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE |
+ * [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] |
+ * [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 |
+ * [#x0E32-#x0E33] | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 |
+ * [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] |
+ * [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] |
+ * #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] |
+ * [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 |
+ * [#x1102-#x1103] | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] |
+ * [#x110E-#x1112] | #x113C | #x113E | #x1140 | #x114C | #x114E | #x1150 |
+ * [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165 | #x1167 |
+ * #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 |
+ * #x11AB | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] |
+ * #x11EB | #x11F0 | #x11F9 | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] |
+ * [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] |
+ * [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] |
+ * [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] |
+ * [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] |
+ * [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 | [#x212A-#x212B] | #x212E |
+ * [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA] | [#x3105-#x312C] |
+ * [#xAC00-#xD7A3] Ideographic ::= [#x4E00-#x9FA5] | #x3007 |
+ * [#x3021-#x3029]
+ *
+ * @return Random ID value
+ */
+
+ //Initialization of a generator of identifiers for all token SAML.
+ static {
+ loadRandomIdentifierGenerator();
+ }
+
+ /**
+ * Load random identifier generator.
+ *
+ *@throws STORKSAMLEngineRuntimeException the STORKSAML engine runtime exception
+ */
+ private static void loadRandomIdentifierGenerator() {
+ try {
+ generator = new SecureRandomIdentifierGenerator();
+ } catch (NoSuchAlgorithmException ex) {
+ LOG.error("Error init SecureRandomIdentifierGenerator", ex);
+ throw new STORKSAMLEngineRuntimeException(ex);
+ }
+
+ }
+
+ /**
+ * Creates the SAML object.
+ *
+ * @param qname the QName
+ *
+ * @return the XML object
+ */
+ public static XMLObject createSamlObject(final QName qname) {
+ if (qname.toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ CustomAttributeQueryBuilder builder = new CustomAttributeQueryBuilder();
+ return builder.buildObject(qname);
+ }
+ else
+ {
+ return Configuration.getBuilderFactory().getBuilder(qname).buildObject(
+ qname);
+ }
+ }
+
+ /**
+ * Creates the SAML object.
+ *
+ * @param qname the quality name
+ * @param qname1 the qname1
+ *
+ * @return the xML object
+ */
+ public static XMLObject createSamlObject(final QName qname,
+ final QName qname1) {
+ return Configuration.getBuilderFactory().getBuilder(qname1)
+ .buildObject(qname, qname1);
+ }
+
+ /**
+ * Encode value with an specific algorithm.
+ *
+ * @param value the value
+ * @param alg the algorithm
+ *
+ * @return the string
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static String encode(final String value, final String alg)
+ throws STORKSAMLEngineException {
+ LOG.debug("Encode value with " + alg + " algorithm.");
+ byte[] buffer;
+ final StringBuffer hash = new StringBuffer("");
+ try {
+ buffer = value.getBytes(UTF_8);
+ MessageDigest msgDig;
+ msgDig = MessageDigest.getInstance(alg);
+ msgDig.update(buffer);
+ final byte[] digest = msgDig.digest();
+ final int signedByte = 0xff;
+ for (byte aux : digest) {
+ final int byt = aux & signedByte;
+ if (Integer.toHexString(byt).length() == 1) {
+ hash.append('0');
+ }
+ hash.append(Integer.toHexString(byt));
+ }
+ } catch (UnsupportedEncodingException e1) {
+ LOG.error("UnsupportedEncodingException: " + UTF_8);
+ throw new STORKSAMLEngineException(e1);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("NoSuchAlgorithmException: " + alg);
+ throw new STORKSAMLEngineException(e);
+ }
+ return hash.toString();
+ }
+
+ /**
+ * Generate assertion.
+ *
+ * @param version the version
+ * @param identifier the identifier
+ * @param issueInstant the issue instant
+ * @param issuer the issuer
+ *
+ * @return the assertion
+ */
+ public static Assertion generateAssertion(final SAMLVersion version,
+ final String identifier, final DateTime issueInstant,
+ final Issuer issuer) {
+ final AssertionBuilder assertionBuilder = new AssertionBuilder();
+ final Assertion assertion = assertionBuilder.buildObject();
+ assertion.setVersion(version);
+ assertion.setID(identifier);
+ assertion.setIssueInstant(issueInstant);
+ // <saml:Issuer>
+ assertion.setIssuer(issuer);
+ return assertion;
+ }
+
+ /**
+ * Generate authentication statement.
+ *
+ * @param authnInstant the authentication instant
+ * @param authnContext the authentication context
+ *
+ * @return the authentication statement
+ */
+ public static AuthnStatement generateAthnStatement(final DateTime authnInstant,
+ final AuthnContext authnContext) {
+ // <saml:AuthnStatement>
+ final AuthnStatement authnStatement = (AuthnStatement) SAMLEngineUtils
+ .createSamlObject(AuthnStatement.DEFAULT_ELEMENT_NAME);
+ authnStatement.setAuthnInstant(authnInstant);
+ authnStatement.setAuthnContext(authnContext);
+ return authnStatement;
+ }
+
+ /**
+ * Generate attribute from a list of values.
+ *
+ * @param name the name of the attribute.
+ * @param status the status of the parameter: "Available", "NotAvailable" or
+ * "Withheld".
+ * @param values the value of the attribute.
+ * @param isHashing the is hashing with "SHA-512" algorithm.
+ * @return the attribute
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Attribute generateAttrComplex(final String name,
+ final String status, final Map<String, String> values,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute complex: " + name);
+ final Attribute attribute = (Attribute) SAMLEngineUtils
+ .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
+
+ attribute.setName(name);
+ attribute.setNameFormat(Attribute.URI_REFERENCE);
+ attribute.getUnknownAttributes().put(
+ new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
+ SAMLCore.STORK10_PREFIX.getValue()), status);
+
+ if (!values.isEmpty()) {
+ LOG.debug("Add attribute values.");
+ // Create an attribute that contains all XSAny elements.
+ final XSAny attrValue = (XSAny) SAMLEngineUtils.createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME, XSAny.TYPE_NAME);
+ final Iterator<Entry<String, String>> iterator = values.entrySet()
+ .iterator();
+ while (iterator.hasNext()) {
+ final Map.Entry<String, String> pairs = iterator.next();
+ final String value = pairs.getValue();
+
+ if (StringUtils.isNotBlank(value)) {
+ // Create the attribute statement
+ final XSAny attrValueSimple = (XSAny) SAMLEngineUtils
+ .createSamlObject(new QName(SAMLCore.STORK10_NS.getValue(),
+ pairs.getKey().toString(),
+ SAMLCore.STORK10_PREFIX.getValue()), XSAny.TYPE_NAME);
+ // if it's necessary encode the information.
+ if (isHashing) {
+ attrValueSimple
+ .setTextContent(encode(value, SHA_512));
+ } else {
+ attrValueSimple.setTextContent(value);
+ }
+ attrValue.getUnknownXMLObjects().add(attrValueSimple);
+ attribute.getAttributeValues().add(attrValue);
+ }
+ }
+
+ }
+ return attribute;
+ }
+
+ /**
+ * Generate extension.
+ *
+ * @return the extensions
+ */
+ public static Extensions generateExtension() {
+ final ExtensionsBuilder extensionsBuilder = new ExtensionsBuilder();
+ return extensionsBuilder.buildObject(
+ "urn:oasis:names:tc:SAML:2.0:protocol", "Extensions", "saml2p");
+ }
+
+ /**
+ * Generate issuer.
+ *
+ * @return the issuer
+ */
+ public static Issuer generateIssuer() {
+ return (Issuer) SAMLEngineUtils
+ .createSamlObject(Issuer.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate key info.
+ *
+ * @return the key info
+ */
+ public static KeyInfo generateKeyInfo() {
+ return (KeyInfo) SAMLEngineUtils
+ .createSamlObject(KeyInfo.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate name id.
+ *
+ * @return the name id
+ */
+ public static NameID generateNameID() {
+ return (NameID) SAMLEngineUtils
+ .createSamlObject(NameID.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate name id.
+ *
+ * @param nameQualifier the name qualifier
+ * @param format the format
+ * @param spNameQualifier the sP name qualifier
+ *
+ * @return the name id
+ */
+ public static NameID generateNameID(final String nameQualifier,
+ final String format, final String spNameQualifier) {
+ // <saml:NameID>
+ final NameID nameId = (NameID) Configuration.getBuilderFactory()
+ .getBuilder(NameID.DEFAULT_ELEMENT_NAME).buildObject(
+ NameID.DEFAULT_ELEMENT_NAME);
+ // optional
+ nameId.setNameQualifier(nameQualifier);
+ // optional
+ nameId.setFormat(format);
+ // optional
+ nameId.setSPNameQualifier(spNameQualifier);
+ return nameId;
+ }
+
+ /**
+ * Generate NCName.
+ *
+ * @return the string
+ */
+ public static String generateNCName() {
+ return generator.generateIdentifier();
+ }
+
+ /**
+ * Generate the quality authentication assurance level.
+ *
+ * @param qaal the level of quality authentication assurance.
+ *
+ * @return the quality authentication assurance attribute
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static QAAAttribute generateQAAAttribute(final int qaal)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate QAAAttribute.");
+
+ final QAAAttribute qaaAttribute = (QAAAttribute) SAMLEngineUtils
+ .createSamlObject(QAAAttribute.DEF_ELEMENT_NAME);
+ qaaAttribute.setQaaLevel(String.valueOf(qaal));
+ return qaaAttribute;
+ }
+
+ /**
+ * Generate requested attribute.
+ *
+ * @param name the name
+ * @param friendlyName the friendly name
+ * @param isRequired the is required
+ * @param value the value
+ *
+ * @return the requested attribute
+ */
+ public static RequestedAttribute generateReqAuthnAttributeSimple(
+ final String name, final String friendlyName,
+ final String isRequired, final List<String> value) {
+ LOG.debug("Generate the requested attribute.");
+
+ final RequestedAttribute requested = (RequestedAttribute) SAMLEngineUtils
+ .createSamlObject(RequestedAttribute.DEF_ELEMENT_NAME);
+ requested.setName(name);
+ requested.setNameFormat(RequestedAttribute.URI_REFERENCE);
+
+ requested.setFriendlyName(friendlyName);
+
+ requested.setIsRequired(isRequired);
+
+ // The value is optional in an authentication request.
+ if (!value.isEmpty()) {
+ for (int nextValue = 0; nextValue < value.size(); nextValue++) {
+ final String valor = value.get(nextValue);
+ if (StringUtils.isNotBlank(valor)) {
+
+ if(!name.equals("http://www.stork.gov.eu/1.0/signedDoc")){
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ attrValue.setTextContent(valor.trim());
+ requested.getAttributeValues().add(attrValue);
+
+ }else{
+
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true);
+ Document document = null;
+ DocumentBuilder builder;
+
+ // Parse the signedDoc value into an XML DOM Document
+ try {
+ builder = domFactory.newDocumentBuilder();
+ InputStream is;
+ is = new ByteArrayInputStream(valor.trim().getBytes(UTF_8));
+ document = builder.parse(is);
+ is.close();
+ } catch (SAXException e1) {
+ LOG.error("SAX Error while parsing signModule attribute", e1);
+ throw new STORKSAMLEngineRuntimeException(e1);
+ } catch (ParserConfigurationException e2) {
+ LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
+ throw new STORKSAMLEngineRuntimeException(e2);
+ } catch (UnsupportedEncodingException e3) {
+ LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
+ throw new STORKSAMLEngineRuntimeException(e3);
+ } catch (IOException e4) {
+ LOG.error("IO Error while parsing signModule attribute", e4);
+ throw new STORKSAMLEngineRuntimeException(e4);
+ }
+
+ // Create the XML statement(this will be overwritten with the previous DOM structure)
+ final XSAny xmlValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "XMLValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ //Set the signedDoc XML content to this element
+ xmlValue.setDOM(document.getDocumentElement());
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeValue",
+ SAMLCore.STORK10_PREFIX.getValue()),
+ XSAny.TYPE_NAME);
+
+ //Add previous signedDocXML to the AttributeValue Element
+ attrValue.getUnknownXMLObjects().add(xmlValue);
+
+ requested.getAttributeValues().add(attrValue);
+ }
+
+
+ }
+ }
+ }
+
+ return requested;
+ }
+
+ /**
+ * Generate response.
+ *
+ * @param version the version
+ * @param identifier the identifier
+ * @param issueInstant the issue instant
+ * @param status the status
+ *
+ * @return the response
+ */
+ public static Response generateResponse(final SAMLVersion version,
+ final String identifier, final DateTime issueInstant,
+ final Status status) {
+ final Response response = (Response) SAMLEngineUtils
+ .createSamlObject(Response.DEFAULT_ELEMENT_NAME);
+ response.setID(identifier);
+ response.setIssueInstant(issueInstant);
+ response.setStatus(status);
+ return response;
+ }
+
+ /**
+ * Method that generates a SAML Authentication Request basing on the
+ * provided information.
+ *
+ * @param identifier the identifier
+ * @param version the version
+ * @param issueInstant the issue instant
+ *
+ * @return the authentication request
+ */
+ public static AuthnRequest generateSAMLAuthnRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate basic authentication request.");
+ final AuthnRequest authnRequest = (AuthnRequest) SAMLEngineUtils
+ .createSamlObject(AuthnRequest.DEFAULT_ELEMENT_NAME);
+
+ authnRequest.setID(identifier);
+ authnRequest.setVersion(version);
+ authnRequest.setIssueInstant(issueInstant);
+ return authnRequest;
+ }
+
+ public static CustomAttributeQuery generateSAMLAttrQueryRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate attribute query request.");
+ final CustomAttributeQuery attrQueryRequest = (CustomAttributeQuery) SAMLEngineUtils
+ .createSamlObject(CustomAttributeQuery.DEFAULT_ELEMENT_NAME);
+
+ attrQueryRequest.setID(identifier);
+ attrQueryRequest.setVersion(version);
+ attrQueryRequest.setIssueInstant(issueInstant);
+ return attrQueryRequest;
+ }
+
+ public static LogoutRequest generateSAMLLogoutRequest(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant) {
+ LOG.debug("Generate logout request.");
+ final LogoutRequest logoutRequest = (LogoutRequest)SAMLEngineUtils.
+ createSamlObject(LogoutRequest.DEFAULT_ELEMENT_NAME);
+
+
+ logoutRequest.setID(identifier);
+ logoutRequest.setVersion(version);
+ logoutRequest.setIssueInstant(issueInstant);
+ return logoutRequest;
+ }
+
+ public static LogoutResponse generateSAMLLogoutResponse(final String identifier,
+ final SAMLVersion version, final DateTime issueInstant,
+ final Status status, final String inResponseTo) {
+ LOG.debug("Generate logout response.");
+ final LogoutResponse logoutResponse = (LogoutResponse)SAMLEngineUtils.
+ createSamlObject(LogoutResponse.DEFAULT_ELEMENT_NAME);
+
+ logoutResponse.setInResponseTo(inResponseTo);
+ logoutResponse.setStatus(status);
+ logoutResponse.setID(identifier);
+ logoutResponse.setVersion(version);
+ logoutResponse.setIssueInstant(issueInstant);
+ return logoutResponse;
+ }
+
+ /**
+ * Generate service provider application.
+ *
+ * @param spApplication the service provider application
+ *
+ * @return the sP application
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPApplication generateSPApplication(final String spApplication)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPApplication.");
+
+ final SPApplication applicationAttr = (SPApplication) SAMLEngineUtils
+ .createSamlObject(SPApplication.DEF_ELEMENT_NAME);
+ applicationAttr.setSPApplication(spApplication);
+ return applicationAttr;
+ }
+
+ /**
+ * Generate service provider country.
+ *
+ * @param spCountry the service provider country
+ *
+ * @return the service provider country
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPCountry generateSPCountry(final String spCountry)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPApplication.");
+
+ final SPCountry countryAttribute = (SPCountry) SAMLEngineUtils
+ .createSamlObject(SPCountry.DEF_ELEMENT_NAME);
+ countryAttribute.setSPCountry(spCountry);
+ return countryAttribute;
+ }
+
+ /**
+ * Generate service provider institution.
+ *
+ * @param spInstitution the service provider institution
+ *
+ * @return the service provider institution
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPInstitution generateSPInstitution(final String spInstitution)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPInstitution.");
+
+ final SPInstitution institutionAttr = (SPInstitution) SAMLEngineUtils
+ .createSamlObject(SPInstitution.DEF_ELEMENT_NAME);
+ institutionAttr.setSPInstitution(spInstitution);
+ return institutionAttr;
+ }
+
+ /**
+ * Generate service provider sector.
+ *
+ * @param spSector the service provider sector
+ *
+ * @return the service provider sector
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SPSector generateSPSector(final String spSector)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate SPSector.");
+
+ final SPSector sectorAttribute = (SPSector) SAMLEngineUtils
+ .createSamlObject(SPSector.DEF_ELEMENT_NAME);
+ sectorAttribute.setSPSector(spSector);
+ return sectorAttribute;
+ }
+
+ /**
+ * Generate status.
+ *
+ * @param statusCode the status code
+ *
+ * @return the status
+ */
+ public static Status generateStatus(final StatusCode statusCode) {
+ final Status status = (Status) SAMLEngineUtils
+ .createSamlObject(Status.DEFAULT_ELEMENT_NAME);
+ status.setStatusCode(statusCode);
+ return status;
+ }
+
+ /**
+ * Generate status code.
+ *
+ * @param value the value
+ *
+ * @return the status code
+ */
+ public static StatusCode generateStatusCode(final String value) {
+ final StatusCode statusCode = (StatusCode) SAMLEngineUtils
+ .createSamlObject(StatusCode.DEFAULT_ELEMENT_NAME);
+ statusCode.setValue(value);
+ return statusCode;
+ }
+
+ /**
+ * Generate status message.
+ *
+ * @param message the message
+ *
+ * @return the status message
+ */
+ public static StatusMessage generateStatusMessage(final String message) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .createSamlObject(StatusMessage.DEFAULT_ELEMENT_NAME);
+ statusMessage.setMessage(message);
+ return statusMessage;
+ }
+
+ /**
+ * Generate subject.
+ *
+ * @return the subject
+ */
+ public static Subject generateSubject() {
+ return (Subject) SAMLEngineUtils
+ .createSamlObject(Subject.DEFAULT_ELEMENT_NAME);
+ }
+
+ /**
+ * Generate subject confirmation.
+ *
+ * @param method the method
+ * @param data the data
+ *
+ * @return the subject confirmation
+ */
+ public static SubjectConfirmation generateSubjectConfirmation(
+ final String method, final SubjectConfirmationData data) {
+ final SubjectConfirmation subjectConf = (SubjectConfirmation) Configuration
+ .getBuilderFactory().getBuilder(
+ SubjectConfirmation.DEFAULT_ELEMENT_NAME).buildObject(
+ SubjectConfirmation.DEFAULT_ELEMENT_NAME);
+
+ subjectConf.setMethod(method);
+
+ subjectConf.setSubjectConfirmationData(data);
+
+ return subjectConf;
+ }
+
+ /**
+ * Generate subject confirmation data.
+ *
+ * @param notOnOrAfter the not on or after
+ * @param recipient the recipient
+ * @param inResponseTo the in response to
+ *
+ * @return the subject confirmation data
+ */
+ public static SubjectConfirmationData generateSubjectConfirmationData(
+ final DateTime notOnOrAfter, final String recipient,
+ final String inResponseTo) {
+ final SubjectConfirmationData subjectConfData = (SubjectConfirmationData) SAMLEngineUtils
+ .createSamlObject(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
+ subjectConfData.setNotOnOrAfter(notOnOrAfter);
+ subjectConfData.setRecipient(recipient);
+ subjectConfData.setInResponseTo(inResponseTo);
+ return subjectConfData;
+ }
+
+ /**
+ * Generate subject locality.
+ *
+ * @param address the address
+ *
+ * @return the subject locality
+ */
+ public static SubjectLocality generateSubjectLocality(final String address) {
+ final SubjectLocality subjectLocality = (SubjectLocality) SAMLEngineUtils
+ .createSamlObject(SubjectLocality.DEFAULT_ELEMENT_NAME);
+ subjectLocality.setAddress(address);
+ return subjectLocality;
+ }
+
+ /**
+ * Method that returns the current time.
+ *
+ * @return the current time
+ */
+ public static DateTime getCurrentTime() {
+ return new DateTime();
+ }
+
+ /**
+ * Instantiates a new SAML engine utilities.
+ */
+ private SAMLEngineUtils() {
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java
index 20ebb709d..6bdf7b320 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/STORKSAMLEngine.java
@@ -1,3705 +1,3744 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.commons.lang.StringUtils;
-import org.bouncycastle.jce.X509Principal;
-import org.joda.time.DateTime;
-import org.opensaml.Configuration;
-import org.opensaml.common.SAMLVersion;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.common.xml.SAMLConstants;
-import org.opensaml.saml2.common.Extensions;
-import org.opensaml.saml2.core.Assertion;
-import org.opensaml.saml2.core.Attribute;
-import org.opensaml.saml2.core.AttributeQuery;
-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.AuthnContextDecl;
-import org.opensaml.saml2.core.AuthnRequest;
-import org.opensaml.saml2.core.AuthnStatement;
-import org.opensaml.saml2.core.Conditions;
-import org.opensaml.saml2.core.Issuer;
-import org.opensaml.saml2.core.LogoutRequest;
-import org.opensaml.saml2.core.LogoutResponse;
-import org.opensaml.saml2.core.NameID;
-import org.opensaml.saml2.core.OneTimeUse;
-import org.opensaml.saml2.core.Response;
-import org.opensaml.saml2.core.Status;
-import org.opensaml.saml2.core.StatusCode;
-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.core.impl.SubjectConfirmationBuilder;
-import org.opensaml.xml.Namespace;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.schema.XSAny;
-import org.opensaml.xml.schema.impl.XSAnyBuilder;
-import org.opensaml.xml.schema.impl.XSAnyImpl;
-import org.opensaml.xml.schema.impl.XSAnyMarshaller;
-import org.opensaml.xml.schema.impl.XSAnyUnmarshaller;
-import org.opensaml.xml.schema.impl.XSDateTimeImpl;
-import org.opensaml.xml.schema.impl.XSStringImpl;
-import org.opensaml.xml.signature.KeyInfo;
-import org.opensaml.xml.util.Base64;
-import org.opensaml.xml.validation.ValidationException;
-import org.opensaml.xml.validation.Validator;
-import org.opensaml.xml.validation.ValidatorSuite;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-import eu.stork.peps.auth.commons.IPersonalAttributeList;
-import eu.stork.peps.auth.commons.PersonalAttribute;
-import eu.stork.peps.auth.commons.PersonalAttributeList;
-import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
-import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
-import eu.stork.peps.auth.commons.STORKAuthnRequest;
-import eu.stork.peps.auth.commons.STORKAuthnResponse;
-import eu.stork.peps.auth.commons.STORKLogoutRequest;
-import eu.stork.peps.auth.commons.STORKLogoutResponse;
-import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
-import eu.stork.peps.auth.engine.core.CitizenCountryCode;
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
-import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
-import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
-import eu.stork.peps.auth.engine.core.EIDSectorShare;
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import eu.stork.peps.auth.engine.core.RequestedAttributes;
-import eu.stork.peps.auth.engine.core.SAMLCore;
-import eu.stork.peps.auth.engine.core.SPApplication;
-import eu.stork.peps.auth.engine.core.SPCountry;
-import eu.stork.peps.auth.engine.core.SPID;
-import eu.stork.peps.auth.engine.core.SPInformation;
-import eu.stork.peps.auth.engine.core.SPInstitution;
-import eu.stork.peps.auth.engine.core.SPSector;
-import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
-import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesBuilder;
-import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesMarshaller;
-import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeBuilder;
-import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeMarshaller;
-import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareBuilder;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareMarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareBuilder;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareMarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDSectorShareBuilder;
-import eu.stork.peps.auth.engine.core.impl.EIDSectorShareMarshaller;
-import eu.stork.peps.auth.engine.core.impl.EIDSectorShareUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.QAAAttributeBuilder;
-import eu.stork.peps.auth.engine.core.impl.QAAAttributeMarshaller;
-import eu.stork.peps.auth.engine.core.impl.QAAAttributeUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributeBuilder;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributeMarshaller;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributeUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributesBuilder;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributesMarshaller;
-import eu.stork.peps.auth.engine.core.impl.RequestedAttributesUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPApplicationBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPApplicationMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPApplicationUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPCountryBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPCountryMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPCountryUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPIDBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPIDMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPIDUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPInformationBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPInformationMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPInformationUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPInstitutionBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPInstitutionMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPInstitutionUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPSectorBuilder;
-import eu.stork.peps.auth.engine.core.impl.SPSectorMarshaller;
-import eu.stork.peps.auth.engine.core.impl.SPSectorUnmarshaller;
-import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesBuilder;
-import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesMarshaller;
-import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesUnmarshaller;
-import eu.stork.peps.auth.engine.core.validator.CustomAttributeQueryValidator;
-import eu.stork.peps.auth.engine.core.validator.ExtensionsSchemaValidator;
-import eu.stork.peps.auth.engine.core.validator.QAAAttributeSchemaValidator;
-import eu.stork.peps.exceptions.SAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * Class that wraps the operations over SAML tokens, both generation and
- * validation of SAML STORK requests and SAML STORK responses. Complaint with
- * "OASIS Secure Assertion Markup Language (SAML) 2.0, May 2005", but taking
- * into account STORK specific requirements.
- *
- * @author fjquevedo
- * @author iinigo
- */
-public final class STORKSAMLEngine extends SAMLEngine {
-
- /** The Constant LOG. */
- private static final Logger LOG = LoggerFactory
- .getLogger(STORKSAMLEngine.class.getName());
-
- private static final String ATTRIBUTE_EMPTY_LITERAL = "Attribute name is null or empty.";
- /**
- * Gets the single instance of STORKSAMLEngine.
- *
- * @param nameInstance the name instance
- *
- * @return single instance of STORKSAMLEngine
- */
- public static synchronized STORKSAMLEngine getInstance(
- final String nameInstance) {
- STORKSAMLEngine engine = null;
- LOG.info("Get instance: " + nameInstance);
- try {
- engine = new STORKSAMLEngine(nameInstance.trim());
- } catch (Exception e) {
- LOG.error("Error get instance: " + nameInstance);
- }
- return engine;
- }
-
- /**
- * Instantiate a new STORKSAML engine.
- *
- * @param nameInstance the name instance
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private STORKSAMLEngine(final String nameInstance)
- throws STORKSAMLEngineException {
- // Initialization OpenSAML.
- super(nameInstance);
- LOG.info("Register STORK objects provider.");
- Configuration.registerObjectProvider(QAAAttribute.DEF_ELEMENT_NAME,
- new QAAAttributeBuilder(), new QAAAttributeMarshaller(),
- new QAAAttributeUnmarshaller());
-
- Configuration.registerObjectProvider(EIDSectorShare.DEF_ELEMENT_NAME,
- new EIDSectorShareBuilder(), new EIDSectorShareMarshaller(),
- new EIDSectorShareUnmarshaller());
-
- Configuration.registerObjectProvider(
- EIDCrossSectorShare.DEF_ELEMENT_NAME,
- new EIDCrossSectorShareBuilder(),
- new EIDCrossSectorShareMarshaller(),
- new EIDCrossSectorShareUnmarshaller());
-
- Configuration.registerObjectProvider(
- EIDCrossBorderShare.DEF_ELEMENT_NAME,
- new EIDCrossBorderShareBuilder(),
- new EIDCrossBorderShareMarshaller(),
- new EIDCrossBorderShareUnmarshaller());
-
- Configuration.registerObjectProvider(SPSector.DEF_ELEMENT_NAME,
- new SPSectorBuilder(), new SPSectorMarshaller(),
- new SPSectorUnmarshaller());
-
- Configuration.registerObjectProvider(SPInstitution.DEF_ELEMENT_NAME,
- new SPInstitutionBuilder(), new SPInstitutionMarshaller(),
- new SPInstitutionUnmarshaller());
-
- Configuration.registerObjectProvider(SPApplication.DEF_ELEMENT_NAME,
- new SPApplicationBuilder(), new SPApplicationMarshaller(),
- new SPApplicationUnmarshaller());
-
- Configuration.registerObjectProvider(SPCountry.DEF_ELEMENT_NAME,
- new SPCountryBuilder(), new SPCountryMarshaller(),
- new SPCountryUnmarshaller());
-
- Configuration.registerObjectProvider(XSAny.TYPE_NAME,
- new XSAnyBuilder(), new XSAnyMarshaller(),
- new XSAnyUnmarshaller());
-
- Configuration.registerObjectProvider(
- RequestedAttribute.DEF_ELEMENT_NAME,
- new RequestedAttributeBuilder(),
- new RequestedAttributeMarshaller(),
- new RequestedAttributeUnmarshaller());
-
- Configuration.registerObjectProvider(
- RequestedAttributes.DEF_ELEMENT_NAME,
- new RequestedAttributesBuilder(),
- new RequestedAttributesMarshaller(),
- new RequestedAttributesUnmarshaller());
-
- Configuration.registerObjectProvider(
- AuthenticationAttributes.DEF_ELEMENT_NAME,
- new AuthenticationAttributesBuilder(),
- new AuthenticationAttributesMarshaller(),
- new AuthenticationAttributesUnmarshaller());
-
- Configuration.registerObjectProvider(
- VIDPAuthenticationAttributes.DEF_ELEMENT_NAME,
- new VIDPAuthenticationAttributesBuilder(),
- new VIDPAuthenticationAttributesMarshaller(),
- new VIDPAuthenticationAttributesUnmarshaller());
-
- Configuration.registerObjectProvider(
- CitizenCountryCode.DEF_ELEMENT_NAME,
- new CitizenCountryCodeBuilder(),
- new CitizenCountryCodeMarshaller(),
- new CitizenCountryCodeUnmarshaller());
-
- Configuration.registerObjectProvider(
- SPID.DEF_ELEMENT_NAME,
- new SPIDBuilder(),
- new SPIDMarshaller(),
- new SPIDUnmarshaller());
-
- Configuration.registerObjectProvider(
- SPInformation.DEF_ELEMENT_NAME,
- new SPInformationBuilder(),
- new SPInformationMarshaller(),
- new SPInformationUnmarshaller());
-
- LOG.info("Register STORK object validators.");
- final ValidatorSuite validatorSuite = new ValidatorSuite(
- QAAAttribute.DEF_LOCAL_NAME);
-
- validatorSuite.registerValidator(QAAAttribute.DEF_ELEMENT_NAME,
- new QAAAttributeSchemaValidator());
- final Extensions extensions = SAMLEngineUtils.generateExtension();
- validatorSuite.registerValidator(extensions.getElementQName(),
- new ExtensionsSchemaValidator());
-
- Configuration.registerValidatorSuite(
- "stork:QualityAuthenticationAssuranceLevel", validatorSuite);
-
- }
-
- /**
- * Generate authentication response base.
- *
- * @param status the status
- * @param assertConsumerURL the assert consumer URL.
- * @param inResponseTo the in response to
- *
- * @return the response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Response genAuthnRespBase(final Status status,
- final String assertConsumerURL, final String inResponseTo)
- throws STORKSAMLEngineException {
- LOG.debug("Generate Authentication Response base.");
- final Response response = SAMLEngineUtils.generateResponse(
- SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
- SAMLEngineUtils.getCurrentTime(), status);
-
- // Set name Spaces
- this.setNameSpaces(response);
-
- // Mandatory STORK
- LOG.debug("Generate Issuer");
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
- issuer.setValue(super.getSamlCoreProperties().getResponder());
-
- // Format Entity Optional STORK
- issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
-
- response.setIssuer(issuer);
-
- // destination Mandatory Stork
- response.setDestination(assertConsumerURL.trim());
-
- // inResponseTo Mandatory Stork
- response.setInResponseTo(inResponseTo.trim());
-
- // Optional STORK
- response.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnResponse());
-
- return response;
- }
-
- /**
- * Generate attribute query response base.
- *
- * @param status the status
- * @param destinationURL the assert consumer URL.
- * @param inResponseTo the in response to
- *
- * @return the response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Response genAttrQueryRespBase(final Status status,
- final String destinationURL, final String inResponseTo)
- throws STORKSAMLEngineException {
- LOG.debug("Generate Attribute query Response base.");
- final Response response = SAMLEngineUtils.generateResponse(
- SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
- SAMLEngineUtils.getCurrentTime(), status);
-
- // Set name Spaces
- this.setNameSpaces(response);
-
- // Mandatory STORK
- LOG.debug("Generate Issuer");
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
- issuer.setValue(super.getSamlCoreProperties().getResponder());
-
- // Format Entity Optional STORK
- issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
-
- response.setIssuer(issuer);
-
- // destination Mandatory Stork
- response.setDestination(destinationURL.trim());
-
- // inResponseTo Mandatory Stork
- response.setInResponseTo(inResponseTo.trim());
-
- // Optional STORK
- response.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnResponse());
-
- return response;
- }
-
- /**
- * Generate assertion.
- *
- * @param ipAddress the IP address.
- * @param assertConsumerURL the assert consumer URL.
- * @param inResponseTo the in response to
- * @param issuer the issuer
- * @param notOnOrAfter the not on or after
- *
- * @return the assertion
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Assertion generateAssertion(final String ipAddress,
- final String assertConsumerURL, final String inResponseTo,
- final String issuer, final DateTime notOnOrAfter)
- throws STORKSAMLEngineException {
- LOG.info("Generate Assertion.");
-
- // Mandatory STORK
- LOG.debug("Generate Issuer to Assertion");
- final Issuer issuerAssertion = SAMLEngineUtils.generateIssuer();
- issuerAssertion.setValue(super.getSamlCoreProperties().getResponder());
-
- // Format Entity Optional STORK
- issuerAssertion.setFormat(super.getSamlCoreProperties()
- .getFormatEntity());
-
- final Assertion assertion = SAMLEngineUtils.generateAssertion(
- SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
- SAMLEngineUtils.getCurrentTime(), issuerAssertion);
-
- final Subject subject = SAMLEngineUtils.generateSubject();
-
- // Mandatory STORK verified
- // String format = NameID.UNSPECIFIED
- // specification: 'SAML:2.0' exist
- // opensaml: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
- // opensaml "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"
- final String format = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
-
- final String nameQualifier = "";
-
- LOG.debug("Generate NameID");
- final NameID nameId = SAMLEngineUtils.generateNameID(super
- .getSamlCoreProperties().getResponder(), format, nameQualifier);
- nameId.setValue(format);
- subject.setNameID(nameId);
-
- // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
- // Optional in other case.
- LOG.debug("Generate SubjectConfirmationData.");
- final SubjectConfirmationData dataBearer = SAMLEngineUtils
- .generateSubjectConfirmationData(SAMLEngineUtils
- .getCurrentTime(), assertConsumerURL, inResponseTo);
-
- // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
- // Optional in other case.
- LOG.debug("Generate SubjectConfirmation");
- final SubjectConfirmation subjectConf = SAMLEngineUtils
- .generateSubjectConfirmation(SubjectConfirmation.METHOD_BEARER,
- dataBearer);
-
- final ArrayList<SubjectConfirmation> listSubjectConf = new ArrayList<SubjectConfirmation>();
- listSubjectConf.add(subjectConf);
-
- for (final Iterator<SubjectConfirmation> iter = listSubjectConf
- .iterator(); iter.hasNext();) {
- final SubjectConfirmation element = iter.next();
-
- if (SubjectConfirmation.METHOD_BEARER.equals(element.getMethod())) {
- // ipAddress Mandatory if method is Bearer.
-
- if (StringUtils.isBlank(ipAddress)) {
- throw new STORKSAMLEngineException(
- "ipAddress is null or empty");
- }
- element.getSubjectConfirmationData().setAddress(
- ipAddress.trim());
- }
-
- element.getSubjectConfirmationData()
- .setRecipient(assertConsumerURL);
- element.getSubjectConfirmationData().setNotOnOrAfter(notOnOrAfter);
- }
-
- // The SAML 2.0 specification allows multiple SubjectConfirmations
- subject.getSubjectConfirmations().addAll(listSubjectConf);
-
- // Mandatory Stork
- assertion.setSubject(subject);
-
- // Conditions that MUST be evaluated when assessing the validity of
- // and/or when using the assertion.
- final Conditions conditions = this.generateConditions(SAMLEngineUtils
- .getCurrentTime(), notOnOrAfter, issuer);
-
- assertion.setConditions(conditions);
-
- LOG.debug("Generate stork Authentication Statement.");
- final AuthnStatement storkAuthnStat = this
- .generateStorkAuthStatement(ipAddress);
- assertion.getAuthnStatements().add(storkAuthnStat);
-
- return assertion;
- }
-
- private String getAttributeName(final PersonalAttribute attribute) throws STORKSAMLEngineException {
- if (StringUtils.isBlank(attribute.getName())) {
- LOG.error(ATTRIBUTE_EMPTY_LITERAL);
- throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
- }
-
- final String attributeName = super.getSamlCoreProperties()
- .getProperty(attribute.getName());
-
- if (StringUtils.isBlank(attributeName)) {
- LOG.error("Attribute name: {} it is not known.", attribute
- .getName());
- throw new STORKSAMLEngineException("Attribute name: "
- + attribute.getName() + " it is not known.");
- }
- return attributeName;
- }
- /**
- * Generate attribute statement.
- *
- * @param personalAttrList the personal attribute list
- * @param isHashing the is hashing
- *
- * @return the attribute statement
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- * @throws IOException
- */
- private AttributeStatement generateAttributeStatement(
- final IPersonalAttributeList personalAttrList,
- final boolean isHashing) throws STORKSAMLEngineException {
- LOG.debug("Generate attribute statement");
-
- final AttributeStatement attrStatement = (AttributeStatement) SAMLEngineUtils
- .createSamlObject(AttributeStatement.DEFAULT_ELEMENT_NAME);
-
- for (PersonalAttribute attribute : personalAttrList) {
-
- String attributeName = getAttributeName(attribute);
-
- // Verification that only one value it's permitted, simple or
- // complex, not both.
-
- final boolean simpleNull = (attribute.getValue() == null);
- final boolean simpleEmpty = (simpleNull || (!simpleNull && attribute
- .getValue().isEmpty()));
-
- final boolean complexNull = (attribute.getComplexValue() == null);
- final boolean complexEmpty = (complexNull || (!complexNull && attribute
- .getComplexValue().isEmpty()));
-
- if ((!simpleEmpty && !complexEmpty)) {
- throw new STORKSAMLEngineException(
- "Attribute name: "
- + attribute.getName()
- + " must be contain one value, simple or complex value.");
- } else {
-
- if (!simpleEmpty) {
- attrStatement.getAttributes().add(
- this.generateAttrSimple(attributeName, attribute
- .getStatus(), attribute.getValue(),
- isHashing));
- } else if (!complexEmpty) {
- attrStatement.getAttributes().add(
- SAMLEngineUtils.generateAttrComplex(attributeName,
- attribute.getStatus(), attribute
- .getComplexValue(), isHashing));
- } else if (!simpleNull) {
- attrStatement.getAttributes().add(
- this.generateAttrSimple(attributeName, attribute
- .getStatus(), new ArrayList<String>(),
- isHashing));
- } else {
- // Add attribute complex.
- attrStatement.getAttributes().add(
- SAMLEngineUtils.generateAttrComplex(attributeName,
- attribute.getStatus(),
- new HashMap<String, String>(), isHashing));
- }
- }
- }
- return attrStatement;
- }
- private XSAny createAttributeValueForSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
- DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
- domFactory.setNamespaceAware(true);
- Document document = null;
- DocumentBuilder builder;
-
- // Parse the signedDoc value into an XML DOM Document
- try {
- builder = domFactory.newDocumentBuilder();
- InputStream is;
- is = new ByteArrayInputStream(value.trim().getBytes("UTF-8"));
- document = builder.parse(is);
- is.close();
- } catch (SAXException e1) {
- LOG.error("SAX Error while parsing signModule attribute", e1);
- throw new STORKSAMLEngineRuntimeException(e1);
- } catch (ParserConfigurationException e2) {
- LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
- throw new STORKSAMLEngineRuntimeException(e2);
- } catch (UnsupportedEncodingException e3) {
- LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
- throw new STORKSAMLEngineRuntimeException(e3);
- } catch (IOException e4) {
- LOG.error("IO Error while parsing signModule attribute", e4);
- throw new STORKSAMLEngineRuntimeException(e4);
- }
-
- // Create the attribute statement
- final XSAny xmlValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- AttributeValue.DEFAULT_ELEMENT_NAME,
- XSAny.TYPE_NAME);
-
- //Set the signedDoc XML content to this element
- xmlValue.setDOM(document.getDocumentElement());
-
- // Create the attribute statement
- final XSAny attrValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- AttributeValue.DEFAULT_ELEMENT_NAME,
- XSAny.TYPE_NAME);
-
- //Add previous signedDocXML to the AttributeValue Element
-
- // if it's necessary encode the information.
- if (!isHashing) {
- attrValue.getUnknownXMLObjects().add(xmlValue);
- }
- return attrValue;
- }
-
- private XSAny createAttributeValueForNonSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
- // Create the attribute statement
- final XSAny attrValue = (XSAny) SAMLEngineUtils
- .createSamlObject(
- AttributeValue.DEFAULT_ELEMENT_NAME,
- XSAny.TYPE_NAME);
- // if it's necessary encode the information.
- if (isHashing) {
- attrValue.setTextContent(SAMLEngineUtils.encode(value, SAMLEngineUtils.SHA_512));
- } else {
- attrValue.setTextContent(value);
- }
- return attrValue;
- }
-
- /**
- * Generate attribute from a list of values.
- *
- * @param name the name of the attribute.
- * @param values the value of the attribute.
- * @param isHashing the is hashing with "SHA-512" algorithm.
- * @param status the status of the parameter: "Available", "NotAvailable" or
- * "Withheld".
- *
- * @return the attribute
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Attribute generateAttrSimple(final String name,
- final String status, final List<String> values,
- final boolean isHashing) throws STORKSAMLEngineException {
- LOG.debug("Generate attribute simple: " + name);
- final Attribute attribute = (Attribute) SAMLEngineUtils
- .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
-
- attribute.setName(name);
- attribute.setNameFormat(Attribute.URI_REFERENCE);
-
- attribute.getUnknownAttributes().put(
- new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
- SAMLCore.STORK10_PREFIX.getValue()), status);
-
- if (values != null) {
- LOG.debug("Add attribute values.");
- for (int i = 0; i < values.size(); i++) {
- final String value = values.get(i);
- if (StringUtils.isNotBlank(value)) {
- XSAny attrValue = null;
- if (!name.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
- // Create the attribute statement
- attrValue = createAttributeValueForNonSignedDoc(value, isHashing);
-
- } else {
- attrValue = createAttributeValueForSignedDoc(value, isHashing);
- attribute.getAttributeValues().add(attrValue);
- }
- attribute.getAttributeValues().add(attrValue);
- }
- }
- }
- return attribute;
- }
-
- /**
- * Generate conditions that MUST be evaluated when assessing the validity of
- * and/or when using the assertion.
- *
- * @param notBefore the not before
- * @param notOnOrAfter the not on or after
- * @param audienceURI the audience URI.
- *
- * @return the conditions
- */
- private Conditions generateConditions(final DateTime notBefore,
- final DateTime notOnOrAfter, final String audienceURI) {
- LOG.debug("Generate conditions.");
- final Conditions conditions = (Conditions) SAMLEngineUtils
- .createSamlObject(Conditions.DEFAULT_ELEMENT_NAME);
- conditions.setNotBefore(notBefore);
- conditions.setNotOnOrAfter(notOnOrAfter);
-
- final AudienceRestriction restrictions = (AudienceRestriction) SAMLEngineUtils
- .createSamlObject(AudienceRestriction.DEFAULT_ELEMENT_NAME);
-
- final Audience audience = (Audience) SAMLEngineUtils
- .createSamlObject(Audience.DEFAULT_ELEMENT_NAME);
- audience.setAudienceURI(audienceURI);
-
- restrictions.getAudiences().add(audience);
- conditions.getAudienceRestrictions().add(restrictions);
-
- if (super.getSamlCoreProperties().isOneTimeUse()) {
- final OneTimeUse oneTimeUse = (OneTimeUse) SAMLEngineUtils
- .createSamlObject(OneTimeUse.DEFAULT_ELEMENT_NAME);
- conditions.getConditions().add(oneTimeUse);
- }
- return conditions;
- }
-
- /**
- * Generate personal attribute list.
- *
- * @param assertion the assertion
- *
- * @return the personal attribute list
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private IPersonalAttributeList generatePersonalAttributeList(
- final Assertion assertion) throws STORKSAMLEngineException {
- LOG.debug("Generate personal attribute list from XMLObject.");
- final List<XMLObject> listExtensions = assertion.getOrderedChildren();
-
- boolean find = false;
- AttributeStatement requestedAttr = null;
-
- // Search the attribute statement.
- for (int i = 0; i < listExtensions.size() && !find; i++) {
- final XMLObject xml = listExtensions.get(i);
- if (xml instanceof AttributeStatement) {
- requestedAttr = (AttributeStatement) xml;
- find = true;
- }
- }
-
- if (!find) {
- LOG.error("Error: AttributeStatement it's not present.");
- throw new STORKSAMLEngineException(
- "AttributeStatement it's not present.");
- }
-
- final List<Attribute> reqAttrs = requestedAttr.getAttributes();
-
- final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
- String attributeName;
-
- // Process the attributes.
- for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
- final Attribute attribute = reqAttrs.get(nextAttribute);
-
- final PersonalAttribute personalAttribute = new PersonalAttribute();
-
- attributeName = attribute.getName();
- personalAttribute.setName(attributeName.substring(attributeName
- .lastIndexOf('/') + 1));
-
- personalAttribute.setStatus(attribute.getUnknownAttributes().get(
- new QName(SAMLCore.STORK10_NS.getValue(),
- "AttributeStatus", SAMLCore.STORK10_PREFIX
- .getValue())));
-
- final ArrayList<String> simpleValues = new ArrayList<String>();
- final HashMap<String, String> multiValues = new HashMap<String, String>();
-
- final List<XMLObject> values = attribute.getOrderedChildren();
-
-
- // Process the values.
- for (int nextValue = 0; nextValue < values.size(); nextValue++) {
-
- final XMLObject xmlObject = values.get(nextValue);
-
- if (xmlObject instanceof XSStringImpl) {
-
- simpleValues.add(((XSStringImpl) xmlObject).getValue());
-
- } else if (xmlObject instanceof XSAnyImpl) {
-
- if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
-
- final XSAnyImpl xmlString = (XSAnyImpl) values
- .get(nextValue);
-
- TransformerFactory transFactory = TransformerFactory
- .newInstance();
- Transformer transformer = null;
- try {
- transformer = transFactory.newTransformer();
- transformer.setOutputProperty(
- OutputKeys.OMIT_XML_DECLARATION, "yes");
- } catch (TransformerConfigurationException e) {
- LOG.error("Error transformer configuration exception", e);
- }
- StringWriter buffer = new StringWriter();
- try {
- if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
- transformer.transform(new DOMSource(xmlString
- .getUnknownXMLObjects().get(0).getDOM()),
- new StreamResult(buffer));
- }
- } catch (TransformerException e) {
- LOG.error("Error transformer exception", e);
- }
- String str = buffer.toString();
-
- simpleValues.add(str);
-
- } else if (isComplex(xmlObject))
- {
- LOG.info(attributeName + " found");
- // Process complex value.
- final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
-
- for (int nextComplexValue = 0; nextComplexValue < complexValue
- .getUnknownXMLObjects().size(); nextComplexValue++) {
-
- final XSAnyImpl simple = (XSAnyImpl) complexValue
- .getUnknownXMLObjects().get(
- nextComplexValue);
-
- multiValues.put(simple.getElementQName()
- .getLocalPart(), simple.getTextContent());
- }
-
- }
- else {
- // Process simple value.
- simpleValues.add(((XSAnyImpl) xmlObject)
- .getTextContent());
- }
-
- } else {
- LOG.error("Error: attribute value it's unknown.");
- throw new STORKSAMLEngineException(
- "Attribute value it's unknown.");
- }
- }
-
- personalAttribute.setValue(simpleValues);
- personalAttribute.setComplexValue(multiValues);
- personalAttrList.add(personalAttribute);
- }
-
- return personalAttrList;
- }
-
- /**
- * Generate stork authentication request.
- *
- * @param request the request that contain all parameters for generate an
- * authentication request.
- *
- * @return the STORK authentication request that has been processed.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnRequest generateSTORKAuthnRequest(
- final STORKAuthnRequest request) throws STORKSAMLEngineException {
- LOG.info("Generate SAMLAuthnRequest.");
-
- // Validate Parameters mandatories
- validateParamAuthnReq(request);
-
- final AuthnRequest authnRequestAux = SAMLEngineUtils
- .generateSAMLAuthnRequest(SAMLEngineUtils.generateNCName(),
- SAMLVersion.VERSION_20, SAMLEngineUtils
- .getCurrentTime());
-
- // Set name spaces.
- setNameSpaces(authnRequestAux);
-
- // Add parameter Mandatory STORK
- authnRequestAux.setForceAuthn(Boolean.TRUE);
-
- // Add parameter Mandatory STORK
- authnRequestAux.setIsPassive(Boolean.FALSE);
-
- authnRequestAux.setAssertionConsumerServiceURL(request
- .getAssertionConsumerServiceURL());
-
- authnRequestAux.setProviderName(request.getProviderName());
-
- // Add protocol binding
- authnRequestAux.setProtocolBinding(super.getSamlCoreProperties()
- .getProtocolBinding());
-
- // Add parameter optional STORK
- // Destination is mandatory if the destination is a C-PEPS
- // The application must to know if the destination is a C-PEPS.
- if (StringUtils.isNotBlank(request.getDestination())) {
- authnRequestAux.setDestination(request.getDestination());
- }
-
- // Consent is optional. Set from SAMLEngine.xml - consent.
- authnRequestAux.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnRequest());
-
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
-
- if(request.getIssuer()!=null){
- issuer.setValue(request.getIssuer());
- } else {
- issuer.setValue(super.getSamlCoreProperties().getRequester());
- }
-
- // Optional STORK
- final String formatEntity = super.getSamlCoreProperties()
- .getFormatEntity();
- if (StringUtils.isNotBlank(formatEntity)) {
- issuer.setFormat(formatEntity);
- }
-
- authnRequestAux.setIssuer(issuer);
-
- // Generate stork extensions.
- final Extensions storkExtensions = this
- .generateSTORKExtensions(request);
- // add the extensions to the SAMLAuthnRequest
- authnRequestAux.setExtensions(storkExtensions);
-
- // the result contains an authentication request token (byte[]),
- // identifier of the token, and all parameters from the request.
- final STORKAuthnRequest authRequest = processExtensions(authnRequestAux
- .getExtensions());
-
- try {
- authRequest.setTokenSaml(super.signAndMarshall(authnRequestAux));
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- authRequest.setSamlId(authnRequestAux.getID());
- authRequest.setDestination(authnRequestAux.getDestination());
- authRequest.setAssertionConsumerServiceURL(authnRequestAux
- .getAssertionConsumerServiceURL());
-
- authRequest.setProviderName(authnRequestAux.getProviderName());
- authRequest.setIssuer(authnRequestAux.getIssuer().getValue());
-
- return authRequest;
- }
-
- /**
- * Generate stork authentication response.
- *
- * @param request the request
- * @param responseAuthReq the response authentication request
- * @param ipAddress the IP address
- * @param isHashing the is hashing
- *
- * @return the sTORK authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnResponse generateSTORKAuthnResponse(
- final STORKAuthnRequest request,
- final STORKAuthnResponse responseAuthReq, final String ipAddress,
- final boolean isHashing) throws STORKSAMLEngineException {
- LOG.info("generateSTORKAuthnResponse");
-
- // Validate parameters
- validateParamResponse(request, responseAuthReq);
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode");
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(StatusCode.SUCCESS_URI);
-
- LOG.debug("Generate Status");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- LOG.debug("Generate StatusMessage");
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(StatusCode.SUCCESS_URI);
-
- status.setStatusMessage(statusMessage);
-
- LOG.debug("Generate Response");
-
- // RESPONSE
- final Response response = genAuthnRespBase(status, request
- .getAssertionConsumerServiceURL(), request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, request
- .getAssertionConsumerServiceURL(), request.getSamlId(), request
- .getIssuer(), notOnOrAfter);
-
- final AttributeStatement attrStatement = this
- .generateAttributeStatement(responseAuthReq
- .getPersonalAttributeList(), isHashing);
-
- assertion.getAttributeStatements().add(attrStatement);
-
- // Add assertions
- response.getAssertions().add(assertion);
-
- final STORKAuthnResponse authresponse = new STORKAuthnResponse();
-
- try {
- authresponse.setTokenSaml(super.signAndMarshall(response));
- authresponse.setSamlId(response.getID());
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
- return authresponse;
- }
-
- /**
- * Generate stork authentication response.
- *
- * @param request the request
- * @param responseAuthReq the response authentication request
- * @param ipAddress the IP address
- * @param isHashing the is hashing
- *
- * @return the sTORK authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnResponse generateSTORKAuthnResponseAfterQuery(
- final STORKAuthnRequest request,
- final STORKAuthnResponse responseAuthReq, final String ipAddress,
- final boolean isHashing, List<STORKAttrQueryResponse> res) throws STORKSAMLEngineException {
- LOG.info("generateSTORKAuthnResponse");
-
- // Validate parameters
- validateParamResponse(request, responseAuthReq);
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode");
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(StatusCode.SUCCESS_URI);
-
- LOG.debug("Generate Status");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- LOG.debug("Generate StatusMessage");
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(StatusCode.SUCCESS_URI);
-
- status.setStatusMessage(statusMessage);
-
- LOG.debug("Generate Response");
-
- // RESPONSE
- final Response response = genAuthnRespBase(status, request
- .getAssertionConsumerServiceURL(), request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, request
- .getAssertionConsumerServiceURL(), request.getSamlId(), request
- .getIssuer(), notOnOrAfter);
-
- final AttributeStatement attrStatement = this
- .generateAttributeStatement(responseAuthReq
- .getPersonalAttributeList(), isHashing);
-
- assertion.getAttributeStatements().add(attrStatement);
-
- // Add assertions
- response.getAssertions().add(assertion);
- // Check for response queries
- if (res != null && res.size() > 0)
- {
- //Iterate through them
- for (int i = 0; i < res.size(); i++)
- {
- //If response contains multiple assertions iterate through them as well
- if (res.get(i).getAssertions().size() > 1)
- {
- for (int j = 0; j < res.get(i).getAssertions().size(); j++)
- {
- Assertion tempAssertion = res.get(i).getAssertions().get(j);
- tempAssertion.setParent(response);
- response.getAssertions().add(tempAssertion);
- }
- } else {
- Assertion tempAssertion = res.get(i).getAssertion();
- tempAssertion.setParent(response);
- response.getAssertions().add(tempAssertion);
- }
- }
- }
-
- final STORKAuthnResponse authresponse = new STORKAuthnResponse();
-
- try {
- authresponse.setTokenSaml(super.signAndMarshall(response));
- authresponse.setSamlId(response.getID());
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
- return authresponse;
- }
-
- /**
- * Generate stork authentication response fail.
- *
- * @param request the request
- * @param response the response
- * @param ipAddress the IP address
- * @param isHashing the is hashing
- *
- * @return the sTORK authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnResponse generateSTORKAuthnResponseFail(
- final STORKAuthnRequest request, final STORKAuthnResponse response,
- final String ipAddress, final boolean isHashing)
- throws STORKSAMLEngineException {
- LOG.info("generateSTORKAuthnResponseFail");
-
- validateParamResponseFail(request, response);
-
- // Mandatory
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(response.getStatusCode());
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode.");
- // Subordinate code it's optional in case not covered into next codes:
- // - 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:RequestDenied
- // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
-
- if (StringUtils.isNotBlank(response.getSubStatusCode())) {
- final StatusCode newStatusCode = SAMLEngineUtils
- .generateStatusCode(response.getSubStatusCode());
- statusCode.setStatusCode(newStatusCode);
- }
-
- LOG.debug("Generate Status.");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- if (StringUtils.isNotBlank(response.getMessage())) {
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(response.getMessage());
-
- status.setStatusMessage(statusMessage);
- }
-
- LOG.debug("Generate Response.");
- // RESPONSE
- final Response responseFail = genAuthnRespBase(status, request
- .getAssertionConsumerServiceURL(), request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, request
- .getAssertionConsumerServiceURL(), request.getSamlId(), request
- .getIssuer(), notOnOrAfter);
-
- responseFail.getAssertions().add(assertion);
-
- LOG.debug("Sign and Marshall ResponseFail.");
-
- final STORKAuthnResponse storkResponse = new STORKAuthnResponse();
-
- try {
- storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
- storkResponse.setSamlId(responseFail.getID());
- } catch (SAMLEngineException e) {
- LOG.error("SAMLEngineException.", e);
- throw new STORKSAMLEngineException(e);
- }
- return storkResponse;
- }
-
- /**
- * Generate stork attribute query request.
- *
- * @param request the request that contain all parameters for generate an
- * attribute query request.
- *
- * @return the STORK attribute query request that has been processed.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryRequest generateSTORKAttrQueryRequest(
- final STORKAttrQueryRequest request) throws STORKSAMLEngineException {
- LOG.info("Generate STORKAttrQueryRequest.");
-
- // Validate Parameters mandatories
- validateParamAttrQueryReq(request);
-
- //final AttributeQuery attrQueryRequestAux = SAMLEngineUtils
- final CustomAttributeQuery attrQueryRequestAux = SAMLEngineUtils
- .generateSAMLAttrQueryRequest(SAMLEngineUtils.generateNCName(),
- SAMLVersion.VERSION_20, SAMLEngineUtils
- .getCurrentTime());
-
- // Set name spaces.
- setNameSpaces(attrQueryRequestAux);
-
-
- // Add parameter optional STORK
- // Destination is mandatory if the destination is a C-PEPS
- // The application must to know if the destination is a C-PEPS.
- if (StringUtils.isNotBlank(request.getDestination())) {
- attrQueryRequestAux.setDestination(request.getDestination());
- }
-
- // Add parameter optional STORK
- // Consumer URL is needed if using HTTP-Post
- if (StringUtils.isNotBlank(request.getAssertionConsumerServiceURL())) {
- attrQueryRequestAux.setAssertionConsumerServiceURL(request.getAssertionConsumerServiceURL());
- }
-
- // Consent is optional. Set from SAMLEngine.xml - consent.
- attrQueryRequestAux.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnRequest());
-
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
-
- //Set the subject - needed for attribute query validation
- Subject subject = SAMLEngineUtils.generateSubject();
- SubjectConfirmationBuilder builder = new SubjectConfirmationBuilder();
- SubjectConfirmation subjectConfirmation = builder.buildObject();
- subjectConfirmation.setMethod("urn:oasis:names:tc:SAML:2.0:cm:bearer");
- subject.getSubjectConfirmations().add(subjectConfirmation);
- attrQueryRequestAux.setSubject(subject);
-
- if(request.getIssuer()!=null){
- issuer.setValue(request.getIssuer());
- } else {
- issuer.setValue(super.getSamlCoreProperties().getRequester());
- }
-
- // Optional STORK
- final String formatEntity = super.getSamlCoreProperties()
- .getFormatEntity();
- if (StringUtils.isNotBlank(formatEntity)) {
- issuer.setFormat(formatEntity);
- }
-
- attrQueryRequestAux.setIssuer(issuer);
-
- // Generate stork extensions.
- final Extensions storkExtensions = this
- .generateSTORKAttrExtensions(request);
- // add the extensions to the SAMLAuthnRequest
- attrQueryRequestAux.setExtensions(storkExtensions);
-
- // the result contains an authentication request token (byte[]),
- // identifier of the token, and all parameters from the request.
- final STORKAttrQueryRequest attrQueryRequest = processAttrExtensions(attrQueryRequestAux
- .getExtensions());
-
- try {
- attrQueryRequest.setTokenSaml(super.signAndMarshall(attrQueryRequestAux));
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- attrQueryRequest.setSamlId(attrQueryRequestAux.getID());
- attrQueryRequest.setDestination(attrQueryRequestAux.getDestination());
- attrQueryRequest.setAssertionConsumerServiceURL(attrQueryRequestAux.getAssertionConsumerServiceURL());
- attrQueryRequest.setIssuer(attrQueryRequestAux.getIssuer().getValue());
-
- return attrQueryRequest;
- }
-
- /**
- * Generate stork attribute query response.
- *
- * @param request the request
- * @param responseAttrQueryRes the response authentication request
- * @param ipAddress the IP address
- * @param isHashing the hashing of values
- *
- * @return the sTORK authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryResponse generateSTORKAttrQueryResponse(
- final STORKAttrQueryRequest request,
- final STORKAttrQueryResponse responseAttrQueryRes, final String ipAddress,
- final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
- LOG.info("generateSTORKAttrQueryResponse");
-
- // Validate parameters
- validateParamAttrQueryResponse(request, responseAttrQueryRes);
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode");
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(StatusCode.SUCCESS_URI);
-
- LOG.debug("Generate Status");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- LOG.debug("Generate StatusMessage");
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(StatusCode.SUCCESS_URI);
-
- status.setStatusMessage(statusMessage);
-
- LOG.debug("Generate Response");
-
- // RESPONSE
- final Response response = genAuthnRespBase(status, destinationUrl,
- request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, ""
- ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
-
- final AttributeStatement attrStatement = this
- .generateAttributeStatement(responseAttrQueryRes
- .getPersonalAttributeList(), isHashing);
-
- assertion.getAttributeStatements().add(attrStatement);
-
- // Add assertions
- response.getAssertions().add(assertion);
-
- final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
-
- try {
- attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
- attrQueryResponse.setSamlId(response.getID());
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
- return attrQueryResponse;
- }
-
- /**
- * Generate stork attribute query response from multiple assertions
- *
- * @param request the request
- * @param responseAttrQueryRes the response to the query request
- * @param responses the responses to include in the response (aggregation)
- * @param ipAddress the IP address
- * @param isHashing the hashing of values
- *
- * @return the sTORK attribute query response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryResponse generateSTORKAttrQueryResponseWithAssertions(
- final STORKAttrQueryRequest request, final STORKAttrQueryResponse responseAttrQueryRes,
- final List<STORKAttrQueryResponse> responses, final String ipAddress,
- final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
- LOG.info("generateSTORKAttrQueryResponse");
-
- // Validate parameters
- validateParamAttrQueryResponse(request, responseAttrQueryRes);
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode");
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(StatusCode.SUCCESS_URI);
-
- LOG.debug("Generate Status");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- LOG.debug("Generate StatusMessage");
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(StatusCode.SUCCESS_URI);
-
- status.setStatusMessage(statusMessage);
-
- LOG.debug("Generate Response");
-
- // RESPONSE
- final Response response = genAuthnRespBase(status, destinationUrl,
- request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, ""
- ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
-
- final AttributeStatement attrStatement = this
- .generateAttributeStatement(responseAttrQueryRes
- .getPersonalAttributeList(), isHashing);
-
- assertion.getAttributeStatements().add(attrStatement);
-
- // Add the assertions from the former Query responses
- response.getAssertions().add(assertion);
- if (responses != null && responses.size() > 0)
- {
- for (int i = 0; i < responses.size(); i++)
- {
- Assertion tempAssertion = responses.get(i).getAssertion();
- tempAssertion.setParent(response);
- response.getAssertions().add(tempAssertion);
- }
- }
-
- final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
-
- try {
- attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
- attrQueryResponse.setSamlId(response.getID());
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
- return attrQueryResponse;
- }
-
- /**
- * Generate stork attribute query response fail.
- *
- * @param request the request
- * @param response the response
- * @param ipAddress the IP address
- * @param isHashing the is hashing
- *
- * @return the STORK attribute query response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryResponse generateSTORKAttrQueryResponseFail(
- final STORKAttrQueryRequest request, final STORKAttrQueryResponse response,
- final String ipAddress, final String destinationUrl, final boolean isHashing)
- throws STORKSAMLEngineException {
- LOG.info("generateSTORKAttrQueryResponseFail");
-
- validateParamAttrQueryResponseFail(request, response);
-
- // Mandatory
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(response.getStatusCode());
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode.");
- // Subordinate code it's optional in case not covered into next codes:
- // - 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:RequestDenied
- // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
-
- if (StringUtils.isNotBlank(response.getSubStatusCode())) {
- final StatusCode newStatusCode = SAMLEngineUtils
- .generateStatusCode(response.getSubStatusCode());
- statusCode.setStatusCode(newStatusCode);
- }
-
- LOG.debug("Generate Status.");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- if (StringUtils.isNotBlank(response.getMessage())) {
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(response.getMessage());
-
- status.setStatusMessage(statusMessage);
- }
-
- LOG.debug("Generate Response.");
- // RESPONSE
- final Response responseFail = genAuthnRespBase(status, destinationUrl,
- request.getSamlId());
-
- DateTime notOnOrAfter = new DateTime();
-
- notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
- .getTimeNotOnOrAfter());
-
- final Assertion assertion = this.generateAssertion(ipAddress, "",
- request.getSamlId(), request
- .getIssuer(), notOnOrAfter);
-
- responseFail.getAssertions().add(assertion);
-
- LOG.debug("Sign and Marshall ResponseFail.");
-
- final STORKAttrQueryResponse storkResponse = new STORKAttrQueryResponse();
-
- try {
- storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
- storkResponse.setSamlId(responseFail.getID());
- } catch (SAMLEngineException e) {
- LOG.error("SAMLEngineException.", e);
- throw new STORKSAMLEngineException(e);
- }
- return storkResponse;
- }
-
- /**
- * Generate stork logout request.
- *
- * @param request the request that contain all parameters for generate an
- * logout request.
- *
- * @return the STORK logout request that has been processed.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKLogoutRequest generateSTORKLogoutRequest(
- final STORKLogoutRequest request) throws STORKSAMLEngineException {
- LOG.info("Generate STORKLogoutRequest.");
-
- // Validate Parameters mandatories
- validateParamLogoutReq(request);
-
- final LogoutRequest logoutRequestAux = SAMLEngineUtils
- .generateSAMLLogoutRequest(SAMLEngineUtils.generateNCName(),
- SAMLVersion.VERSION_20, SAMLEngineUtils
- .getCurrentTime());
-
- // Set name spaces.
- setNameSpaces(logoutRequestAux);
-
-
- // Add parameter optional STORK
- // Destination is mandatory if the destination is a C-PEPS
- // The application must to know if the destination is a C-PEPS.
- if (StringUtils.isNotBlank(request.getDestination())) {
- logoutRequestAux.setDestination(request.getDestination());
- }
-
- // Consent is optional. Set from SAMLEngine.xml - consent.
- logoutRequestAux.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnRequest());
-
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
-
-
- if(request.getIssuer()!=null){
- issuer.setValue(request.getIssuer());
- } else {
- issuer.setValue(super.getSamlCoreProperties().getRequester());
- }
-
- // Optional STORK
- final String formatEntity = super.getSamlCoreProperties()
- .getFormatEntity();
- if (StringUtils.isNotBlank(formatEntity)) {
- issuer.setFormat(formatEntity);
- }
-
- logoutRequestAux.setIssuer(issuer);
-
- // Set the name ID
- final NameID newNameID = SAMLEngineUtils.generateNameID();
- newNameID.setValue(request.getSpProvidedId());
- logoutRequestAux.setNameID(newNameID);
-
-
- // the result contains an authentication request token (byte[]),
- // identifier of the token, and all parameters from the request.
- final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
-
- try {
- logoutRequest.setTokenSaml(super.signAndMarshall(logoutRequestAux));
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- logoutRequest.setSamlId(logoutRequestAux.getID());
- logoutRequest.setDestination(logoutRequestAux.getDestination());
- logoutRequest.setIssuer(logoutRequestAux.getIssuer().getValue());
- logoutRequest.setSpProvidedId(logoutRequestAux.getNameID().getValue());
-
- return logoutRequest;
- }
-
-
- /**
- * Generate stork logout response.
- * @param request the request thats being responded to
- * @param response the tesponse that contain all parameters for generate an
- * logout request.
- *
- * @return the STORK logout response that has been processed.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKLogoutResponse generateSTORKLogoutResponse(
- final STORKLogoutRequest request,
- final STORKLogoutResponse response) throws STORKSAMLEngineException {
- LOG.info("Generate STORKLogoutResponse.");
-
- // Validate Parameters mandatories
- validateParamLogoutRes(request, response);
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode");
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(StatusCode.SUCCESS_URI);
-
- LOG.debug("Generate Status");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- LOG.debug("Generate StatusMessage");
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(StatusCode.SUCCESS_URI);
-
- status.setStatusMessage(statusMessage);
-
- final LogoutResponse logoutResponseAux= SAMLEngineUtils
- .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
- SAMLVersion.VERSION_20, SAMLEngineUtils
- .getCurrentTime(), status, request.getSamlId());
-
- // Set name spaces.
- setNameSpaces(logoutResponseAux);
-
-
- // Add parameter optional STORK
- // Destination is mandatory if the destination is a C-PEPS
- // The application must to know if the destination is a C-PEPS.
- if (StringUtils.isNotBlank(response.getDestination())) {
- logoutResponseAux.setDestination(response.getDestination());
- }
-
- // Consent is optional. Set from SAMLEngine.xml - consent.
- logoutResponseAux.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnRequest());
-
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
-
-
- if(response.getIssuer()!=null){
- issuer.setValue(response.getIssuer());
- } else {
- issuer.setValue(super.getSamlCoreProperties().getRequester());
- }
-
- // Optional STORK
- final String formatEntity = super.getSamlCoreProperties()
- .getFormatEntity();
- if (StringUtils.isNotBlank(formatEntity)) {
- issuer.setFormat(formatEntity);
- }
-
- logoutResponseAux.setIssuer(issuer);
-
-
- // the result contains an authentication request token (byte[]),
- // identifier of the token, and all parameters from the request.
- final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
-
- try {
- logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- logoutResponse.setSamlId(logoutResponseAux.getID());
- logoutResponse.setDestination(logoutResponseAux.getDestination());
- logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
- logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
- logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
-
- return logoutResponse;
- }
-
- /**
- * Generate failed stork logout response.
- *
- * @param response the response that contain all parameters for generate an
- * logout request.
- *
- * @return the STORK logout response that has been processed.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKLogoutResponse generateSTORKLogoutResponseFail(
- final STORKLogoutRequest request,
- final STORKLogoutResponse response ) throws STORKSAMLEngineException {
- LOG.info("Generate STORKLogoutResponse.");
-
- // Validate Parameters mandatories
- validateParamLogoutResFail(request, response);
-
- // Mandatory
- final StatusCode statusCode = SAMLEngineUtils
- .generateStatusCode(response.getStatusCode());
-
- // Mandatory SAML
- LOG.debug("Generate StatusCode.");
- // Subordinate code it's optional in case not covered into next codes:
- // - 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:RequestDenied
- // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
-
- if (StringUtils.isNotBlank(response.getSubStatusCode())) {
- final StatusCode newStatusCode = SAMLEngineUtils
- .generateStatusCode(response.getSubStatusCode());
- statusCode.setStatusCode(newStatusCode);
- }
-
- LOG.debug("Generate Status.");
- final Status status = SAMLEngineUtils.generateStatus(statusCode);
-
- if (StringUtils.isNotBlank(response.getStatusMessage())) {
- final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
- .generateStatusMessage(response.getStatusMessage());
-
- status.setStatusMessage(statusMessage);
- }
-
- final LogoutResponse logoutResponseAux= SAMLEngineUtils
- .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
- SAMLVersion.VERSION_20, SAMLEngineUtils
- .getCurrentTime(), status, request.getSamlId());
-
- // Set name spaces.
- setNameSpaces(logoutResponseAux);
-
-
- // Add parameter optional STORK
- // Destination is mandatory if the destination is a C-PEPS
- // The application must to know if the destination is a C-PEPS.
- if (StringUtils.isNotBlank(response.getDestination())) {
- logoutResponseAux.setDestination(response.getDestination());
- }
-
- // Consent is optional. Set from SAMLEngine.xml - consent.
- logoutResponseAux.setConsent(super.getSamlCoreProperties()
- .getConsentAuthnRequest());
-
- final Issuer issuer = SAMLEngineUtils.generateIssuer();
-
-
- if(response.getIssuer()!=null){
- issuer.setValue(response.getIssuer());
- } else {
- issuer.setValue(super.getSamlCoreProperties().getRequester());
- }
-
- // Optional STORK
- final String formatEntity = super.getSamlCoreProperties()
- .getFormatEntity();
- if (StringUtils.isNotBlank(formatEntity)) {
- issuer.setFormat(formatEntity);
- }
-
- logoutResponseAux.setIssuer(issuer);
-
-
- // the result contains an authentication request token (byte[]),
- // identifier of the token, and all parameters from the request.
- final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
-
- try {
- logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
- } catch (SAMLEngineException e) {
- LOG.error("Sign and Marshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- logoutResponse.setSamlId(logoutResponseAux.getID());
- logoutResponse.setDestination(logoutResponseAux.getDestination());
- logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
- logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
- logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
-
- return logoutResponse;
- }
-
- /**
- * Generate stork authentication statement for the authentication statement.
- *
- * @param ipAddress the IP address
- *
- * @return the authentication statement
- */
- private AuthnStatement generateStorkAuthStatement(final String ipAddress) {
- LOG.debug("Generate stork authenticate statement.");
- final SubjectLocality subjectLocality = SAMLEngineUtils
- .generateSubjectLocality(ipAddress);
-
- final AuthnContext authnContext = (AuthnContext) SAMLEngineUtils
- .createSamlObject(AuthnContext.DEFAULT_ELEMENT_NAME);
-
- final AuthnContextDecl authnContextDecl = (AuthnContextDecl) SAMLEngineUtils
- .createSamlObject(AuthnContextDecl.DEFAULT_ELEMENT_NAME);
-
- authnContext.setAuthnContextDecl(authnContextDecl);
-
- final AuthnStatement authnStatement = SAMLEngineUtils
- .generateAthnStatement(new DateTime(), authnContext);
-
- // Optional STORK
- authnStatement.setSessionIndex(null);
- authnStatement.setSubjectLocality(subjectLocality);
-
- return authnStatement;
- }
-
- /**
- * Generate stork extensions.
- *
- * @param request the request
- *
- * @return the extensions
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Extensions generateSTORKExtensions(final STORKAuthnRequest request)
- throws STORKSAMLEngineException {
- LOG.debug("Generate STORKExtensions");
-
- final Extensions extensions = SAMLEngineUtils.generateExtension();
-
- LOG.debug("Generate QAAAttribute");
- final QAAAttribute qaaAttribute = SAMLEngineUtils
- .generateQAAAttribute(request.getQaa());
- extensions.getUnknownXMLObjects().add(qaaAttribute);
-
-
- if (StringUtils.isNotEmpty(request
- .getSpSector())) {
- // Add information about service provider.
- LOG.debug("Generate SPSector");
- final SPSector sector = SAMLEngineUtils.generateSPSector(request
- .getSpSector());
- extensions.getUnknownXMLObjects().add(sector);
- }
-
- //Delete from specification. Kept for compatibility with Provider Name value
- LOG.debug("Generate SPInstitution");
- final SPInstitution institution = SAMLEngineUtils
- .generateSPInstitution(request.getProviderName());
- extensions.getUnknownXMLObjects().add(institution);
-
-
- if (StringUtils.isNotEmpty(request.getSpApplication())) {
- LOG.debug("Generate SPApplication");
- final SPApplication application = SAMLEngineUtils
- .generateSPApplication(request.getSpApplication());
- extensions.getUnknownXMLObjects().add(application);
- }
-
- if (StringUtils.isNotEmpty(request.getSpCountry())) {
- LOG.debug("Generate SPCountry");
- final SPCountry country = SAMLEngineUtils.generateSPCountry(request
- .getSpCountry());
- extensions.getUnknownXMLObjects().add(country);
- }
-
- //eIDSectorShare: optional; default value: false.
- String valueSectorShare = super.getSamlCoreProperties()
- .iseIDSectorShare();
-
- if (StringUtils.isNotEmpty(valueSectorShare)) {
- // Add information about the use of the SAML message.
- LOG.debug("Generate EIDSectorShare");
- final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
- .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
-
- eIdSectorShare.setEIDSectorShare(String.valueOf(Boolean.valueOf(valueSectorShare)));
-
- extensions.getUnknownXMLObjects().add(eIdSectorShare);
- }
-
- String valueCrossSectorShare = super.getSamlCoreProperties()
- .iseIDCrossSectorShare();
-
- if (StringUtils.isNotEmpty(valueCrossSectorShare)) {
- LOG.debug("Generate EIDCrossSectorShare");
- final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
- .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
- eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(Boolean.valueOf(valueCrossSectorShare)));
- extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
- }
-
-
- String valueCrossBorderShare = super.getSamlCoreProperties()
- .iseIDCrossBorderShare();
-
- if (StringUtils.isNotEmpty(valueCrossBorderShare)) {
- LOG.debug("Generate EIDCrossBorderShare");
- final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
- .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
- eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(Boolean.valueOf(valueCrossBorderShare)));
- extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
- }
-
-
- // Add information about requested attributes.
- LOG.debug("Generate RequestedAttributes.");
- final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
- .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
-
- LOG.debug("SAML Engine configuration properties load.");
- final Iterator<PersonalAttribute> iterator = request
- .getPersonalAttributeList().iterator();
-
- while (iterator.hasNext()) {
-
- final PersonalAttribute attribute = iterator.next();
-
- if (attribute == null || StringUtils.isBlank(attribute.getName())) {
- LOG.error(ATTRIBUTE_EMPTY_LITERAL);
- throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
- }
-
- // Verified if exits the attribute name.
- final String attributeName = super.getSamlCoreProperties()
- .getProperty(attribute.getName());
-
- if (StringUtils.isBlank(attributeName)) {
- LOG.debug("Attribute name: {} was not found.", attribute
- .getName());
- throw new STORKSAMLEngineException("Attribute name: "
- + attribute.getName() + " was not found.");
- }
-
- // Friendly name it's an optional attribute.
- String friendlyName = null;
-
- if (super.getSamlCoreProperties().isFriendlyName()) {
- friendlyName = attribute.getName();
- }
-
-
- String isRequired = null;
- if (super.getSamlCoreProperties().isRequired()) {
- isRequired = String.valueOf(attribute.isRequired());
- }
-
-
- LOG.debug("Generate requested attribute: " + attributeName);
- final RequestedAttribute requestedAttr = SAMLEngineUtils
- .generateReqAuthnAttributeSimple(attributeName,
- friendlyName, isRequired, attribute
- .getValue());
-
- // Add requested attribute.
- reqAttributes.getAttributes().add(requestedAttr);
- }
-
- // Add requested attributes.
- extensions.getUnknownXMLObjects().add(reqAttributes);
-
- CitizenCountryCode citizenCountryCode = null;
- if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
- LOG.debug("Generate CitizenCountryCode");
- citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
- .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
-
- citizenCountryCode.setCitizenCountryCode(request
- .getCitizenCountryCode().toUpperCase());
- }
-
- SPID spid = null;
- if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
- LOG.debug("Generate SPID");
- spid = (SPID) SAMLEngineUtils
- .createSamlObject(SPID.DEF_ELEMENT_NAME);
-
- spid.setSPID(request.getSPID().toUpperCase());
- }
-
- AuthenticationAttributes authenticationAttr = (AuthenticationAttributes) SAMLEngineUtils
- .createSamlObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
-
- final VIDPAuthenticationAttributes vIDPauthenticationAttr = (VIDPAuthenticationAttributes) SAMLEngineUtils
- .createSamlObject(VIDPAuthenticationAttributes.DEF_ELEMENT_NAME);
-
- final SPInformation spInformation = (SPInformation) SAMLEngineUtils
- .createSamlObject(SPInformation.DEF_ELEMENT_NAME);
-
- if(citizenCountryCode!=null){
- vIDPauthenticationAttr.setCitizenCountryCode(citizenCountryCode);
- }
-
- if(spid!=null){
- spInformation.setSPID(spid);
- }
-
- vIDPauthenticationAttr.setSPInformation(spInformation);
-
- authenticationAttr
- .setVIDPAuthenticationAttributes(vIDPauthenticationAttr);
- extensions.getUnknownXMLObjects().add(authenticationAttr);
-
-
- return extensions;
-
- }
-
- /**
- * Generate stork extensions.
- *
- * @param request the attribute query request
- *
- * @return the extensions
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Extensions generateSTORKAttrExtensions(final STORKAttrQueryRequest request)
- throws STORKSAMLEngineException {
- LOG.debug("Generate STORKExtensions");
-
- final Extensions extensions = SAMLEngineUtils.generateExtension();
-
- LOG.debug("Generate QAAAttribute");
- final QAAAttribute qaaAttribute = SAMLEngineUtils
- .generateQAAAttribute(request.getQaa());
- extensions.getUnknownXMLObjects().add(qaaAttribute);
-
-
- if (StringUtils.isNotEmpty(request
- .getSpSector())) {
- // Add information about service provider.
- LOG.debug("Generate SPSector");
- final SPSector sector = SAMLEngineUtils.generateSPSector(request
- .getSpSector());
- extensions.getUnknownXMLObjects().add(sector);
- }
-
-
- if (StringUtils.isNotEmpty(request.getSpApplication())) {
- LOG.debug("Generate SPApplication");
- final SPApplication application = SAMLEngineUtils
- .generateSPApplication(request.getSpApplication());
- extensions.getUnknownXMLObjects().add(application);
- }
-
- if (StringUtils.isNotEmpty(request.getSpCountry())) {
- LOG.debug("Generate SPCountry");
- final SPCountry country = SAMLEngineUtils.generateSPCountry(request
- .getSpCountry());
- extensions.getUnknownXMLObjects().add(country);
- }
-
- final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
- .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
-
- eIdSectorShare.setEIDSectorShare(String.valueOf(request.isEIDSectorShare()));
-
- extensions.getUnknownXMLObjects().add(eIdSectorShare);
-
- final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
- .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
- eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(request.isEIDCrossSectorShare()));
- extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
-
- final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
- .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
- eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(request.isEIDCrossBorderShare()));
- extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
-
-
- // Add information about requested attributes.
- LOG.debug("Generate RequestedAttributes.");
- final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
- .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
-
- LOG.debug("SAML Engine configuration properties load.");
- final Iterator<PersonalAttribute> iterator = request
- .getPersonalAttributeList().iterator();
-
- while (iterator.hasNext()) {
-
- final PersonalAttribute attribute = iterator.next();
-
- if (attribute == null || StringUtils.isBlank(attribute.getName())) {
- LOG.error(ATTRIBUTE_EMPTY_LITERAL);
- throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
- }
-
- // Verified if exits the attribute name.
- final String attributeName = super.getSamlCoreProperties()
- .getProperty(attribute.getName());
-
- if (StringUtils.isBlank(attributeName)) {
- LOG.debug("Attribute name: {} was not found.", attribute
- .getName());
- throw new STORKSAMLEngineException("Attribute name: "
- + attribute.getName() + " was not found.");
- }
-
- // Friendly name it's an optional attribute.
- String friendlyName = null;
-
- if (super.getSamlCoreProperties().isFriendlyName()) {
- friendlyName = attribute.getName();
- }
-
-
- String isRequired = null;
- if (super.getSamlCoreProperties().isRequired()) {
- isRequired = String.valueOf(attribute.isRequired());
- }
-
-
- LOG.debug("Generate requested attribute: " + attributeName);
- final RequestedAttribute requestedAttr = SAMLEngineUtils
- .generateReqAuthnAttributeSimple(attributeName,
- friendlyName, isRequired, attribute
- .getValue());
-
- // Add requested attribute.
- reqAttributes.getAttributes().add(requestedAttr);
- }
-
- // Add requested attributes.
- extensions.getUnknownXMLObjects().add(reqAttributes);
-
- CitizenCountryCode citizenCountryCode = null;
- if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
- LOG.debug("Generate CitizenCountryCode");
- citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
- .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
-
- citizenCountryCode.setCitizenCountryCode(request
- .getCitizenCountryCode().toUpperCase());
- }
-
- SPID spid = null;
- if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
- LOG.debug("Generate SPID");
- spid = (SPID) SAMLEngineUtils
- .createSamlObject(SPID.DEF_ELEMENT_NAME);
-
- spid.setSPID(request.getSPID().toUpperCase());
- }
-
-
- return extensions;
-
- }
-
- /**
- * Gets the alias from X.509 Certificate at keystore.
- *
- * @param keyInfo the key info
- * @param storkOwnKeyStore
- * @param storkOwnKeyStore
- *
- * @return the alias
- */
- private String getAlias(final KeyInfo keyInfo, KeyStore storkOwnKeyStore) {
-
- LOG.debug("Recover alias information");
-
- String alias = null;
- try {
- final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
- .getX509Datas().get(0).getX509Certificates().get(0);
-
- // Transform the KeyInfo to X509Certificate.
- CertificateFactory certFact;
- certFact = CertificateFactory.getInstance("X.509");
-
- final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
- .decode(xmlCert.getValue()));
-
- final X509Certificate cert = (X509Certificate) certFact
- .generateCertificate(bis);
-
- final String tokenSerialNumber = cert.getSerialNumber().toString(16);
- final X509Principal tokenIssuerDN = new X509Principal(cert.getIssuerDN().getName());
-
-
- String aliasCert;
- X509Certificate certificate;
- boolean find = false;
-
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
- .hasMoreElements()
- && !find; ) {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) storkOwnKeyStore
- .getCertificate(aliasCert);
-
- final String serialNum = certificate.getSerialNumber()
- .toString(16);
-
- X509Principal issuerDN = new X509Principal(certificate
- .getIssuerDN().getName());
-
- if(serialNum.equalsIgnoreCase(tokenSerialNumber)
- && X509PrincipalUtil.equals2(issuerDN, tokenIssuerDN)){
- alias = aliasCert;
- find = true;
- }
-
- }
-
- } catch (KeyStoreException e) {
- LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
- } catch (CertificateException e) {
- LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
- } catch (RuntimeException e) {
- LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
- }
- return alias;
- }
-
- /**
- * Gets the country from X.509 Certificate.
- *
- * @param keyInfo the key info
- *
- * @return the country
- */
- private String getCountry(final KeyInfo keyInfo) {
- LOG.debug("Recover country information.");
-
- String result = "";
- try {
- final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
- .getX509Datas().get(0).getX509Certificates().get(0);
-
- // Transform the KeyInfo to X509Certificate.
- CertificateFactory certFact;
- certFact = CertificateFactory.getInstance("X.509");
-
- final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
- .decode(xmlCert.getValue()));
-
- final X509Certificate cert = (X509Certificate) certFact
- .generateCertificate(bis);
-
- String distName = cert.getSubjectDN().toString();
-
- distName = StringUtils.deleteWhitespace(StringUtils
- .upperCase(distName));
-
- final String countryCode = "C=";
- final int init = distName.indexOf(countryCode);
-
- if (init > StringUtils.INDEX_NOT_FOUND) { // Exist country code.
- int end = distName.indexOf(',', init);
-
- if (end <= StringUtils.INDEX_NOT_FOUND) {
- end = distName.length();
- }
-
- if (init < end && end > StringUtils.INDEX_NOT_FOUND) {
- result = distName.substring(init + countryCode.length(),
- end);
- //It must be a two characters value
- if(result.length()>2){
- result = result.substring(0, 2);
- }
- }
- }
-
- } catch (CertificateException e) {
- LOG.error("Procces getCountry from certificate.");
- }
- return result.trim();
- }
-
- /**
- * Process all elements XMLObjects from the extensions.
- *
- * @param extensions the extensions from the authentication request.
- *
- * @return the STORK authentication request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private STORKAuthnRequest processExtensions(final Extensions extensions)
- throws STORKSAMLEngineException {
- LOG.debug("Procces the extensions.");
-
- final STORKAuthnRequest request = new STORKAuthnRequest();
-
- final QAAAttribute qaa = (QAAAttribute) extensions
- .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
- request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
-
- List optionalElements = extensions.getUnknownXMLObjects(
- SPSector.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
- SPSector.DEF_ELEMENT_NAME).get(0);
- request.setSpSector(sector.getSPSector());
- }
-
- optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPApplication application = (SPApplication) extensions
- .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
- request.setSpApplication(application.getSPApplication());
- }
-
- optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPCountry application = (SPCountry) extensions
- .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
- request.setSpCountry(application.getSPCountry());
- }
-
-
- List listCrossBorderShare = extensions
- .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
-
- if (!listCrossBorderShare .isEmpty()) {
- final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
- request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
- .getEIDCrossBorderShare()));
- }
-
-
- List listCrosSectorShare = extensions
- .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
-
- if (!listCrosSectorShare.isEmpty()) {
- final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
- request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
- .getEIDCrossSectorShare()));
- }
-
- List listSectorShareExtension = extensions
- .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
- if (!listSectorShareExtension.isEmpty()) {
- final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
- request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
- }
-
-
-
- List<XMLObject> authAttrs = extensions
- .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
-
- if (authAttrs != null && !authAttrs.isEmpty()) {
-
- final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
- .get(0);
-
- VIDPAuthenticationAttributes vidpAuthnAttr = null;
- if (authnAttr != null && !authAttrs.isEmpty()){
- vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
- }
-
- CitizenCountryCode citizenCountryCodeElement = null;
- SPInformation spInformation = null;
- if (vidpAuthnAttr != null){
- citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
- spInformation = vidpAuthnAttr.getSPInformation();
- }
-
- String citizenCountryCode = null;
- if(citizenCountryCodeElement!=null){
- citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
- }
-
- if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
- request.setCitizenCountryCode(citizenCountryCode);
- }
-
- SPID spidElement = null;
- if (spInformation != null){
- spidElement = spInformation.getSPID();
- }
-
- String spid = null;
- if(spidElement!=null){
- spid = spidElement.getSPID();
- }
-
- if (spid != null && StringUtils.isNotBlank(spid)) {
- request.setSPID(spid);
- }
- }
-
- if (extensions
- .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
- LOG.error("Extensions not contains any requested attribute.");
- throw new STORKSAMLEngineException(
- "Extensions not contains any requested attribute.");
- }
-
- final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
- .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
- .get(0);
-
- final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
-
- final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
-
- String attributeName;
- for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
- final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
- final PersonalAttribute personalAttribute = new PersonalAttribute();
- personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
- personalAttribute.setFriendlyName(attribute.getFriendlyName());
- attributeName = attribute.getName();
-
- // recover the last name from the string.
- personalAttribute.setName(attributeName.substring(attributeName
- .lastIndexOf('/') + 1));
-
- final ArrayList<String> valores = new ArrayList<String>();
- final List<XMLObject> values = attribute.getOrderedChildren();
-
- for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
-
- // Process attributes simples. An AuthenticationRequest only
- // must contains simple values.
-
- final XMLObject xmlObject = values.get(nextSimpleValue);
-
- if(xmlObject instanceof XSStringImpl){
-
- final XSStringImpl xmlString = (XSStringImpl) values
- .get(nextSimpleValue);
- valores.add(xmlString.getValue());
-
- }else{
-
- if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
-
- final XSAnyImpl xmlString = (XSAnyImpl) values
- .get(nextSimpleValue);
-
- TransformerFactory transFactory = TransformerFactory.newInstance();
- Transformer transformer = null;
- try {
- transformer = transFactory.newTransformer();
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
- } catch (TransformerConfigurationException e) {
- LOG.error("Error transformer configuration exception", e);
- }
- StringWriter buffer = new StringWriter();
- try {
- if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
- transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
- new StreamResult(buffer));
- }
- } catch (TransformerException e) {
- LOG.error("Error transformer exception", e);
- }
- String str = buffer.toString();
-
- valores.add(str);
-
- }else{
-
- final XSAnyImpl xmlString = (XSAnyImpl) values
- .get(nextSimpleValue);
- valores.add(xmlString.getTextContent());
- }
-
-
-
- }
- }
- personalAttribute.setValue(valores);
- personalAttrList.add(personalAttribute);
- }
-
- request.setPersonalAttributeList(personalAttrList);
-
- return request;
- }
-
-
- /**
- * Process all elements XMLObjects from the extensions.
- *
- * @param extensions the extensions from the authentication request.
- *
- * @return the STORK authentication request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private STORKAttrQueryRequest processAttrExtensions(final Extensions extensions)
- throws STORKSAMLEngineException {
- LOG.debug("Procces the atribute query extensions.");
-
- final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
-
- final QAAAttribute qaa = (QAAAttribute) extensions
- .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
- request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
-
- List optionalElements = extensions.getUnknownXMLObjects(
- SPSector.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
- SPSector.DEF_ELEMENT_NAME).get(0);
- request.setSpSector(sector.getSPSector());
- }
-
- optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPApplication application = (SPApplication) extensions
- .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
- request.setSpApplication(application.getSPApplication());
- }
-
- optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
-
- if (!optionalElements.isEmpty()) {
- final SPCountry application = (SPCountry) extensions
- .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
- request.setSpCountry(application.getSPCountry());
- }
-
-
- List listCrossBorderShare = extensions
- .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
-
- if (!listCrossBorderShare .isEmpty()) {
- final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
- request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
- .getEIDCrossBorderShare()));
- }
-
-
- List listCrosSectorShare = extensions
- .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
-
- if (!listCrosSectorShare.isEmpty()) {
- final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
- request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
- .getEIDCrossSectorShare()));
- }
-
- List listSectorShareExtension = extensions
- .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
- if (!listSectorShareExtension.isEmpty()) {
- final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
- request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
- }
-
-
-
- List<XMLObject> authAttrs = extensions
- .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
-
- if (authAttrs != null && !authAttrs.isEmpty()) {
-
- final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
- .get(0);
-
- VIDPAuthenticationAttributes vidpAuthnAttr = null;
- if (authnAttr != null && !authAttrs.isEmpty()){
- vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
- }
-
- CitizenCountryCode citizenCountryCodeElement = null;
- SPInformation spInformation = null;
- if (vidpAuthnAttr != null){
- citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
- spInformation = vidpAuthnAttr.getSPInformation();
- }
-
- String citizenCountryCode = null;
- if(citizenCountryCodeElement!=null){
- citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
- }
-
- if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
- request.setCitizenCountryCode(citizenCountryCode);
- }
-
- SPID spidElement = null;
- if (spInformation != null){
- spidElement = spInformation.getSPID();
- }
-
- String spid = null;
- if(spidElement!=null){
- spid = spidElement.getSPID();
- }
-
- if (spid != null && StringUtils.isNotBlank(spid)) {
- request.setSPID(spid);
- }
- }
-
- if (extensions
- .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
- LOG.error("Extensions not contains any requested attribute.");
- throw new STORKSAMLEngineException(
- "Extensions not contains any requested attribute.");
- }
-
- final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
- .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
- .get(0);
-
- final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
-
- final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
-
- String attributeName;
- for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
- final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
- final PersonalAttribute personalAttribute = new PersonalAttribute();
- personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
- personalAttribute.setFriendlyName(attribute.getFriendlyName());
- attributeName = attribute.getName();
-
- // recover the last name from the string.
- personalAttribute.setName(attributeName.substring(attributeName
- .lastIndexOf('/') + 1));
-
- final ArrayList<String> valores = new ArrayList<String>();
- final List<XMLObject> values = attribute.getOrderedChildren();
-
- for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
-
- // Process attributes simples. An AuthenticationRequest only
- // must contains simple values.
-
- final XMLObject xmlObject = values.get(nextSimpleValue);
-
- if(xmlObject instanceof XSStringImpl){
-
- final XSStringImpl xmlString = (XSStringImpl) values
- .get(nextSimpleValue);
- valores.add(xmlString.getValue());
-
- }else{
-
- if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
-
- final XSAnyImpl xmlString = (XSAnyImpl) values
- .get(nextSimpleValue);
-
- TransformerFactory transFactory = TransformerFactory.newInstance();
- Transformer transformer = null;
- try {
- transformer = transFactory.newTransformer();
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
- } catch (TransformerConfigurationException e) {
- LOG.error("Error transformer configuration exception", e);
- }
- StringWriter buffer = new StringWriter();
- try {
- if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
- transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
- new StreamResult(buffer));
- }
- } catch (TransformerException e) {
- LOG.error("Error transformer exception", e);
- }
- String str = buffer.toString();
-
- valores.add(str);
-
- }else{
-
- final XSAnyImpl xmlString = (XSAnyImpl) values
- .get(nextSimpleValue);
- valores.add(xmlString.getTextContent());
- }
-
-
-
- }
- }
- personalAttribute.setValue(valores);
- personalAttrList.add(personalAttribute);
- }
-
- request.setPersonalAttributeList(personalAttrList);
-
- return request;
- }
-
- /**
- * Sets the name spaces.
- *
- * @param tokenSaml the new name spaces
- */
- private void setNameSpaces(final XMLObject tokenSaml) {
- LOG.debug("Set namespaces.");
-
- final Namespace saml2 = new Namespace(SAMLConstants.SAML20_NS,
- SAMLConstants.SAML20_PREFIX);
- tokenSaml.addNamespace(saml2);
-
- final Namespace digSig = new Namespace(
- "http://www.w3.org/2000/09/xmldsig#", "ds");
- tokenSaml.addNamespace(digSig);
-
- final Namespace storkp = new Namespace(SAMLCore.STORK10P_NS.getValue(),
- SAMLCore.STORK10P_PREFIX.getValue());
- tokenSaml.addNamespace(storkp);
-
- final Namespace stork = new Namespace(SAMLCore.STORK10_NS.getValue(),
- SAMLCore.STORK10_PREFIX.getValue());
-
- tokenSaml.addNamespace(stork);
- }
-
- /**
- * Validate parameters from authentication request.
- *
- * @param request the request.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamAuthnReq(final STORKAuthnRequest request)
- throws STORKSAMLEngineException {
- LOG.info("Validate parameters from authentication request.");
-
- // URL to which Authentication Response must be sent.
- if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
- }
-
- // the name of the original service provider requesting the
- // authentication.
- if (StringUtils.isBlank(request.getProviderName())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Service Provider it's mandatory.");
- }
-
- // object that contain all attributes requesting.
- if (request.getPersonalAttributeList() == null
- || request.getPersonalAttributeList().isEmpty()) {
- throw new STORKSAMLEngineException(
- "attributeQueries is null or empty.");
- }
-
- // Quality authentication assurance level.
- if ((request.getQaa() < QAAAttribute.MIN_VALUE)
- || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
- throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
- + ", is invalid.");
- }
-
- }
-
- /**
- * Validate parameters from attribute query request.
- *
- * @param request the request.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamAttrQueryReq(final STORKAttrQueryRequest request)
- throws STORKSAMLEngineException {
- LOG.info("Validate parameters from attribute query request.");
-
- // URL to which AP Response must be sent.
- if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
- }
-
- // Destination of the request - not mandatory
- /*if (StringUtils.isBlank(request.getDestination())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Destination is mandatory.");
- }*/
-
- // SP country is empty
- if (StringUtils.isBlank(request.getSpCountry())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: SP country is mandatory.");
- }
-
- // object that contain all attributes requesting.
- if (request.getPersonalAttributeList() == null
- || request.getPersonalAttributeList().isEmpty()) {
- throw new STORKSAMLEngineException(
- "attributeQueries is null or empty.");
- }
-
- // Quality authentication assurance level.
- if ((request.getQaa() < QAAAttribute.MIN_VALUE)
- || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
- throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
- + ", is invalid.");
- }
- }
-
- /**
- * Validate parameters from logout request.
- *
- * @param request the request.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamLogoutReq(final STORKLogoutRequest request)
- throws STORKSAMLEngineException {
- LOG.info("Validate parameters from logout request.");
-
- // URL to which AP Response must be sent.
- /*if (StringUtils.isBlank(request.get())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
- }*/
-
- // Destination of the request
- if (StringUtils.isBlank(request.getDestination())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Destination is mandatory.");
- }
-
- // SP Provided Id
- if (StringUtils.isBlank(request.getSpProvidedId())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: SP provided Id is mandatory.");
- }
- }
-
- /**
- * Validate parameters from logout response.
- *
- * @param response the response.
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamLogoutRes(final STORKLogoutRequest request,
- final STORKLogoutResponse response) throws STORKSAMLEngineException {
- LOG.info("Validate parameters from logout request.");
-
- // Issuer is mandatory
- if (StringUtils.isBlank(request.getIssuer())) {
- throw new STORKSAMLEngineException(
- "Issuer must be not empty or null.");
- }
-
- // Destination of the request
- if (StringUtils.isBlank(response.getDestination())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: Destination is mandatory.");
- }
-
- // SP Provided Id
- if (StringUtils.isBlank(request.getSpProvidedId())) {
- throw new STORKSAMLEngineException(
- "StorkSamlEngine: SP provided Id is mandatory.");
- }
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
-
- /**
- * Validate parameters from response.
- *
- * @param request the request
- * @param responseAuthReq the response authentication request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamResponse(final STORKAuthnRequest request,
- final STORKAuthnResponse responseAuthReq)
- throws STORKSAMLEngineException {
- LOG.info("Validate parameters response.");
- if (StringUtils.isBlank(request.getIssuer())) {
- throw new STORKSAMLEngineException(
- "Issuer must be not empty or null.");
- }
-
- if (responseAuthReq.getPersonalAttributeList() == null
- || responseAuthReq.getPersonalAttributeList().isEmpty()) {
- LOG.error("PersonalAttributeList is null or empty.");
- throw new STORKSAMLEngineException(
- "PersonalAttributeList is null or empty.");
- }
-
- if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
- throw new STORKSAMLEngineException(
- "assertionConsumerServiceURL is null or empty.");
- }
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
- /**
- * Validate parameters from response.
- *
- * @param request the request
- * @param responseAttrQueryReq the response authentication request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamAttrQueryResponse(final STORKAttrQueryRequest request,
- final STORKAttrQueryResponse responseAttrQueryReq)
- throws STORKSAMLEngineException {
- LOG.info("Validate attribute querey parameters response.");
- if (StringUtils.isBlank(request.getIssuer())) {
- throw new STORKSAMLEngineException(
- "Issuer must be not empty or null.");
- }
-
- if (responseAttrQueryReq.getPersonalAttributeList() == null
- || responseAttrQueryReq.getPersonalAttributeList().isEmpty()) {
- LOG.error("PersonalAttributeList is null or empty.");
- throw new STORKSAMLEngineException(
- "PersonalAttributeList is null or empty.");
- }
-
- /*if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
- throw new STORKSAMLEngineException(
- "assertionConsumerServiceURL is null or empty.");
- }*/
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
- /**
- * Validate parameter from response fail.
- *
- * @param request the request
- * @param response the response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamResponseFail(final STORKAuthnRequest request,
- final STORKAuthnResponse response) throws STORKSAMLEngineException {
- LOG.info("Validate parameters response fail.");
- if (StringUtils.isBlank(response.getStatusCode())) {
- throw new STORKSAMLEngineException("Code error it's null or empty.");
- }
-
- if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
- throw new STORKSAMLEngineException(
- "assertionConsumerServiceURL is null or empty.");
- }
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
- /**
- * Validate parameter from response fail.
- *
- * @param request the request
- * @param response the response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamAttrQueryResponseFail(final STORKAttrQueryRequest request,
- final STORKAttrQueryResponse response) throws STORKSAMLEngineException {
- LOG.info("Validate parameters response fail.");
- if (StringUtils.isBlank(response.getStatusCode())) {
- throw new STORKSAMLEngineException("Code error it's null or empty.");
- }
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
- /**
- * Validate parameter from response fail.
- *
- * @param request the request
- * @param response the response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private void validateParamLogoutResFail(final STORKLogoutRequest request,
- final STORKLogoutResponse response) throws STORKSAMLEngineException {
- LOG.info("Validate parameters response fail.");
-
- if (StringUtils.isBlank(request.getIssuer())) {
- throw new STORKSAMLEngineException(
- "Issuer must be not empty or null.");
- }
-
- if (StringUtils.isBlank(response.getStatusCode())) {
- throw new STORKSAMLEngineException("Code error it's null or empty.");
- }
-
- if (StringUtils.isBlank(request.getSamlId())) {
- throw new STORKSAMLEngineException("request ID is null or empty.");
- }
- }
-
- /**
- * Validate stork authentication request.
- *
- * @param tokenSaml the token SAML
- *
- * @return the sTORK authentication request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnRequest validateSTORKAuthnRequest(final byte[] tokenSaml)
- throws STORKSAMLEngineException {
- LOG.info("validateSTORKAuthnRequest");
-
- final AuthnRequest samlRequest = (AuthnRequest) validateStorkSaml(tokenSaml);
-
- LOG.debug("Validate Extensions.");
- final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
- try {
- validatorExt.validate(samlRequest.getExtensions());
- } catch (ValidationException e) {
- LOG.error("ValidationException: validate Extensions.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- LOG.debug("Generate STORKAuthnRequest.");
- final STORKAuthnRequest authnRequest = processExtensions(samlRequest
- .getExtensions());
-
- authnRequest.setCountry(this.getCountry(samlRequest.getSignature()
- .getKeyInfo()));
-
- authnRequest.setAlias(this.getAlias(samlRequest.getSignature()
- .getKeyInfo(), super.getSigner().getTrustStore()));
-
- authnRequest.setSamlId(samlRequest.getID());
- authnRequest.setDestination(samlRequest.getDestination());
- authnRequest.setAssertionConsumerServiceURL(samlRequest
- .getAssertionConsumerServiceURL());
-
- authnRequest.setProviderName(samlRequest.getProviderName());
- authnRequest.setIssuer(samlRequest.getIssuer().getValue());
-
- //Delete unknown elements from requested ones
- final Iterator<PersonalAttribute> iterator = authnRequest.getPersonalAttributeList().iterator();
- IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) authnRequest.getPersonalAttributeList();
- while (iterator.hasNext()) {
-
- final PersonalAttribute attribute = iterator.next();
-
- // Verify if the attribute name exits.
- final String attributeName = super.getSamlCoreProperties()
- .getProperty(attribute.getName());
-
- if (StringUtils.isBlank(attributeName)) {
- LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
- cleanPerAttrList.remove(attribute.getName());
- }
-
- }
- authnRequest.setPersonalAttributeList(cleanPerAttrList);
-
- return authnRequest;
-
- }
-
- /**
- * Validate stork attribute query request.
- *
- * @param tokenSaml the token SAML
- *
- * @return the STORK attribute query request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryRequest validateSTORKAttrQueryRequest(final byte[] tokenSaml)
- throws STORKSAMLEngineException {
- LOG.info("validateSTORKAttrQueryRequest");
-
- //final AttributeQuery samlRequest = (AttributeQuery) validateStorkSaml(tokenSaml);
- final CustomRequestAbstractType samlRequest = (CustomRequestAbstractType) validateStorkSaml(tokenSaml);
-
- LOG.debug("Validate Extensions.");
- final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
- try {
- validatorExt.validate(samlRequest.getExtensions());
- } catch (ValidationException e) {
- LOG.error("ValidationException: validate Extensions.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- LOG.debug("Generate STORKAttrQueryRequest.");
- final STORKAttrQueryRequest attrRequest = processAttrExtensions(samlRequest
- .getExtensions());
-
- attrRequest.setCountry(this.getCountry(samlRequest.getSignature()
- .getKeyInfo()));
-
- attrRequest.setAlias(this.getAlias(samlRequest.getSignature()
- .getKeyInfo(), super.getSigner().getTrustStore()));
-
- attrRequest.setSamlId(samlRequest.getID());
- attrRequest.setDestination(samlRequest.getDestination());
- attrRequest.setAssertionConsumerServiceURL(samlRequest
- .getAssertionConsumerServiceURL());
-
- /*authnRequest.setProviderName(samlRequest.getProviderName());*/
- attrRequest.setIssuer(samlRequest.getIssuer().getValue());
-
- //Delete unknown elements from requested ones
- final Iterator<PersonalAttribute> iterator = attrRequest.getPersonalAttributeList().iterator();
- IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) attrRequest.getPersonalAttributeList();
- while (iterator.hasNext()) {
-
- final PersonalAttribute attribute = iterator.next();
-
- // Verify if the attribute name exits.
- final String attributeName = super.getSamlCoreProperties()
- .getProperty(attribute.getName());
-
- if (StringUtils.isBlank(attributeName)) {
- LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
- cleanPerAttrList.remove(attribute.getName());
- }
-
- }
- attrRequest.setPersonalAttributeList(cleanPerAttrList);
-
- return attrRequest;
-
- }
-
- /**
- * Validate stork logout request.
- *
- * @param tokenSaml the token SAML
- *
- * @return the STORK logout request
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKLogoutRequest validateSTORKLogoutRequest(final byte[] tokenSaml)
- throws STORKSAMLEngineException {
- LOG.info("validateSTORKLogoutRequest");
-
- final LogoutRequest samlRequest = (LogoutRequest)validateStorkSaml(tokenSaml);
-
- LOG.debug("Validate Extensions.");
- final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
- try {
- validatorExt.validate(samlRequest.getExtensions());
- } catch (ValidationException e) {
- LOG.error("ValidationException: validate Extensions.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- LOG.debug("Generate STORKLogoutRequest.");
- final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
-
- logoutRequest.setCountry(this.getCountry(samlRequest.getSignature()
- .getKeyInfo()));
-
- logoutRequest.setAlias(this.getAlias(samlRequest.getSignature()
- .getKeyInfo(), super.getSigner().getTrustStore()));
-
- logoutRequest.setSamlId(samlRequest.getID());
- logoutRequest.setDestination(samlRequest.getDestination());
-
- logoutRequest.setIssuer(samlRequest.getIssuer().getValue());
-
- logoutRequest.setSpProvidedId(samlRequest.getNameID().getValue());
-
- return logoutRequest;
-
- }
-
- /**
- * Validate stork authentication response.
- *
- * @param tokenSaml the token SAML
- * @param userIP the user IP
- *
- * @return the Stork authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnResponse validateSTORKAuthnResponse(
- final byte[] tokenSaml, final String userIP)
- throws STORKSAMLEngineException {
-
- LOG.info("validateSTORKAuthnResponse");
- final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
-
- LOG.debug("Create StorkAuthResponse.");
- final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
-
- authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
- .getKeyInfo()));
-
- LOG.debug("Set ID.");
- authnResponse.setSamlId(samlResponse.getID());
- LOG.debug("Set InResponseTo.");
- authnResponse.setInResponseTo(samlResponse.getInResponseTo());
- LOG.debug("Set statusCode.");
- authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
- .getValue());
-
- // Subordinate code.
- if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
- authnResponse.setSubStatusCode(samlResponse.getStatus()
- .getStatusCode().getStatusCode().getValue());
- }
-
- if (samlResponse.getStatus().getStatusMessage() != null) {
- LOG.debug("Set statusMessage.");
- authnResponse.setMessage(samlResponse.getStatus()
- .getStatusMessage().getMessage());
- }
-
- LOG.debug("validateStorkResponse");
- final Assertion assertion = (Assertion) validateStorkResponse(
- samlResponse, userIP);
-
- if(assertion!=null){
- final DateTime serverDate = new DateTime();
-
- if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
- LOG.error("Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + ", server_date: " + serverDate + ")");
- throw new STORKSAMLEngineException(
- "Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + " ), server_date: " + serverDate);
- }
-
- LOG.debug("Set notOnOrAfter.");
- authnResponse.setNotOnOrAfter(assertion.getConditions()
- .getNotOnOrAfter());
-
- LOG.debug("Set notBefore.");
- authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
- .getConditions().getAudienceRestrictions().get(0))
- .getAudiences().get(0).getAudienceURI());
- authnResponse.setAssertions(samlResponse.getAssertions());
- }
-
- // Case no error.
- if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
- .getStatusCode())) {
- LOG.debug("Status Success. Set PersonalAttributeList.");
- authnResponse
- .setPersonalAttributeList(generatePersonalAttributeList(assertion));
- authnResponse.setFail(false);
- } else {
- LOG.debug("Status Fail.");
- authnResponse.setFail(true);
- }
- LOG.debug("Return result.");
- return authnResponse;
-
- }
-
- /**
- * Validate stork authentication response.
- *
- * @param tokenSaml the token SAML
- * @param userIP the user IP
- *
- * @return the Stork authentication response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAuthnResponse validateSTORKAuthnResponseWithQuery(
- final byte[] tokenSaml, final String userIP)
- throws STORKSAMLEngineException {
-
- LOG.info("validateSTORKAuthnResponse");
- final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
-
- LOG.debug("Create StorkAuthResponse.");
- final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
-
- authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
- .getKeyInfo()));
-
- LOG.debug("Set ID.");
- authnResponse.setSamlId(samlResponse.getID());
- LOG.debug("Set InResponseTo.");
- authnResponse.setInResponseTo(samlResponse.getInResponseTo());
- LOG.debug("Set statusCode.");
- authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
- .getValue());
-
- // Subordinate code.
- if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
- authnResponse.setSubStatusCode(samlResponse.getStatus()
- .getStatusCode().getStatusCode().getValue());
- }
-
- if (samlResponse.getStatus().getStatusMessage() != null) {
- LOG.debug("Set statusMessage.");
- authnResponse.setMessage(samlResponse.getStatus()
- .getStatusMessage().getMessage());
- }
-
- LOG.debug("validateStorkResponse");
- final Assertion assertion = (Assertion) validateStorkResponse(
- samlResponse, userIP);
-
- if(assertion!=null){
- final DateTime serverDate = new DateTime();
-
- if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
- LOG.error("Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + ", server_date: " + serverDate + ")");
- throw new STORKSAMLEngineException(
- "Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + " ), server_date: " + serverDate);
- }
-
- LOG.debug("Set notOnOrAfter.");
- authnResponse.setNotOnOrAfter(assertion.getConditions()
- .getNotOnOrAfter());
-
- LOG.debug("Set notBefore.");
- authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
- .getConditions().getAudienceRestrictions().get(0))
- .getAudiences().get(0).getAudienceURI());
- }
-
- // Case no error.
- if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
- .getStatusCode())) {
- LOG.debug("Status Success. Set PersonalAttributeList.");
- authnResponse
- .setPersonalAttributeList(generatePersonalAttributeList(assertion));
- authnResponse.setFail(false);
- } else {
- LOG.debug("Status Fail.");
- authnResponse.setFail(true);
- }
-
- authnResponse.setAssertions(samlResponse.getAssertions());
- if (samlResponse.getAssertions().size() > 1)
- {
- PersonalAttributeList total = new PersonalAttributeList();
- List<IPersonalAttributeList> attrList = new ArrayList();
- for (int i = 0; i < samlResponse.getAssertions().size(); i++)
- {
- Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
- IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
- if (temp != null)
- {
- attrList.add(temp);
- for (PersonalAttribute attribute : temp) {
- PersonalAttribute attr = (PersonalAttribute)attribute.clone();
- attr.setName(attr.getName()+tempAssertion.getID());
- total.add(attr);
- }
- }
- }
- authnResponse.setPersonalAttributeLists(attrList);
- authnResponse.setTotalPersonalAttributeList(total);
- }
-
- LOG.debug("Return result.");
- return authnResponse;
-
- }
-
- /**
- * Validate stork attribute query response.
- *
- * @param tokenSaml the token SAML
- * @param userIP the user IP
- *
- * @return the Stork attribute query response
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public STORKAttrQueryResponse validateSTORKAttrQueryResponse(
- final byte[] tokenSaml, final String userIP)
- throws STORKSAMLEngineException {
-
- LOG.info("validateSTORKAttrQueryResponse");
- final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
-
- LOG.debug("Create StorkAttrQueryResponse.");
- final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
-
- attrQueryResponse.setCountry(this.getCountry(samlResponse.getSignature()
- .getKeyInfo()));
-
- LOG.debug("Set ID.");
- attrQueryResponse.setSamlId(samlResponse.getID());
- LOG.debug("Set InResponseTo.");
- attrQueryResponse.setInResponseTo(samlResponse.getInResponseTo());
- LOG.debug("Set statusCode.");
- attrQueryResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
- .getValue());
-
-
- // Subordinate code.
- if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
- attrQueryResponse.setSubStatusCode(samlResponse.getStatus()
- .getStatusCode().getStatusCode().getValue());
- }
-
- if (samlResponse.getStatus().getStatusMessage() != null) {
- LOG.debug("Set statusMessage.");
- attrQueryResponse.setMessage(samlResponse.getStatus()
- .getStatusMessage().getMessage());
- }
-
- LOG.debug("validateStorkResponse");
- final Assertion assertion = (Assertion) validateStorkResponse(
- samlResponse, userIP);
-
- if(assertion!=null){
- final DateTime serverDate = new DateTime();
-
- attrQueryResponse.setAssertion(assertion);
-
- if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
- LOG.error("Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + ", server_date: " + serverDate + ")");
- throw new STORKSAMLEngineException(
- "Token date expired (getNotOnOrAfter = "
- + assertion.getConditions().getNotOnOrAfter()
- + " ), server_date: " + serverDate);
- }
-
- LOG.debug("Set notOnOrAfter.");
- attrQueryResponse.setNotOnOrAfter(assertion.getConditions()
- .getNotOnOrAfter());
-
- LOG.debug("Set notBefore.");
- attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
-
- attrQueryResponse.setAudienceRestriction(((AudienceRestriction) assertion
- .getConditions().getAudienceRestrictions().get(0))
- .getAudiences().get(0).getAudienceURI());
- }
-
- // Case no error.
- if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(attrQueryResponse
- .getStatusCode())) {
- LOG.debug("Status Success. Set PersonalAttributeList.");
- attrQueryResponse
- .setPersonalAttributeList(generatePersonalAttributeList(assertion));
- attrQueryResponse.setFail(false);
- } else {
- LOG.debug("Status Fail.");
- attrQueryResponse.setFail(true);
- }
-
- attrQueryResponse.setAssertions(samlResponse.getAssertions());
- if (samlResponse.getAssertions().size() > 1)
- {
- PersonalAttributeList total = new PersonalAttributeList();
- List<IPersonalAttributeList> attrList = new ArrayList();
- for (int i = 0; i < samlResponse.getAssertions().size(); i++)
- {
- Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
- IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
- if (temp != null)
- {
- attrList.add(temp);
- for (PersonalAttribute attribute : temp) {
- PersonalAttribute attr = (PersonalAttribute)attribute.clone();
- attr.setName(attr.getName()+tempAssertion.getID());
- total.add(attr);
- }
- }
- }
- attrQueryResponse.setPersonalAttributeLists(attrList);
- attrQueryResponse.setTotalPersonalAttributeList(total);
- }
-
- LOG.debug("Return result.");
- return attrQueryResponse;
-
- }
-
- /**
- * Validate stork response.
- *
- * @param samlResponse the SAML response
- * @param userIP the user IP
- *
- * @return the assertion
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private Assertion validateStorkResponse(final Response samlResponse,
- final String userIP) throws STORKSAMLEngineException {
- // Exist only one Assertion
-
- if (samlResponse.getAssertions() == null
- || samlResponse.getAssertions().isEmpty()) {
- LOG.info("Assertion is null or empty."); //in replace of throw new STORKSAMLEngineException("Assertion is null or empty.")
- return null;
- }
-
- final Assertion assertion = (Assertion) samlResponse.getAssertions()
- .get(0);
-
- LOG.debug("Verified method Bearer");
- for (final Iterator<SubjectConfirmation> iter = assertion.getSubject()
- .getSubjectConfirmations().iterator(); iter.hasNext();) {
- final SubjectConfirmation element = iter.next();
- final boolean isBearer = SubjectConfirmation.METHOD_BEARER
- .equals(element.getMethod());
-
- final boolean ipValidate = super.getSamlCoreProperties()
- .isIpValidation();
-
- if (ipValidate) {
- if (isBearer) {
- if (StringUtils.isBlank(userIP)) {
- LOG.error("browser_ip is null or empty.");
- throw new STORKSAMLEngineException(
- "browser_ip is null or empty.");
- } else if (StringUtils.isBlank(element
- .getSubjectConfirmationData().getAddress())) {
- LOG.error("token_ip attribute is null or empty.");
- throw new STORKSAMLEngineException(
- "token_ip attribute is null or empty.");
- }
- }
-
- final boolean ipEqual = element.getSubjectConfirmationData()
- .getAddress().equals(userIP);
-
- // Validation ipUser
- if (!ipEqual && ipValidate) {
- LOG.error("SubjectConfirmation BEARER: ");
- throw new STORKSAMLEngineException(
- "IPs doesn't match : token_ip ("
- + element.getSubjectConfirmationData()
- .getAddress() + ") browser_ip ("
- + userIP + ")");
- }
- }
-
- }
- return assertion;
- }
-
- /**
- * Validate stork SAML.
- *
- * @param tokenSaml the token SAML
- *
- * @return the signable SAML object
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- private SignableSAMLObject validateStorkSaml(final byte[] tokenSaml)
- throws STORKSAMLEngineException {
-
- LOG.info("Validate StorkSaml message.");
-
- if (tokenSaml == null) {
- LOG.error("Saml authentication request is null.");
- throw new STORKSAMLEngineException(
- "Saml authentication request is null.");
- }
-
- LOG.debug("Generate AuthnRequest from request.");
- SignableSAMLObject samlObject;
-
- try {
- samlObject = (SignableSAMLObject) super.unmarshall(tokenSaml);
- } catch (SAMLEngineException e) {
- LOG.error("SAMLEngineException unmarshall.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- boolean validateSign = true;
-
- if (StringUtils.isNotBlank(super.getSamlCoreProperties().getProperty(
- "validateSignature"))) {
- validateSign = Boolean.valueOf(super.getSamlCoreProperties()
- .getProperty("validateSignature"));
- }
-
- if (validateSign) {
- LOG.debug("Validate Signature.");
- try {
- super.validateSignature(samlObject);
- } catch (SAMLEngineException e) {
- LOG.error("SAMLEngineException validateSignature.", e);
- throw new STORKSAMLEngineException(e);
- }
- }
-
- LOG.debug("Validate Schema.");
- final ValidatorSuite validatorSuite = Configuration
- .getValidatorSuite("saml2-core-schema-validator");
- try {
- if (samlObject.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- CustomAttributeQueryValidator val =
- new CustomAttributeQueryValidator();
- val.validate((CustomAttributeQuery)samlObject);
- }
- else
- validatorSuite.validate(samlObject);
- } catch (ValidationException e) {
- LOG.error("ValidationException.", e);
- throw new STORKSAMLEngineException(e);
- }
-
- return samlObject;
- }
-
- private boolean isComplex(XMLObject xmlObject)
- {
- boolean isComplex = false;
-
- final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
-
- for (int nextComplexValue = 0; nextComplexValue < complexValue
- .getUnknownXMLObjects().size(); nextComplexValue++) {
-
- final XSAnyImpl simple = (XSAnyImpl) complexValue
- .getUnknownXMLObjects().get(
- nextComplexValue);
-
- if (simple.getElementQName().getLocalPart() != null)
- {
- isComplex = true;
- break;
- }
- }
-
- return isComplex;
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.commons.lang.StringUtils;
+import org.bouncycastle.jce.X509Principal;
+import org.joda.time.DateTime;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.common.Extensions;
+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.AuthnContextDecl;
+import org.opensaml.saml2.core.AuthnRequest;
+import org.opensaml.saml2.core.AuthnStatement;
+import org.opensaml.saml2.core.Conditions;
+import org.opensaml.saml2.core.Issuer;
+import org.opensaml.saml2.core.LogoutRequest;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.saml2.core.OneTimeUse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.saml2.core.Status;
+import org.opensaml.saml2.core.StatusCode;
+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.core.impl.SubjectConfirmationBuilder;
+import org.opensaml.xml.Namespace;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSAny;
+import org.opensaml.xml.schema.impl.XSAnyBuilder;
+import org.opensaml.xml.schema.impl.XSAnyImpl;
+import org.opensaml.xml.schema.impl.XSAnyMarshaller;
+import org.opensaml.xml.schema.impl.XSAnyUnmarshaller;
+import org.opensaml.xml.schema.impl.XSStringImpl;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+import org.opensaml.xml.validation.ValidatorSuite;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.commons.STORKLogoutRequest;
+import eu.stork.peps.auth.commons.STORKLogoutResponse;
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+import eu.stork.peps.auth.engine.core.SPApplication;
+import eu.stork.peps.auth.engine.core.SPCountry;
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import eu.stork.peps.auth.engine.core.SPSector;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.AuthenticationAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeBuilder;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.CitizenCountryCodeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossBorderShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDCrossSectorShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareBuilder;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareMarshaller;
+import eu.stork.peps.auth.engine.core.impl.EIDSectorShareUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeBuilder;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.QAAAttributeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeBuilder;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeMarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributeUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.RequestedAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPApplicationUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPCountryBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPCountryMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPCountryUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPIDBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPIDMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPIDUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInformationBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPInformationMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInformationUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPInstitutionUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPSectorBuilder;
+import eu.stork.peps.auth.engine.core.impl.SPSectorMarshaller;
+import eu.stork.peps.auth.engine.core.impl.SPSectorUnmarshaller;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesBuilder;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesMarshaller;
+import eu.stork.peps.auth.engine.core.impl.VIDPAuthenticationAttributesUnmarshaller;
+import eu.stork.peps.auth.engine.core.validator.CustomAttributeQueryValidator;
+import eu.stork.peps.auth.engine.core.validator.ExtensionsSchemaValidator;
+import eu.stork.peps.auth.engine.core.validator.MultipleAssertionResponseValidator;
+import eu.stork.peps.auth.engine.core.validator.QAAAttributeSchemaValidator;
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * Class that wraps the operations over SAML tokens, both generation and
+ * validation of SAML STORK requests and SAML STORK responses. Complaint with
+ * "OASIS Secure Assertion Markup Language (SAML) 2.0, May 2005", but taking
+ * into account STORK specific requirements.
+ *
+ * @author fjquevedo
+ * @author iinigo
+ */
+public final class STORKSAMLEngine extends SAMLEngine {
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(STORKSAMLEngine.class.getName());
+
+ private static final String ATTRIBUTE_EMPTY_LITERAL = "Attribute name is null or empty.";
+ /**
+ * Gets the single instance of STORKSAMLEngine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @return single instance of STORKSAMLEngine
+ */
+ public static synchronized STORKSAMLEngine getInstance(
+ final String nameInstance) {
+ STORKSAMLEngine engine = null;
+ LOG.info("Get instance: " + nameInstance);
+ try {
+ engine = new STORKSAMLEngine(nameInstance.trim());
+ } catch (Exception e) {
+ LOG.error("Error getting instance: " + nameInstance);
+ e.printStackTrace();
+ }
+ return engine;
+ }
+
+ /**
+ * Instantiate a new STORKSAML engine.
+ *
+ * @param nameInstance the name instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKSAMLEngine(final String nameInstance)
+ throws STORKSAMLEngineException {
+ // Initialization OpenSAML.
+ super(nameInstance);
+ LOG.info("Register STORK objects provider.");
+ Configuration.registerObjectProvider(QAAAttribute.DEF_ELEMENT_NAME,
+ new QAAAttributeBuilder(), new QAAAttributeMarshaller(),
+ new QAAAttributeUnmarshaller());
+
+ Configuration.registerObjectProvider(EIDSectorShare.DEF_ELEMENT_NAME,
+ new EIDSectorShareBuilder(), new EIDSectorShareMarshaller(),
+ new EIDSectorShareUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ EIDCrossSectorShare.DEF_ELEMENT_NAME,
+ new EIDCrossSectorShareBuilder(),
+ new EIDCrossSectorShareMarshaller(),
+ new EIDCrossSectorShareUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ EIDCrossBorderShare.DEF_ELEMENT_NAME,
+ new EIDCrossBorderShareBuilder(),
+ new EIDCrossBorderShareMarshaller(),
+ new EIDCrossBorderShareUnmarshaller());
+
+ Configuration.registerObjectProvider(SPSector.DEF_ELEMENT_NAME,
+ new SPSectorBuilder(), new SPSectorMarshaller(),
+ new SPSectorUnmarshaller());
+
+ Configuration.registerObjectProvider(SPInstitution.DEF_ELEMENT_NAME,
+ new SPInstitutionBuilder(), new SPInstitutionMarshaller(),
+ new SPInstitutionUnmarshaller());
+
+ Configuration.registerObjectProvider(SPApplication.DEF_ELEMENT_NAME,
+ new SPApplicationBuilder(), new SPApplicationMarshaller(),
+ new SPApplicationUnmarshaller());
+
+ Configuration.registerObjectProvider(SPCountry.DEF_ELEMENT_NAME,
+ new SPCountryBuilder(), new SPCountryMarshaller(),
+ new SPCountryUnmarshaller());
+
+ Configuration.registerObjectProvider(XSAny.TYPE_NAME,
+ new XSAnyBuilder(), new XSAnyMarshaller(),
+ new XSAnyUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ RequestedAttribute.DEF_ELEMENT_NAME,
+ new RequestedAttributeBuilder(),
+ new RequestedAttributeMarshaller(),
+ new RequestedAttributeUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ RequestedAttributes.DEF_ELEMENT_NAME,
+ new RequestedAttributesBuilder(),
+ new RequestedAttributesMarshaller(),
+ new RequestedAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ AuthenticationAttributes.DEF_ELEMENT_NAME,
+ new AuthenticationAttributesBuilder(),
+ new AuthenticationAttributesMarshaller(),
+ new AuthenticationAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ VIDPAuthenticationAttributes.DEF_ELEMENT_NAME,
+ new VIDPAuthenticationAttributesBuilder(),
+ new VIDPAuthenticationAttributesMarshaller(),
+ new VIDPAuthenticationAttributesUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ CitizenCountryCode.DEF_ELEMENT_NAME,
+ new CitizenCountryCodeBuilder(),
+ new CitizenCountryCodeMarshaller(),
+ new CitizenCountryCodeUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ SPID.DEF_ELEMENT_NAME,
+ new SPIDBuilder(),
+ new SPIDMarshaller(),
+ new SPIDUnmarshaller());
+
+ Configuration.registerObjectProvider(
+ SPInformation.DEF_ELEMENT_NAME,
+ new SPInformationBuilder(),
+ new SPInformationMarshaller(),
+ new SPInformationUnmarshaller());
+
+ LOG.info("Register STORK object validators.");
+ final ValidatorSuite validatorSuite = new ValidatorSuite(
+ QAAAttribute.DEF_LOCAL_NAME);
+
+ validatorSuite.registerValidator(QAAAttribute.DEF_ELEMENT_NAME,
+ new QAAAttributeSchemaValidator());
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+ validatorSuite.registerValidator(extensions.getElementQName(),
+ new ExtensionsSchemaValidator());
+
+ Configuration.registerValidatorSuite(
+ "stork:QualityAuthenticationAssuranceLevel", validatorSuite);
+
+ }
+
+ /**
+ * Generate authentication response base.
+ *
+ * @param status the status
+ * @param assertConsumerURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ *
+ * @return the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Response genAuthnRespBase(final Status status,
+ final String assertConsumerURL, final String inResponseTo)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate Authentication Response base.");
+ final Response response = SAMLEngineUtils.generateResponse(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), status);
+
+ // Set name Spaces
+ this.setNameSpaces(response);
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer");
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+ issuer.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
+
+ response.setIssuer(issuer);
+
+ // destination Mandatory Stork
+ response.setDestination(assertConsumerURL.trim());
+
+ // inResponseTo Mandatory Stork
+ response.setInResponseTo(inResponseTo.trim());
+
+ // Optional STORK
+ response.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnResponse());
+
+ return response;
+ }
+
+ /**
+ * Generate attribute query response base.
+ *
+ * @param status the status
+ * @param destinationURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ *
+ * @return the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Response genAttrQueryRespBase(final Status status,
+ final String destinationURL, final String inResponseTo)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate Attribute query Response base.");
+ final Response response = SAMLEngineUtils.generateResponse(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), status);
+
+ // Set name Spaces
+ this.setNameSpaces(response);
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer");
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+ issuer.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuer.setFormat(super.getSamlCoreProperties().getFormatEntity());
+
+ response.setIssuer(issuer);
+
+ // destination Mandatory Stork
+ response.setDestination(destinationURL.trim());
+
+ // inResponseTo Mandatory Stork
+ response.setInResponseTo(inResponseTo.trim());
+
+ // Optional STORK
+ response.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnResponse());
+
+ return response;
+ }
+
+ /**
+ * Generate assertion.
+ *
+ * @param ipAddress the IP address.
+ * @param assertConsumerURL the assert consumer URL.
+ * @param inResponseTo the in response to
+ * @param issuer the issuer
+ * @param notOnOrAfter the not on or after
+ *
+ * @return the assertion
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Assertion generateAssertion(final String ipAddress,
+ final String assertConsumerURL, final String inResponseTo,
+ final String issuer, final DateTime notOnOrAfter)
+ throws STORKSAMLEngineException {
+ LOG.info("Generate Assertion.");
+
+ // Mandatory STORK
+ LOG.debug("Generate Issuer to Assertion");
+ final Issuer issuerAssertion = SAMLEngineUtils.generateIssuer();
+ issuerAssertion.setValue(super.getSamlCoreProperties().getResponder());
+
+ // Format Entity Optional STORK
+ issuerAssertion.setFormat(super.getSamlCoreProperties()
+ .getFormatEntity());
+
+ final Assertion assertion = SAMLEngineUtils.generateAssertion(
+ SAMLVersion.VERSION_20, SAMLEngineUtils.generateNCName(),
+ SAMLEngineUtils.getCurrentTime(), issuerAssertion);
+
+ final Subject subject = SAMLEngineUtils.generateSubject();
+
+ // Mandatory STORK verified
+ // String format = NameID.UNSPECIFIED
+ // specification: 'SAML:2.0' exist
+ // opensaml: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
+ // opensaml "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"
+ final String format = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
+
+ final String nameQualifier = "";
+
+ LOG.debug("Generate NameID");
+ final NameID nameId = SAMLEngineUtils.generateNameID(super
+ .getSamlCoreProperties().getResponder(), format, nameQualifier);
+ nameId.setValue(format);
+ subject.setNameID(nameId);
+
+ // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
+ // Optional in other case.
+ LOG.debug("Generate SubjectConfirmationData.");
+ final SubjectConfirmationData dataBearer = SAMLEngineUtils
+ .generateSubjectConfirmationData(SAMLEngineUtils
+ .getCurrentTime(), assertConsumerURL, inResponseTo);
+
+ // Mandatory if urn:oasis:names:tc:SAML:2.0:cm:bearer.
+ // Optional in other case.
+ LOG.debug("Generate SubjectConfirmation");
+ final SubjectConfirmation subjectConf = SAMLEngineUtils
+ .generateSubjectConfirmation(SubjectConfirmation.METHOD_BEARER,
+ dataBearer);
+
+ final ArrayList<SubjectConfirmation> listSubjectConf = new ArrayList<SubjectConfirmation>();
+ listSubjectConf.add(subjectConf);
+
+ for (final Iterator<SubjectConfirmation> iter = listSubjectConf
+ .iterator(); iter.hasNext();) {
+ final SubjectConfirmation element = iter.next();
+
+ if (SubjectConfirmation.METHOD_BEARER.equals(element.getMethod())) {
+ // ipAddress Mandatory if method is Bearer.
+
+ if (StringUtils.isBlank(ipAddress)) {
+ throw new STORKSAMLEngineException(
+ "ipAddress is null or empty");
+ }
+ element.getSubjectConfirmationData().setAddress(
+ ipAddress.trim());
+ }
+
+ element.getSubjectConfirmationData()
+ .setRecipient(assertConsumerURL);
+ element.getSubjectConfirmationData().setNotOnOrAfter(notOnOrAfter);
+ }
+
+ // The SAML 2.0 specification allows multiple SubjectConfirmations
+ subject.getSubjectConfirmations().addAll(listSubjectConf);
+
+ // Mandatory Stork
+ assertion.setSubject(subject);
+
+ // Conditions that MUST be evaluated when assessing the validity of
+ // and/or when using the assertion.
+ final Conditions conditions = this.generateConditions(SAMLEngineUtils
+ .getCurrentTime(), notOnOrAfter, issuer);
+
+ assertion.setConditions(conditions);
+
+ LOG.debug("Generate stork Authentication Statement.");
+ final AuthnStatement storkAuthnStat = this
+ .generateStorkAuthStatement(ipAddress);
+ assertion.getAuthnStatements().add(storkAuthnStat);
+
+ return assertion;
+ }
+
+ private String getAttributeName(final PersonalAttribute attribute) throws STORKSAMLEngineException {
+ if (StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.error("Attribute name: {} it is not known.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " it is not known.");
+ }
+ return attributeName;
+ }
+ /**
+ * Generate attribute statement.
+ *
+ * @param personalAttrList the personal attribute list
+ * @param isHashing the is hashing
+ *
+ * @return the attribute statement
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ * @throws IOException
+ */
+ private AttributeStatement generateAttributeStatement(
+ final IPersonalAttributeList personalAttrList,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute statement");
+
+ final AttributeStatement attrStatement = (AttributeStatement) SAMLEngineUtils
+ .createSamlObject(AttributeStatement.DEFAULT_ELEMENT_NAME);
+
+ for (PersonalAttribute attribute : personalAttrList) {
+
+ String attributeName = getAttributeName(attribute);
+
+ // Verification that only one value it's permitted, simple or
+ // complex, not both.
+
+ final boolean simpleNull = (attribute.getValue() == null);
+ final boolean simpleEmpty = (simpleNull || (!simpleNull && attribute
+ .getValue().isEmpty()));
+
+ final boolean complexNull = (attribute.getComplexValue() == null);
+ final boolean complexEmpty = (complexNull || (!complexNull && attribute
+ .getComplexValue().isEmpty()));
+
+ if ((!simpleEmpty && !complexEmpty)) {
+ throw new STORKSAMLEngineException(
+ "Attribute name: "
+ + attribute.getName()
+ + " must be contain one value, simple or complex value.");
+ } else {
+
+ if (!simpleEmpty) {
+ attrStatement.getAttributes().add(
+ this.generateAttrSimple(attributeName, attribute
+ .getStatus(), attribute.getValue(),
+ isHashing));
+ } else if (!complexEmpty) {
+ attrStatement.getAttributes().add(
+ SAMLEngineUtils.generateAttrComplex(attributeName,
+ attribute.getStatus(), attribute
+ .getComplexValue(), isHashing));
+ } else if (!simpleNull) {
+ attrStatement.getAttributes().add(
+ this.generateAttrSimple(attributeName, attribute
+ .getStatus(), new ArrayList<String>(),
+ isHashing));
+ } else {
+ // Add attribute complex.
+ attrStatement.getAttributes().add(
+ SAMLEngineUtils.generateAttrComplex(attributeName,
+ attribute.getStatus(),
+ new HashMap<String, String>(), isHashing));
+ }
+ }
+ }
+ return attrStatement;
+ }
+ private XSAny createAttributeValueForSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true);
+ Document document = null;
+ DocumentBuilder builder;
+
+ // Parse the signedDoc value into an XML DOM Document
+ try {
+ builder = domFactory.newDocumentBuilder();
+ InputStream is;
+ is = new ByteArrayInputStream(value.trim().getBytes("UTF-8"));
+ document = builder.parse(is);
+ is.close();
+ } catch (SAXException e1) {
+ LOG.error("SAX Error while parsing signModule attribute", e1);
+ throw new STORKSAMLEngineRuntimeException(e1);
+ } catch (ParserConfigurationException e2) {
+ LOG.error("Parser Configuration Error while parsing signModule attribute", e2);
+ throw new STORKSAMLEngineRuntimeException(e2);
+ } catch (UnsupportedEncodingException e3) {
+ LOG.error("Unsupported encoding Error while parsing signModule attribute", e3);
+ throw new STORKSAMLEngineRuntimeException(e3);
+ } catch (IOException e4) {
+ LOG.error("IO Error while parsing signModule attribute", e4);
+ throw new STORKSAMLEngineRuntimeException(e4);
+ }
+
+ // Create the attribute statement
+ final XSAny xmlValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+
+ //Set the signedDoc XML content to this element
+ xmlValue.setDOM(document.getDocumentElement());
+
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+
+ //Add previous signedDocXML to the AttributeValue Element
+
+ // if it's necessary encode the information.
+ if (!isHashing) {
+ attrValue.getUnknownXMLObjects().add(xmlValue);
+ }
+ return attrValue;
+ }
+
+ private XSAny createAttributeValueForNonSignedDoc(final String value, final boolean isHashing) throws STORKSAMLEngineException {
+ // Create the attribute statement
+ final XSAny attrValue = (XSAny) SAMLEngineUtils
+ .createSamlObject(
+ AttributeValue.DEFAULT_ELEMENT_NAME,
+ XSAny.TYPE_NAME);
+ // if it's necessary encode the information.
+ if (isHashing) {
+ attrValue.setTextContent(SAMLEngineUtils.encode(value, SAMLEngineUtils.SHA_512));
+ } else {
+ attrValue.setTextContent(value);
+ }
+ return attrValue;
+ }
+
+ /**
+ * Generate attribute from a list of values.
+ *
+ * @param name the name of the attribute.
+ * @param values the value of the attribute.
+ * @param isHashing the is hashing with "SHA-512" algorithm.
+ * @param status the status of the parameter: "Available", "NotAvailable" or
+ * "Withheld".
+ *
+ * @return the attribute
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Attribute generateAttrSimple(final String name,
+ final String status, final List<String> values,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.debug("Generate attribute simple: " + name);
+ final Attribute attribute = (Attribute) SAMLEngineUtils
+ .createSamlObject(Attribute.DEFAULT_ELEMENT_NAME);
+
+ attribute.setName(name);
+ attribute.setNameFormat(Attribute.URI_REFERENCE);
+
+ attribute.getUnknownAttributes().put(
+ new QName(SAMLCore.STORK10_NS.getValue(), "AttributeStatus",
+ SAMLCore.STORK10_PREFIX.getValue()), status);
+
+ if (values != null) {
+ LOG.debug("Add attribute values.");
+ for (int i = 0; i < values.size(); i++) {
+ final String value = values.get(i);
+ if (StringUtils.isNotBlank(value)) {
+ XSAny attrValue = null;
+ if (!name.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+ // Create the attribute statement
+ attrValue = createAttributeValueForNonSignedDoc(value, isHashing);
+
+ } else {
+ attrValue = createAttributeValueForSignedDoc(value, isHashing);
+ attribute.getAttributeValues().add(attrValue);
+ }
+ attribute.getAttributeValues().add(attrValue);
+ }
+ }
+ }
+ return attribute;
+ }
+
+ /**
+ * Generate conditions that MUST be evaluated when assessing the validity of
+ * and/or when using the assertion.
+ *
+ * @param notBefore the not before
+ * @param notOnOrAfter the not on or after
+ * @param audienceURI the audience URI.
+ *
+ * @return the conditions
+ */
+ private Conditions generateConditions(final DateTime notBefore,
+ final DateTime notOnOrAfter, final String audienceURI) {
+ LOG.debug("Generate conditions.");
+ final Conditions conditions = (Conditions) SAMLEngineUtils
+ .createSamlObject(Conditions.DEFAULT_ELEMENT_NAME);
+ conditions.setNotBefore(notBefore);
+ conditions.setNotOnOrAfter(notOnOrAfter);
+
+ final AudienceRestriction restrictions = (AudienceRestriction) SAMLEngineUtils
+ .createSamlObject(AudienceRestriction.DEFAULT_ELEMENT_NAME);
+
+ final Audience audience = (Audience) SAMLEngineUtils
+ .createSamlObject(Audience.DEFAULT_ELEMENT_NAME);
+ audience.setAudienceURI(audienceURI);
+
+ restrictions.getAudiences().add(audience);
+ conditions.getAudienceRestrictions().add(restrictions);
+
+ if (super.getSamlCoreProperties().isOneTimeUse()) {
+ final OneTimeUse oneTimeUse = (OneTimeUse) SAMLEngineUtils
+ .createSamlObject(OneTimeUse.DEFAULT_ELEMENT_NAME);
+ conditions.getConditions().add(oneTimeUse);
+ }
+ return conditions;
+ }
+
+ /**
+ * Generate personal attribute list.
+ *
+ * @param assertion the assertion
+ *
+ * @return the personal attribute list
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private IPersonalAttributeList generatePersonalAttributeList(
+ final Assertion assertion) throws STORKSAMLEngineException {
+ LOG.debug("Generate personal attribute list from XMLObject.");
+ final List<XMLObject> listExtensions = assertion.getOrderedChildren();
+
+ boolean find = false;
+ AttributeStatement requestedAttr = null;
+
+ // Search the attribute statement.
+ for (int i = 0; i < listExtensions.size() && !find; i++) {
+ final XMLObject xml = listExtensions.get(i);
+ if (xml instanceof AttributeStatement) {
+ requestedAttr = (AttributeStatement) xml;
+ find = true;
+ }
+ }
+
+ if (!find) {
+ LOG.error("Error: AttributeStatement it's not present.");
+ throw new STORKSAMLEngineException(
+ "AttributeStatement it's not present.");
+ }
+
+ final List<Attribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+ String attributeName;
+
+ // Process the attributes.
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final Attribute attribute = reqAttrs.get(nextAttribute);
+
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+
+ attributeName = attribute.getName();
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ personalAttribute.setStatus(attribute.getUnknownAttributes().get(
+ new QName(SAMLCore.STORK10_NS.getValue(),
+ "AttributeStatus", SAMLCore.STORK10_PREFIX
+ .getValue())));
+
+ final ArrayList<String> simpleValues = new ArrayList<String>();
+ final HashMap<String, String> multiValues = new HashMap<String, String>();
+
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+
+ // Process the values.
+ for (int nextValue = 0; nextValue < values.size(); nextValue++) {
+
+ final XMLObject xmlObject = values.get(nextValue);
+
+ if (xmlObject instanceof XSStringImpl) {
+
+ simpleValues.add(((XSStringImpl) xmlObject).getValue());
+
+ } else if (xmlObject instanceof XSAnyImpl) {
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextValue);
+
+ TransformerFactory transFactory = TransformerFactory
+ .newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(
+ OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString
+ .getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ simpleValues.add(str);
+
+ } else if (isComplex(xmlObject))
+ {
+ LOG.info(attributeName + " found");
+ // Process complex value.
+ final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
+
+ for (int nextComplexValue = 0; nextComplexValue < complexValue
+ .getUnknownXMLObjects().size(); nextComplexValue++) {
+
+ final XSAnyImpl simple = (XSAnyImpl) complexValue
+ .getUnknownXMLObjects().get(
+ nextComplexValue);
+
+ multiValues.put(simple.getElementQName()
+ .getLocalPart(), simple.getTextContent());
+ }
+
+ }
+ else {
+ // Process simple value.
+ simpleValues.add(((XSAnyImpl) xmlObject)
+ .getTextContent());
+ }
+
+ } else {
+ LOG.error("Error: attribute value it's unknown.");
+ throw new STORKSAMLEngineException(
+ "Attribute value it's unknown.");
+ }
+ }
+
+ personalAttribute.setValue(simpleValues);
+ personalAttribute.setComplexValue(multiValues);
+ personalAttrList.add(personalAttribute);
+ }
+
+ return personalAttrList;
+ }
+
+ /**
+ * Generate stork authentication request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * authentication request.
+ *
+ * @return the STORK authentication request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnRequest generateSTORKAuthnRequest(
+ final STORKAuthnRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate SAMLAuthnRequest.");
+
+ // Validate Parameters mandatories
+ validateParamAuthnReq(request);
+
+ final AuthnRequest authnRequestAux = SAMLEngineUtils
+ .generateSAMLAuthnRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(authnRequestAux);
+
+ // Add parameter Mandatory STORK
+ authnRequestAux.setForceAuthn(Boolean.TRUE);
+
+ // Add parameter Mandatory STORK
+ authnRequestAux.setIsPassive(Boolean.FALSE);
+
+ authnRequestAux.setAssertionConsumerServiceURL(request
+ .getAssertionConsumerServiceURL());
+
+ authnRequestAux.setProviderName(request.getProviderName());
+
+ // Add protocol binding
+ authnRequestAux.setProtocolBinding(super.getSamlCoreProperties()
+ .getProtocolBinding());
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ authnRequestAux.setDestination(request.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ authnRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ authnRequestAux.setIssuer(issuer);
+
+ // Generate stork extensions.
+ final Extensions storkExtensions = this
+ .generateSTORKExtensions(request);
+ // add the extensions to the SAMLAuthnRequest
+ authnRequestAux.setExtensions(storkExtensions);
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKAuthnRequest authRequest = processExtensions(authnRequestAux
+ .getExtensions());
+
+ try {
+ authRequest.setTokenSaml(super.signAndMarshall(authnRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ authRequest.setSamlId(authnRequestAux.getID());
+ authRequest.setDestination(authnRequestAux.getDestination());
+ authRequest.setAssertionConsumerServiceURL(authnRequestAux
+ .getAssertionConsumerServiceURL());
+
+ authRequest.setProviderName(authnRequestAux.getProviderName());
+ authRequest.setIssuer(authnRequestAux.getIssuer().getValue());
+
+ return authRequest;
+ }
+
+ /**
+ * Generate stork authentication response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponse(
+ final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq, final String ipAddress,
+ final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponse");
+
+ // Validate parameters
+ validateParamResponse(request, responseAuthReq);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAuthReq
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+
+ final STORKAuthnResponse authresponse = new STORKAuthnResponse();
+
+ try {
+ authresponse.setTokenSaml(super.signAndMarshall(response));
+ authresponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return authresponse;
+ }
+
+ /**
+ * Generate stork authentication response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponseAfterQuery(
+ final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq, final String ipAddress,
+ final boolean isHashing, List<STORKAttrQueryResponse> res) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponse");
+
+ // Validate parameters
+ validateParamResponse(request, responseAuthReq);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAuthReq
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+ // Check for response queries
+ if (res != null && res.size() > 0)
+ {
+ //Iterate through them
+ for (int i = 0; i < res.size(); i++)
+ {
+ //If response contains multiple assertions iterate through them as well
+ if (res.get(i).getAssertions().size() > 1)
+ {
+ for (int j = 0; j < res.get(i).getAssertions().size(); j++)
+ {
+ Assertion tempAssertion = res.get(i).getAssertions().get(j);
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ } else {
+ Assertion tempAssertion = res.get(i).getAssertion();
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ }
+ }
+
+ final STORKAuthnResponse authresponse = new STORKAuthnResponse();
+
+ try {
+ authresponse.setTokenSaml(super.signAndMarshall(response));
+ authresponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return authresponse;
+ }
+
+ /**
+ * Generate stork authentication response fail.
+ *
+ * @param request the request
+ * @param response the response
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse generateSTORKAuthnResponseFail(
+ final STORKAuthnRequest request, final STORKAuthnResponse response,
+ final String ipAddress, final boolean isHashing)
+ throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAuthnResponseFail");
+
+ validateParamResponseFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ LOG.debug("Generate Response.");
+ // RESPONSE
+ final Response responseFail = genAuthnRespBase(status, request
+ .getAssertionConsumerServiceURL(), request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, request
+ .getAssertionConsumerServiceURL(), request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ responseFail.getAssertions().add(assertion);
+
+ LOG.debug("Sign and Marshall ResponseFail.");
+
+ final STORKAuthnResponse storkResponse = new STORKAuthnResponse();
+
+ try {
+ storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
+ storkResponse.setSamlId(responseFail.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return storkResponse;
+ }
+
+ /**
+ * Generate stork attribute query request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * attribute query request.
+ *
+ * @return the STORK attribute query request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryRequest generateSTORKAttrQueryRequest(
+ final STORKAttrQueryRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKAttrQueryRequest.");
+
+ // Validate Parameters mandatories
+ validateParamAttrQueryReq(request);
+
+ //final AttributeQuery attrQueryRequestAux = SAMLEngineUtils
+ final CustomAttributeQuery attrQueryRequestAux = SAMLEngineUtils
+ .generateSAMLAttrQueryRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(attrQueryRequestAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ attrQueryRequestAux.setDestination(request.getDestination());
+ }
+
+ // Add parameter optional STORK
+ // Consumer URL is needed if using HTTP-Post
+ if (StringUtils.isNotBlank(request.getAssertionConsumerServiceURL())) {
+ attrQueryRequestAux.setAssertionConsumerServiceURL(request.getAssertionConsumerServiceURL());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ attrQueryRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+ //Set the subject - needed for attribute query validation
+ Subject subject = SAMLEngineUtils.generateSubject();
+ SubjectConfirmationBuilder builder = new SubjectConfirmationBuilder();
+ SubjectConfirmation subjectConfirmation = builder.buildObject();
+ subjectConfirmation.setMethod("urn:oasis:names:tc:SAML:2.0:cm:bearer");
+ subject.getSubjectConfirmations().add(subjectConfirmation);
+ attrQueryRequestAux.setSubject(subject);
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ attrQueryRequestAux.setIssuer(issuer);
+
+ // Generate stork extensions.
+ final Extensions storkExtensions = this
+ .generateSTORKAttrExtensions(request);
+ // add the extensions to the SAMLAuthnRequest
+ attrQueryRequestAux.setExtensions(storkExtensions);
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKAttrQueryRequest attrQueryRequest = processAttrExtensions(attrQueryRequestAux
+ .getExtensions());
+
+ try {
+ attrQueryRequest.setTokenSaml(super.signAndMarshall(attrQueryRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ attrQueryRequest.setSamlId(attrQueryRequestAux.getID());
+ attrQueryRequest.setDestination(attrQueryRequestAux.getDestination());
+ attrQueryRequest.setAssertionConsumerServiceURL(attrQueryRequestAux.getAssertionConsumerServiceURL());
+ attrQueryRequest.setIssuer(attrQueryRequestAux.getIssuer().getValue());
+
+ return attrQueryRequest;
+ }
+
+ /**
+ * Generate stork attribute query response.
+ *
+ * @param request the request
+ * @param responseAttrQueryRes the response authentication request
+ * @param ipAddress the IP address
+ * @param isHashing the hashing of values
+ *
+ * @return the sTORK authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponse(
+ final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse responseAttrQueryRes, final String ipAddress,
+ final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponse");
+
+ // Validate parameters
+ validateParamAttrQueryResponse(request, responseAttrQueryRes);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, ""
+ ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAttrQueryRes
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add assertions
+ response.getAssertions().add(assertion);
+
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ try {
+ attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
+ attrQueryResponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return attrQueryResponse;
+ }
+
+ /**
+ * Generate stork attribute query response from multiple assertions
+ *
+ * @param request the request
+ * @param responseAttrQueryRes the response to the query request
+ * @param responses the responses to include in the response (aggregation)
+ * @param ipAddress the IP address
+ * @param isHashing the hashing of values
+ *
+ * @return the sTORK attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponseWithAssertions(
+ final STORKAttrQueryRequest request, final STORKAttrQueryResponse responseAttrQueryRes,
+ final List<STORKAttrQueryResponse> responses, final String ipAddress,
+ final String destinationUrl, final boolean isHashing) throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponse");
+
+ // Validate parameters
+ validateParamAttrQueryResponseFromAssertions(request, responseAttrQueryRes);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ LOG.debug("Generate Response");
+
+ // RESPONSE
+ final Response response = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, ""
+ ,request.getSamlId(), request.getIssuer(), notOnOrAfter);
+
+ final AttributeStatement attrStatement = this
+ .generateAttributeStatement(responseAttrQueryRes
+ .getPersonalAttributeList(), isHashing);
+
+ assertion.getAttributeStatements().add(attrStatement);
+
+ // Add the assertions from the former Query responses
+ response.getAssertions().add(assertion);
+ if (responses != null && responses.size() > 0)
+ {
+ for (int i = 0; i < responses.size(); i++)
+ {
+ Assertion tempAssertion = responses.get(i).getAssertion();
+ tempAssertion.setParent(response);
+ response.getAssertions().add(tempAssertion);
+ }
+ }
+
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ try {
+ attrQueryResponse.setTokenSaml(super.signAndMarshall(response));
+ attrQueryResponse.setSamlId(response.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return attrQueryResponse;
+ }
+
+ /**
+ * Generate stork attribute query response fail.
+ *
+ * @param request the request
+ * @param response the response
+ * @param ipAddress the IP address
+ * @param isHashing the is hashing
+ *
+ * @return the STORK attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse generateSTORKAttrQueryResponseFail(
+ final STORKAttrQueryRequest request, final STORKAttrQueryResponse response,
+ final String ipAddress, final String destinationUrl, final boolean isHashing)
+ throws STORKSAMLEngineException {
+ LOG.info("generateSTORKAttrQueryResponseFail");
+
+ validateParamAttrQueryResponseFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ LOG.debug("Generate Response.");
+ // RESPONSE
+ final Response responseFail = genAuthnRespBase(status, destinationUrl,
+ request.getSamlId());
+
+ DateTime notOnOrAfter = new DateTime();
+
+ notOnOrAfter = notOnOrAfter.plusSeconds(super.getSamlCoreProperties()
+ .getTimeNotOnOrAfter());
+
+ final Assertion assertion = this.generateAssertion(ipAddress, "",
+ request.getSamlId(), request
+ .getIssuer(), notOnOrAfter);
+
+ responseFail.getAssertions().add(assertion);
+
+ LOG.debug("Sign and Marshall ResponseFail.");
+
+ final STORKAttrQueryResponse storkResponse = new STORKAttrQueryResponse();
+
+ try {
+ storkResponse.setTokenSaml(super.signAndMarshall(responseFail));
+ storkResponse.setSamlId(responseFail.getID());
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ return storkResponse;
+ }
+
+ /**
+ * Generate stork logout request.
+ *
+ * @param request the request that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout request that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutRequest generateSTORKLogoutRequest(
+ final STORKLogoutRequest request) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutRequest.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutReq(request);
+
+ final LogoutRequest logoutRequestAux = SAMLEngineUtils
+ .generateSAMLLogoutRequest(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime());
+
+ // Set name spaces.
+ setNameSpaces(logoutRequestAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(request.getDestination())) {
+ logoutRequestAux.setDestination(request.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutRequestAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(request.getIssuer()!=null){
+ issuer.setValue(request.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutRequestAux.setIssuer(issuer);
+
+ // Set the name ID
+ final NameID newNameID = SAMLEngineUtils.generateNameID();
+ newNameID.setValue(request.getSpProvidedId());
+ logoutRequestAux.setNameID(newNameID);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
+
+ try {
+ logoutRequest.setTokenSaml(super.signAndMarshall(logoutRequestAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutRequest.setSamlId(logoutRequestAux.getID());
+ logoutRequest.setDestination(logoutRequestAux.getDestination());
+ logoutRequest.setIssuer(logoutRequestAux.getIssuer().getValue());
+ logoutRequest.setSpProvidedId(logoutRequestAux.getNameID().getValue());
+
+ return logoutRequest;
+ }
+
+
+ /**
+ * Generate stork logout response.
+ * @param request the request thats being responded to
+ * @param response the tesponse that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout response that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutResponse generateSTORKLogoutResponse(
+ final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutResponse.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutRes(request, response);
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode");
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(StatusCode.SUCCESS_URI);
+
+ LOG.debug("Generate Status");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ LOG.debug("Generate StatusMessage");
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(StatusCode.SUCCESS_URI);
+
+ status.setStatusMessage(statusMessage);
+
+ final LogoutResponse logoutResponseAux= SAMLEngineUtils
+ .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime(), status, request.getSamlId());
+
+ // Set name spaces.
+ setNameSpaces(logoutResponseAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(response.getDestination())) {
+ logoutResponseAux.setDestination(response.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutResponseAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(response.getIssuer()!=null){
+ issuer.setValue(response.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutResponseAux.setIssuer(issuer);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
+
+ try {
+ logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutResponse.setSamlId(logoutResponseAux.getID());
+ logoutResponse.setDestination(logoutResponseAux.getDestination());
+ logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
+ logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
+ logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
+
+ return logoutResponse;
+ }
+
+ /**
+ * Generate failed stork logout response.
+ *
+ * @param response the response that contain all parameters for generate an
+ * logout request.
+ *
+ * @return the STORK logout response that has been processed.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutResponse generateSTORKLogoutResponseFail(
+ final STORKLogoutRequest request,
+ final STORKLogoutResponse response ) throws STORKSAMLEngineException {
+ LOG.info("Generate STORKLogoutResponse.");
+
+ // Validate Parameters mandatories
+ validateParamLogoutResFail(request, response);
+
+ // Mandatory
+ final StatusCode statusCode = SAMLEngineUtils
+ .generateStatusCode(response.getStatusCode());
+
+ // Mandatory SAML
+ LOG.debug("Generate StatusCode.");
+ // Subordinate code it's optional in case not covered into next codes:
+ // - 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:RequestDenied
+ // - http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported
+
+ if (StringUtils.isNotBlank(response.getSubStatusCode())) {
+ final StatusCode newStatusCode = SAMLEngineUtils
+ .generateStatusCode(response.getSubStatusCode());
+ statusCode.setStatusCode(newStatusCode);
+ }
+
+ LOG.debug("Generate Status.");
+ final Status status = SAMLEngineUtils.generateStatus(statusCode);
+
+ if (StringUtils.isNotBlank(response.getStatusMessage())) {
+ final StatusMessage statusMessage = (StatusMessage) SAMLEngineUtils
+ .generateStatusMessage(response.getStatusMessage());
+
+ status.setStatusMessage(statusMessage);
+ }
+
+ final LogoutResponse logoutResponseAux= SAMLEngineUtils
+ .generateSAMLLogoutResponse(SAMLEngineUtils.generateNCName(),
+ SAMLVersion.VERSION_20, SAMLEngineUtils
+ .getCurrentTime(), status, request.getSamlId());
+
+ // Set name spaces.
+ setNameSpaces(logoutResponseAux);
+
+
+ // Add parameter optional STORK
+ // Destination is mandatory if the destination is a C-PEPS
+ // The application must to know if the destination is a C-PEPS.
+ if (StringUtils.isNotBlank(response.getDestination())) {
+ logoutResponseAux.setDestination(response.getDestination());
+ }
+
+ // Consent is optional. Set from SAMLEngine.xml - consent.
+ logoutResponseAux.setConsent(super.getSamlCoreProperties()
+ .getConsentAuthnRequest());
+
+ final Issuer issuer = SAMLEngineUtils.generateIssuer();
+
+
+ if(response.getIssuer()!=null){
+ issuer.setValue(response.getIssuer());
+ } else {
+ issuer.setValue(super.getSamlCoreProperties().getRequester());
+ }
+
+ // Optional STORK
+ final String formatEntity = super.getSamlCoreProperties()
+ .getFormatEntity();
+ if (StringUtils.isNotBlank(formatEntity)) {
+ issuer.setFormat(formatEntity);
+ }
+
+ logoutResponseAux.setIssuer(issuer);
+
+
+ // the result contains an authentication request token (byte[]),
+ // identifier of the token, and all parameters from the request.
+ final STORKLogoutResponse logoutResponse = new STORKLogoutResponse();
+
+ try {
+ logoutResponse.setTokenSaml(super.signAndMarshall(logoutResponseAux));
+ } catch (SAMLEngineException e) {
+ LOG.error("Sign and Marshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ logoutResponse.setSamlId(logoutResponseAux.getID());
+ logoutResponse.setDestination(logoutResponseAux.getDestination());
+ logoutResponse.setIssuer(logoutResponseAux.getIssuer().getValue());
+ logoutResponse.setStatusCode(logoutResponseAux.getStatus().getStatusCode().toString());
+ logoutResponse.setStatusMessage(logoutResponseAux.getStatus().getStatusMessage().toString());
+
+ return logoutResponse;
+ }
+
+ /**
+ * Generate stork authentication statement for the authentication statement.
+ *
+ * @param ipAddress the IP address
+ *
+ * @return the authentication statement
+ */
+ private AuthnStatement generateStorkAuthStatement(final String ipAddress) {
+ LOG.debug("Generate stork authenticate statement.");
+ final SubjectLocality subjectLocality = SAMLEngineUtils
+ .generateSubjectLocality(ipAddress);
+
+ final AuthnContext authnContext = (AuthnContext) SAMLEngineUtils
+ .createSamlObject(AuthnContext.DEFAULT_ELEMENT_NAME);
+
+ final AuthnContextDecl authnContextDecl = (AuthnContextDecl) SAMLEngineUtils
+ .createSamlObject(AuthnContextDecl.DEFAULT_ELEMENT_NAME);
+
+ authnContext.setAuthnContextDecl(authnContextDecl);
+
+ final AuthnStatement authnStatement = SAMLEngineUtils
+ .generateAthnStatement(new DateTime(), authnContext);
+
+ // Optional STORK
+ authnStatement.setSessionIndex(null);
+ authnStatement.setSubjectLocality(subjectLocality);
+
+ return authnStatement;
+ }
+
+ /**
+ * Generate stork extensions.
+ *
+ * @param request the request
+ *
+ * @return the extensions
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Extensions generateSTORKExtensions(final STORKAuthnRequest request)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate STORKExtensions");
+
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+
+ LOG.debug("Generate QAAAttribute");
+ final QAAAttribute qaaAttribute = SAMLEngineUtils
+ .generateQAAAttribute(request.getQaa());
+ extensions.getUnknownXMLObjects().add(qaaAttribute);
+
+
+ if (StringUtils.isNotEmpty(request
+ .getSpSector())) {
+ // Add information about service provider.
+ LOG.debug("Generate SPSector");
+ final SPSector sector = SAMLEngineUtils.generateSPSector(request
+ .getSpSector());
+ extensions.getUnknownXMLObjects().add(sector);
+ }
+
+ //Delete from specification. Kept for compatibility with Provider Name value
+ LOG.debug("Generate SPInstitution");
+ final SPInstitution institution = SAMLEngineUtils
+ .generateSPInstitution(request.getProviderName());
+ extensions.getUnknownXMLObjects().add(institution);
+
+
+ if (StringUtils.isNotEmpty(request.getSpApplication())) {
+ LOG.debug("Generate SPApplication");
+ final SPApplication application = SAMLEngineUtils
+ .generateSPApplication(request.getSpApplication());
+ extensions.getUnknownXMLObjects().add(application);
+ }
+
+ if (StringUtils.isNotEmpty(request.getSpCountry())) {
+ LOG.debug("Generate SPCountry");
+ final SPCountry country = SAMLEngineUtils.generateSPCountry(request
+ .getSpCountry());
+ extensions.getUnknownXMLObjects().add(country);
+ }
+
+ //eIDSectorShare: optional; default value: false.
+ String valueSectorShare = super.getSamlCoreProperties()
+ .iseIDSectorShare();
+
+ if (StringUtils.isNotEmpty(valueSectorShare)) {
+ // Add information about the use of the SAML message.
+ LOG.debug("Generate EIDSectorShare");
+ final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
+
+ eIdSectorShare.setEIDSectorShare(String.valueOf(Boolean.valueOf(valueSectorShare)));
+
+ extensions.getUnknownXMLObjects().add(eIdSectorShare);
+ }
+
+ String valueCrossSectorShare = super.getSamlCoreProperties()
+ .iseIDCrossSectorShare();
+
+ if (StringUtils.isNotEmpty(valueCrossSectorShare)) {
+ LOG.debug("Generate EIDCrossSectorShare");
+ final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(Boolean.valueOf(valueCrossSectorShare)));
+ extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
+ }
+
+
+ String valueCrossBorderShare = super.getSamlCoreProperties()
+ .iseIDCrossBorderShare();
+
+ if (StringUtils.isNotEmpty(valueCrossBorderShare)) {
+ LOG.debug("Generate EIDCrossBorderShare");
+ final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(Boolean.valueOf(valueCrossBorderShare)));
+ extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
+ }
+
+
+ // Add information about requested attributes.
+ LOG.debug("Generate RequestedAttributes.");
+ final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
+ .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
+
+ LOG.debug("SAML Engine configuration properties load.");
+ final Iterator<PersonalAttribute> iterator = request
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ if (attribute == null || StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ // Verified if exits the attribute name.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.debug("Attribute name: {} was not found.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " was not found.");
+ }
+
+ // Friendly name it's an optional attribute.
+ String friendlyName = null;
+
+ if (super.getSamlCoreProperties().isFriendlyName()) {
+ friendlyName = attribute.getName();
+ }
+
+
+ String isRequired = null;
+ if (super.getSamlCoreProperties().isRequired()) {
+ isRequired = String.valueOf(attribute.isRequired());
+ }
+
+
+ LOG.debug("Generate requested attribute: " + attributeName);
+ final RequestedAttribute requestedAttr = SAMLEngineUtils
+ .generateReqAuthnAttributeSimple(attributeName,
+ friendlyName, isRequired, attribute
+ .getValue());
+
+ // Add requested attribute.
+ reqAttributes.getAttributes().add(requestedAttr);
+ }
+
+ // Add requested attributes.
+ extensions.getUnknownXMLObjects().add(reqAttributes);
+
+ CitizenCountryCode citizenCountryCode = null;
+ if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
+ LOG.debug("Generate CitizenCountryCode");
+ citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
+ .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
+
+ citizenCountryCode.setCitizenCountryCode(request
+ .getCitizenCountryCode().toUpperCase());
+ }
+
+ SPID spid = null;
+ if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
+ LOG.debug("Generate SPID");
+ spid = (SPID) SAMLEngineUtils
+ .createSamlObject(SPID.DEF_ELEMENT_NAME);
+
+ spid.setSPID(request.getSPID().toUpperCase());
+ }
+
+ AuthenticationAttributes authenticationAttr = (AuthenticationAttributes) SAMLEngineUtils
+ .createSamlObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ final VIDPAuthenticationAttributes vIDPauthenticationAttr = (VIDPAuthenticationAttributes) SAMLEngineUtils
+ .createSamlObject(VIDPAuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ final SPInformation spInformation = (SPInformation) SAMLEngineUtils
+ .createSamlObject(SPInformation.DEF_ELEMENT_NAME);
+
+ if(citizenCountryCode!=null){
+ vIDPauthenticationAttr.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ if(spid!=null){
+ spInformation.setSPID(spid);
+ }
+
+ vIDPauthenticationAttr.setSPInformation(spInformation);
+
+ authenticationAttr
+ .setVIDPAuthenticationAttributes(vIDPauthenticationAttr);
+ extensions.getUnknownXMLObjects().add(authenticationAttr);
+
+
+ return extensions;
+
+ }
+
+ /**
+ * Generate stork extensions.
+ *
+ * @param request the attribute query request
+ *
+ * @return the extensions
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Extensions generateSTORKAttrExtensions(final STORKAttrQueryRequest request)
+ throws STORKSAMLEngineException {
+ LOG.debug("Generate STORKExtensions");
+
+ final Extensions extensions = SAMLEngineUtils.generateExtension();
+
+ LOG.debug("Generate QAAAttribute");
+ final QAAAttribute qaaAttribute = SAMLEngineUtils
+ .generateQAAAttribute(request.getQaa());
+ extensions.getUnknownXMLObjects().add(qaaAttribute);
+
+
+ if (StringUtils.isNotEmpty(request
+ .getSpSector())) {
+ // Add information about service provider.
+ LOG.debug("Generate SPSector");
+ final SPSector sector = SAMLEngineUtils.generateSPSector(request
+ .getSpSector());
+ extensions.getUnknownXMLObjects().add(sector);
+ }
+
+
+ if (StringUtils.isNotEmpty(request.getSpApplication())) {
+ LOG.debug("Generate SPApplication");
+ final SPApplication application = SAMLEngineUtils
+ .generateSPApplication(request.getSpApplication());
+ extensions.getUnknownXMLObjects().add(application);
+ }
+
+ if (StringUtils.isNotEmpty(request.getSpCountry())) {
+ LOG.debug("Generate SPCountry");
+ final SPCountry country = SAMLEngineUtils.generateSPCountry(request
+ .getSpCountry());
+ extensions.getUnknownXMLObjects().add(country);
+ }
+
+ final EIDSectorShare eIdSectorShare = (EIDSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDSectorShare.DEF_ELEMENT_NAME);
+
+ eIdSectorShare.setEIDSectorShare(String.valueOf(request.isEIDSectorShare()));
+
+ extensions.getUnknownXMLObjects().add(eIdSectorShare);
+
+ final EIDCrossSectorShare eIdCrossSecShare = (EIDCrossSectorShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ eIdCrossSecShare.setEIDCrossSectorShare(String.valueOf(request.isEIDCrossSectorShare()));
+ extensions.getUnknownXMLObjects().add(eIdCrossSecShare);
+
+ final EIDCrossBorderShare eIdCrossBordShare = (EIDCrossBorderShare) SAMLEngineUtils
+ .createSamlObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ eIdCrossBordShare.setEIDCrossBorderShare(String.valueOf(request.isEIDCrossBorderShare()));
+ extensions.getUnknownXMLObjects().add(eIdCrossBordShare);
+
+
+ // Add information about requested attributes.
+ LOG.debug("Generate RequestedAttributes.");
+ final RequestedAttributes reqAttributes = (RequestedAttributes) SAMLEngineUtils
+ .createSamlObject(RequestedAttributes.DEF_ELEMENT_NAME);
+
+ LOG.debug("SAML Engine configuration properties load.");
+ final Iterator<PersonalAttribute> iterator = request
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ if (attribute == null || StringUtils.isBlank(attribute.getName())) {
+ LOG.error(ATTRIBUTE_EMPTY_LITERAL);
+ throw new STORKSAMLEngineException(ATTRIBUTE_EMPTY_LITERAL);
+ }
+
+ // Verified if exits the attribute name.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.debug("Attribute name: {} was not found.", attribute
+ .getName());
+ throw new STORKSAMLEngineException("Attribute name: "
+ + attribute.getName() + " was not found.");
+ }
+
+ // Friendly name it's an optional attribute.
+ String friendlyName = null;
+
+ if (super.getSamlCoreProperties().isFriendlyName()) {
+ friendlyName = attribute.getName();
+ }
+
+
+ String isRequired = null;
+ if (super.getSamlCoreProperties().isRequired()) {
+ isRequired = String.valueOf(attribute.isRequired());
+ }
+
+
+ LOG.debug("Generate requested attribute: " + attributeName);
+ final RequestedAttribute requestedAttr = SAMLEngineUtils
+ .generateReqAuthnAttributeSimple(attributeName,
+ friendlyName, isRequired, attribute
+ .getValue());
+
+ // Add requested attribute.
+ reqAttributes.getAttributes().add(requestedAttr);
+ }
+
+ // Add requested attributes.
+ extensions.getUnknownXMLObjects().add(reqAttributes);
+
+ CitizenCountryCode citizenCountryCode = null;
+ if (request.getCitizenCountryCode() != null && StringUtils.isNotBlank(request.getCitizenCountryCode())){
+ LOG.debug("Generate CitizenCountryCode");
+ citizenCountryCode = (CitizenCountryCode) SAMLEngineUtils
+ .createSamlObject(CitizenCountryCode.DEF_ELEMENT_NAME);
+
+ citizenCountryCode.setCitizenCountryCode(request
+ .getCitizenCountryCode().toUpperCase());
+ }
+
+ SPID spid = null;
+ if(request.getSPID()!=null && StringUtils.isNotBlank(request.getSPID())) {
+ LOG.debug("Generate SPID");
+ spid = (SPID) SAMLEngineUtils
+ .createSamlObject(SPID.DEF_ELEMENT_NAME);
+
+ spid.setSPID(request.getSPID().toUpperCase());
+ }
+
+
+ return extensions;
+
+ }
+
+ /**
+ * Gets the alias from X.509 Certificate at keystore.
+ *
+ * @param keyInfo the key info
+ * @param storkOwnKeyStore
+ * @param storkOwnKeyStore
+ *
+ * @return the alias
+ */
+ private String getAlias(final KeyInfo keyInfo, KeyStore storkOwnKeyStore) {
+
+ LOG.debug("Recover alias information");
+
+ String alias = null;
+ try {
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ // Transform the KeyInfo to X509Certificate.
+ CertificateFactory certFact;
+ certFact = CertificateFactory.getInstance("X.509");
+
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ final String tokenSerialNumber = cert.getSerialNumber().toString(16);
+ final X509Principal tokenIssuerDN = new X509Principal(cert.getIssuerDN().getName());
+
+
+ String aliasCert;
+ X509Certificate certificate;
+ boolean find = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements()
+ && !find; ) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate
+ .getIssuerDN().getName());
+
+ if(serialNum.equalsIgnoreCase(tokenSerialNumber)
+ && X509PrincipalUtil.equals2(issuerDN, tokenIssuerDN)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ } catch (KeyStoreException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ } catch (CertificateException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ } catch (RuntimeException e) {
+ LOG.error("Procces getAlias from certificate associated into the signing keystore..", e);
+ }
+ return alias;
+ }
+
+ /**
+ * Gets the country from X.509 Certificate.
+ *
+ * @param keyInfo the key info
+ *
+ * @return the country
+ */
+ private String getCountry(final KeyInfo keyInfo) {
+ LOG.debug("Recover country information.");
+
+ String result = "";
+ try {
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ // Transform the KeyInfo to X509Certificate.
+ CertificateFactory certFact;
+ certFact = CertificateFactory.getInstance("X.509");
+
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ String distName = cert.getSubjectDN().toString();
+
+ distName = StringUtils.deleteWhitespace(StringUtils
+ .upperCase(distName));
+
+ final String countryCode = "C=";
+ final int init = distName.indexOf(countryCode);
+
+ if (init > StringUtils.INDEX_NOT_FOUND) { // Exist country code.
+ int end = distName.indexOf(',', init);
+
+ if (end <= StringUtils.INDEX_NOT_FOUND) {
+ end = distName.length();
+ }
+
+ if (init < end && end > StringUtils.INDEX_NOT_FOUND) {
+ result = distName.substring(init + countryCode.length(),
+ end);
+ //It must be a two characters value
+ if(result.length()>2){
+ result = result.substring(0, 2);
+ }
+ }
+ }
+
+ } catch (CertificateException e) {
+ LOG.error("Procces getCountry from certificate.");
+ }
+ return result.trim();
+ }
+
+ /**
+ * Process all elements XMLObjects from the extensions.
+ *
+ * @param extensions the extensions from the authentication request.
+ *
+ * @return the STORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKAuthnRequest processExtensions(final Extensions extensions)
+ throws STORKSAMLEngineException {
+ LOG.debug("Procces the extensions.");
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ final QAAAttribute qaa = (QAAAttribute) extensions
+ .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
+ request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
+
+ List optionalElements = extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME).get(0);
+ request.setSpSector(sector.getSPSector());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPApplication application = (SPApplication) extensions
+ .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
+ request.setSpApplication(application.getSPApplication());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPCountry application = (SPCountry) extensions
+ .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
+ request.setSpCountry(application.getSPCountry());
+ }
+
+
+ List listCrossBorderShare = extensions
+ .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+
+ if (!listCrossBorderShare .isEmpty()) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
+ request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
+ .getEIDCrossBorderShare()));
+ }
+
+
+ List listCrosSectorShare = extensions
+ .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+
+ if (!listCrosSectorShare.isEmpty()) {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
+ request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
+ .getEIDCrossSectorShare()));
+ }
+
+ List listSectorShareExtension = extensions
+ .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
+ if (!listSectorShareExtension.isEmpty()) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
+ request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
+ }
+
+
+
+ List<XMLObject> authAttrs = extensions
+ .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ if (authAttrs != null && !authAttrs.isEmpty()) {
+
+ final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
+ .get(0);
+
+ VIDPAuthenticationAttributes vidpAuthnAttr = null;
+ if (authnAttr != null && !authAttrs.isEmpty()){
+ vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
+ }
+
+ CitizenCountryCode citizenCountryCodeElement = null;
+ SPInformation spInformation = null;
+ if (vidpAuthnAttr != null){
+ citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
+ spInformation = vidpAuthnAttr.getSPInformation();
+ }
+
+ String citizenCountryCode = null;
+ if(citizenCountryCodeElement!=null){
+ citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
+ }
+
+ if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
+ request.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ SPID spidElement = null;
+ if (spInformation != null){
+ spidElement = spInformation.getSPID();
+ }
+
+ String spid = null;
+ if(spidElement!=null){
+ spid = spidElement.getSPID();
+ }
+
+ if (spid != null && StringUtils.isNotBlank(spid)) {
+ request.setSPID(spid);
+ }
+ }
+
+ if (extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
+ LOG.error("Extensions not contains any requested attribute.");
+ throw new STORKSAMLEngineException(
+ "Extensions not contains any requested attribute.");
+ }
+
+ final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
+ .get(0);
+
+ final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+
+ String attributeName;
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+ personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
+ personalAttribute.setFriendlyName(attribute.getFriendlyName());
+ attributeName = attribute.getName();
+
+ // recover the last name from the string.
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ final ArrayList<String> valores = new ArrayList<String>();
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+ for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
+
+ // Process attributes simples. An AuthenticationRequest only
+ // must contains simple values.
+
+ final XMLObject xmlObject = values.get(nextSimpleValue);
+
+ if(xmlObject instanceof XSStringImpl){
+
+ final XSStringImpl xmlString = (XSStringImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getValue());
+
+ }else{
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ valores.add(str);
+
+ }else{
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getTextContent());
+ }
+
+
+
+ }
+ }
+ personalAttribute.setValue(valores);
+ personalAttrList.add(personalAttribute);
+ }
+
+ request.setPersonalAttributeList(personalAttrList);
+
+ return request;
+ }
+
+
+ /**
+ * Process all elements XMLObjects from the extensions.
+ *
+ * @param extensions the extensions from the authentication request.
+ *
+ * @return the STORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private STORKAttrQueryRequest processAttrExtensions(final Extensions extensions)
+ throws STORKSAMLEngineException {
+ LOG.debug("Procces the atribute query extensions.");
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ final QAAAttribute qaa = (QAAAttribute) extensions
+ .getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME).get(0);
+ request.setQaa(Integer.parseInt(qaa.getQaaLevel()));
+
+ List optionalElements = extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPSector sector = (SPSector) extensions.getUnknownXMLObjects(
+ SPSector.DEF_ELEMENT_NAME).get(0);
+ request.setSpSector(sector.getSPSector());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPApplication application = (SPApplication) extensions
+ .getUnknownXMLObjects(SPApplication.DEF_ELEMENT_NAME).get(0);
+ request.setSpApplication(application.getSPApplication());
+ }
+
+ optionalElements = extensions.getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME);
+
+ if (!optionalElements.isEmpty()) {
+ final SPCountry application = (SPCountry) extensions
+ .getUnknownXMLObjects(SPCountry.DEF_ELEMENT_NAME).get(0);
+ request.setSpCountry(application.getSPCountry());
+ }
+
+
+ List listCrossBorderShare = extensions
+ .getUnknownXMLObjects(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+
+ if (!listCrossBorderShare .isEmpty()) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) listCrossBorderShare.get(0);
+ request.setEIDCrossBorderShare(Boolean.parseBoolean(crossBorderShare
+ .getEIDCrossBorderShare()));
+ }
+
+
+ List listCrosSectorShare = extensions
+ .getUnknownXMLObjects(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+
+ if (!listCrosSectorShare.isEmpty()) {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) listCrosSectorShare.get(0);
+ request.setEIDCrossSectorShare(Boolean.parseBoolean(crossSectorShare
+ .getEIDCrossSectorShare()));
+ }
+
+ List listSectorShareExtension = extensions
+ .getUnknownXMLObjects(EIDSectorShare.DEF_ELEMENT_NAME);
+ if (!listSectorShareExtension.isEmpty()) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) listSectorShareExtension.get(0);
+ request.setEIDSectorShare(Boolean.parseBoolean(sectorShare.getEIDSectorShare()));
+ }
+
+
+
+ List<XMLObject> authAttrs = extensions
+ .getUnknownXMLObjects(AuthenticationAttributes.DEF_ELEMENT_NAME);
+
+ if (authAttrs != null && !authAttrs.isEmpty()) {
+
+ final AuthenticationAttributes authnAttr = (AuthenticationAttributes) authAttrs
+ .get(0);
+
+ VIDPAuthenticationAttributes vidpAuthnAttr = null;
+ if (authnAttr != null && !authAttrs.isEmpty()){
+ vidpAuthnAttr = authnAttr.getVIDPAuthenticationAttributes();
+ }
+
+ CitizenCountryCode citizenCountryCodeElement = null;
+ SPInformation spInformation = null;
+ if (vidpAuthnAttr != null){
+ citizenCountryCodeElement = vidpAuthnAttr.getCitizenCountryCode();
+ spInformation = vidpAuthnAttr.getSPInformation();
+ }
+
+ String citizenCountryCode = null;
+ if(citizenCountryCodeElement!=null){
+ citizenCountryCode = citizenCountryCodeElement.getCitizenCountryCode();
+ }
+
+ if(citizenCountryCode!= null && StringUtils.isNotBlank(citizenCountryCode)){
+ request.setCitizenCountryCode(citizenCountryCode);
+ }
+
+ SPID spidElement = null;
+ if (spInformation != null){
+ spidElement = spInformation.getSPID();
+ }
+
+ String spid = null;
+ if(spidElement!=null){
+ spid = spidElement.getSPID();
+ }
+
+ if (spid != null && StringUtils.isNotBlank(spid)) {
+ request.setSPID(spid);
+ }
+ }
+
+ if (extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME) == null) {
+ LOG.error("Extensions not contains any requested attribute.");
+ throw new STORKSAMLEngineException(
+ "Extensions not contains any requested attribute.");
+ }
+
+ final RequestedAttributes requestedAttr = (RequestedAttributes) extensions
+ .getUnknownXMLObjects(RequestedAttributes.DEF_ELEMENT_NAME)
+ .get(0);
+
+ final List<RequestedAttribute> reqAttrs = requestedAttr.getAttributes();
+
+ final IPersonalAttributeList personalAttrList = new PersonalAttributeList();
+
+ String attributeName;
+ for (int nextAttribute = 0; nextAttribute < reqAttrs.size(); nextAttribute++) {
+ final RequestedAttribute attribute = reqAttrs.get(nextAttribute);
+ final PersonalAttribute personalAttribute = new PersonalAttribute();
+ personalAttribute.setIsRequired(Boolean.valueOf(attribute.isRequired()));
+ personalAttribute.setFriendlyName(attribute.getFriendlyName());
+ attributeName = attribute.getName();
+
+ // recover the last name from the string.
+ personalAttribute.setName(attributeName.substring(attributeName
+ .lastIndexOf('/') + 1));
+
+ final ArrayList<String> valores = new ArrayList<String>();
+ final List<XMLObject> values = attribute.getOrderedChildren();
+
+ for (int nextSimpleValue = 0; nextSimpleValue < values.size(); nextSimpleValue++) {
+
+ // Process attributes simples. An AuthenticationRequest only
+ // must contains simple values.
+
+ final XMLObject xmlObject = values.get(nextSimpleValue);
+
+ if(xmlObject instanceof XSStringImpl){
+
+ final XSStringImpl xmlString = (XSStringImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getValue());
+
+ }else{
+
+ if (attributeName.equals("http://www.stork.gov.eu/1.0/signedDoc")) {
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = null;
+ try {
+ transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ } catch (TransformerConfigurationException e) {
+ LOG.error("Error transformer configuration exception", e);
+ }
+ StringWriter buffer = new StringWriter();
+ try {
+ if (xmlString != null && xmlString.getUnknownXMLObjects() != null && xmlString.getUnknownXMLObjects().size() > 0 ){
+ transformer.transform(new DOMSource(xmlString.getUnknownXMLObjects().get(0).getDOM()),
+ new StreamResult(buffer));
+ }
+ } catch (TransformerException e) {
+ LOG.error("Error transformer exception", e);
+ }
+ String str = buffer.toString();
+
+ valores.add(str);
+
+ }else{
+
+ final XSAnyImpl xmlString = (XSAnyImpl) values
+ .get(nextSimpleValue);
+ valores.add(xmlString.getTextContent());
+ }
+
+
+
+ }
+ }
+ personalAttribute.setValue(valores);
+ personalAttrList.add(personalAttribute);
+ }
+
+ request.setPersonalAttributeList(personalAttrList);
+
+ return request;
+ }
+
+ /**
+ * Sets the name spaces.
+ *
+ * @param tokenSaml the new name spaces
+ */
+ private void setNameSpaces(final XMLObject tokenSaml) {
+ LOG.debug("Set namespaces.");
+
+ final Namespace saml2 = new Namespace(SAMLConstants.SAML20_NS,
+ SAMLConstants.SAML20_PREFIX);
+ tokenSaml.addNamespace(saml2);
+
+ final Namespace digSig = new Namespace(
+ "http://www.w3.org/2000/09/xmldsig#", "ds");
+ tokenSaml.addNamespace(digSig);
+
+ final Namespace storkp = new Namespace(SAMLCore.STORK10P_NS.getValue(),
+ SAMLCore.STORK10P_PREFIX.getValue());
+ tokenSaml.addNamespace(storkp);
+
+ final Namespace stork = new Namespace(SAMLCore.STORK10_NS.getValue(),
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ tokenSaml.addNamespace(stork);
+ }
+
+ /**
+ * Validate parameters from authentication request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAuthnReq(final STORKAuthnRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from authentication request.");
+
+ // URL to which Authentication Response must be sent.
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }
+
+ // the name of the original service provider requesting the
+ // authentication.
+ if (StringUtils.isBlank(request.getProviderName())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Service Provider it's mandatory.");
+ }
+
+ // object that contain all attributes requesting.
+ if (request.getPersonalAttributeList() == null
+ || request.getPersonalAttributeList().isEmpty()) {
+ throw new STORKSAMLEngineException(
+ "attributeQueries is null or empty.");
+ }
+
+ // Quality authentication assurance level.
+ if ((request.getQaa() < QAAAttribute.MIN_VALUE)
+ || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
+ throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
+ + ", is invalid.");
+ }
+
+ }
+
+ /**
+ * Validate parameters from attribute query request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryReq(final STORKAttrQueryRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from attribute query request.");
+
+ // URL to which AP Response must be sent.
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }
+
+ // Destination of the request - not mandatory
+ /*if (StringUtils.isBlank(request.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }*/
+
+ // SP country is empty
+ if (StringUtils.isBlank(request.getSpCountry())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP country is mandatory.");
+ }
+
+ // object that contain all attributes requesting.
+ if (request.getPersonalAttributeList() == null
+ || request.getPersonalAttributeList().isEmpty()) {
+ throw new STORKSAMLEngineException(
+ "attributeQueries is null or empty.");
+ }
+
+ // Quality authentication assurance level.
+ if ((request.getQaa() < QAAAttribute.MIN_VALUE)
+ || (request.getQaa() > QAAAttribute.MAX_VALUE)) {
+ throw new STORKSAMLEngineException("Qaal: " + request.getQaa()
+ + ", is invalid.");
+ }
+ }
+
+ /**
+ * Validate parameters from logout request.
+ *
+ * @param request the request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutReq(final STORKLogoutRequest request)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from logout request.");
+
+ // URL to which AP Response must be sent.
+ /*if (StringUtils.isBlank(request.get())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Assertion Consumer Service URL it's mandatory.");
+ }*/
+
+ // Destination of the request
+ if (StringUtils.isBlank(request.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }
+
+ // SP Provided Id
+ if (StringUtils.isBlank(request.getSpProvidedId())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP provided Id is mandatory.");
+ }
+ }
+
+ /**
+ * Validate parameters from logout response.
+ *
+ * @param response the response.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutRes(final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters from logout request.");
+
+ // Issuer is mandatory
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ // Destination of the request
+ if (StringUtils.isBlank(response.getDestination())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: Destination is mandatory.");
+ }
+
+ // SP Provided Id
+ if (StringUtils.isBlank(request.getSpProvidedId())) {
+ throw new STORKSAMLEngineException(
+ "StorkSamlEngine: SP provided Id is mandatory.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+
+ /**
+ * Validate parameters from response.
+ *
+ * @param request the request
+ * @param responseAuthReq the response authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamResponse(final STORKAuthnRequest request,
+ final STORKAuthnResponse responseAuthReq)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response.");
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (responseAuthReq.getPersonalAttributeList() == null
+ || responseAuthReq.getPersonalAttributeList().isEmpty()) {
+ LOG.error("PersonalAttributeList is null or empty.");
+ throw new STORKSAMLEngineException(
+ "PersonalAttributeList is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameters from response.
+ *
+ * @param request the request
+ * @param responseAttrQueryReq the response authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryResponse(final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse responseAttrQueryReq)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate attribute querey parameters response.");
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (responseAttrQueryReq.getPersonalAttributeList() == null
+ || responseAttrQueryReq.getPersonalAttributeList().isEmpty()) {
+ LOG.error("PersonalAttributeList is null or empty.");
+ throw new STORKSAMLEngineException(
+ "PersonalAttributeList is null or empty.");
+ }
+
+ /*if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }*/
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameters from response.
+ *
+ * @param request the request
+ * @param responseAttrQueryReq the response authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryResponseFromAssertions(final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse responseAttrQueryReq)
+ throws STORKSAMLEngineException {
+ LOG.info("Validate attribute querey parameters response.");
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ /*if (responseAttrQueryReq.getPersonalAttributeList() == null
+ || responseAttrQueryReq.getPersonalAttributeList().isEmpty()) {
+ LOG.error("PersonalAttributeList is null or empty.");
+ throw new STORKSAMLEngineException(
+ "PersonalAttributeList is null or empty.");
+ }*/
+
+ /*if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }*/
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamResponseFail(final STORKAuthnRequest request,
+ final STORKAuthnResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getAssertionConsumerServiceURL())) {
+ throw new STORKSAMLEngineException(
+ "assertionConsumerServiceURL is null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamAttrQueryResponseFail(final STORKAttrQueryRequest request,
+ final STORKAttrQueryResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate parameter from response fail.
+ *
+ * @param request the request
+ * @param response the response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private void validateParamLogoutResFail(final STORKLogoutRequest request,
+ final STORKLogoutResponse response) throws STORKSAMLEngineException {
+ LOG.info("Validate parameters response fail.");
+
+ if (StringUtils.isBlank(request.getIssuer())) {
+ throw new STORKSAMLEngineException(
+ "Issuer must be not empty or null.");
+ }
+
+ if (StringUtils.isBlank(response.getStatusCode())) {
+ throw new STORKSAMLEngineException("Code error it's null or empty.");
+ }
+
+ if (StringUtils.isBlank(request.getSamlId())) {
+ throw new STORKSAMLEngineException("request ID is null or empty.");
+ }
+ }
+
+ /**
+ * Validate stork authentication request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sTORK authentication request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnRequest validateSTORKAuthnRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKAuthnRequest");
+
+ final AuthnRequest samlRequest = (AuthnRequest) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKAuthnRequest.");
+ final STORKAuthnRequest authnRequest = processExtensions(samlRequest
+ .getExtensions());
+
+ authnRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ authnRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ authnRequest.setSamlId(samlRequest.getID());
+ authnRequest.setDestination(samlRequest.getDestination());
+ authnRequest.setAssertionConsumerServiceURL(samlRequest
+ .getAssertionConsumerServiceURL());
+
+ authnRequest.setProviderName(samlRequest.getProviderName());
+ authnRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ //Delete unknown elements from requested ones
+ final Iterator<PersonalAttribute> iterator = authnRequest.getPersonalAttributeList().iterator();
+ IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) authnRequest.getPersonalAttributeList();
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ // Verify if the attribute name exits.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
+ cleanPerAttrList.remove(attribute.getName());
+ }
+
+ }
+ authnRequest.setPersonalAttributeList(cleanPerAttrList);
+
+ return authnRequest;
+
+ }
+
+ /**
+ * Validate stork attribute query request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the STORK attribute query request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryRequest validateSTORKAttrQueryRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKAttrQueryRequest");
+
+ //final AttributeQuery samlRequest = (AttributeQuery) validateStorkSaml(tokenSaml);
+ final CustomRequestAbstractType samlRequest = (CustomRequestAbstractType) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKAttrQueryRequest.");
+ final STORKAttrQueryRequest attrRequest = processAttrExtensions(samlRequest
+ .getExtensions());
+
+ attrRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ attrRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ attrRequest.setSamlId(samlRequest.getID());
+ attrRequest.setDestination(samlRequest.getDestination());
+ attrRequest.setAssertionConsumerServiceURL(samlRequest
+ .getAssertionConsumerServiceURL());
+
+ /*authnRequest.setProviderName(samlRequest.getProviderName());*/
+ attrRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ //Delete unknown elements from requested ones
+ final Iterator<PersonalAttribute> iterator = attrRequest.getPersonalAttributeList().iterator();
+ IPersonalAttributeList cleanPerAttrList = (PersonalAttributeList) attrRequest.getPersonalAttributeList();
+ while (iterator.hasNext()) {
+
+ final PersonalAttribute attribute = iterator.next();
+
+ // Verify if the attribute name exits.
+ final String attributeName = super.getSamlCoreProperties()
+ .getProperty(attribute.getName());
+
+ if (StringUtils.isBlank(attributeName)) {
+ LOG.info("Attribute name: {} was not found. It will be removed from the request object", attribute.getName());
+ cleanPerAttrList.remove(attribute.getName());
+ }
+
+ }
+ attrRequest.setPersonalAttributeList(cleanPerAttrList);
+
+ return attrRequest;
+
+ }
+
+ /**
+ * Validate stork logout request.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the STORK logout request
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKLogoutRequest validateSTORKLogoutRequest(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+ LOG.info("validateSTORKLogoutRequest");
+
+ final LogoutRequest samlRequest = (LogoutRequest)validateStorkSaml(tokenSaml);
+
+ LOG.debug("Validate Extensions.");
+ final Validator<Extensions> validatorExt = new ExtensionsSchemaValidator();
+ try {
+ validatorExt.validate(samlRequest.getExtensions());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: validate Extensions.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ LOG.debug("Generate STORKLogoutRequest.");
+ final STORKLogoutRequest logoutRequest = new STORKLogoutRequest();
+
+ logoutRequest.setCountry(this.getCountry(samlRequest.getSignature()
+ .getKeyInfo()));
+
+ logoutRequest.setAlias(this.getAlias(samlRequest.getSignature()
+ .getKeyInfo(), super.getSigner().getTrustStore()));
+
+ logoutRequest.setSamlId(samlRequest.getID());
+ logoutRequest.setDestination(samlRequest.getDestination());
+
+ logoutRequest.setIssuer(samlRequest.getIssuer().getValue());
+
+ logoutRequest.setSpProvidedId(samlRequest.getNameID().getValue());
+
+ return logoutRequest;
+
+ }
+
+ /**
+ * Validate stork authentication response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse validateSTORKAuthnResponse(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAuthnResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAuthResponse.");
+ final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
+
+ authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ authnResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ authnResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ authnResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ authnResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ authnResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ authnResponse.setAssertions(samlResponse.getAssertions());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ authnResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ authnResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ authnResponse.setFail(true);
+ }
+ LOG.debug("Return result.");
+ return authnResponse;
+
+ }
+
+ /**
+ * Validate stork authentication response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork authentication response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAuthnResponse validateSTORKAuthnResponseWithQuery(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAuthnResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAuthResponse.");
+ final STORKAuthnResponse authnResponse = new STORKAuthnResponse();
+
+ authnResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ authnResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ authnResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ authnResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ authnResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ authnResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ authnResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ authnResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(authnResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ authnResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ authnResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ authnResponse.setFail(true);
+ }
+
+ authnResponse.setAssertions(samlResponse.getAssertions());
+ if (samlResponse.getAssertions().size() > 1)
+ {
+ PersonalAttributeList total = new PersonalAttributeList();
+ List<IPersonalAttributeList> attrList = new ArrayList();
+ for (int i = 0; i < samlResponse.getAssertions().size(); i++)
+ {
+ Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
+ IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
+ if (temp != null)
+ {
+ attrList.add(temp);
+ for (PersonalAttribute attribute : temp) {
+ PersonalAttribute attr = (PersonalAttribute)attribute.clone();
+ attr.setName(attr.getName()+tempAssertion.getID());
+ total.add(attr);
+ }
+ }
+ }
+ authnResponse.setPersonalAttributeLists(attrList);
+ authnResponse.setTotalPersonalAttributeList(total);
+ }
+
+ LOG.debug("Return result.");
+ return authnResponse;
+
+ }
+
+ /**
+ * Validate stork attribute query response.
+ *
+ * @param tokenSaml the token SAML
+ * @param userIP the user IP
+ *
+ * @return the Stork attribute query response
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public STORKAttrQueryResponse validateSTORKAttrQueryResponse(
+ final byte[] tokenSaml, final String userIP)
+ throws STORKSAMLEngineException {
+
+ LOG.info("validateSTORKAttrQueryResponse");
+ final Response samlResponse = (Response) validateStorkSaml(tokenSaml);
+
+ LOG.debug("Create StorkAttrQueryResponse.");
+ final STORKAttrQueryResponse attrQueryResponse = new STORKAttrQueryResponse();
+
+ attrQueryResponse.setCountry(this.getCountry(samlResponse.getSignature()
+ .getKeyInfo()));
+
+ LOG.debug("Set ID.");
+ attrQueryResponse.setSamlId(samlResponse.getID());
+ LOG.debug("Set InResponseTo.");
+ attrQueryResponse.setInResponseTo(samlResponse.getInResponseTo());
+ LOG.debug("Set statusCode.");
+ attrQueryResponse.setStatusCode(samlResponse.getStatus().getStatusCode()
+ .getValue());
+
+
+ // Subordinate code.
+ if (samlResponse.getStatus().getStatusCode().getStatusCode() != null) {
+ attrQueryResponse.setSubStatusCode(samlResponse.getStatus()
+ .getStatusCode().getStatusCode().getValue());
+ }
+
+ if (samlResponse.getStatus().getStatusMessage() != null) {
+ LOG.debug("Set statusMessage.");
+ attrQueryResponse.setMessage(samlResponse.getStatus()
+ .getStatusMessage().getMessage());
+ }
+
+ LOG.debug("validateStorkResponse");
+ final Assertion assertion = (Assertion) validateStorkResponse(
+ samlResponse, userIP);
+
+ if(assertion!=null){
+ final DateTime serverDate = new DateTime();
+
+ attrQueryResponse.setAssertion(assertion);
+
+ if (assertion.getConditions().getNotOnOrAfter().isBefore(serverDate)) {
+ LOG.error("Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + ", server_date: " + serverDate + ")");
+ throw new STORKSAMLEngineException(
+ "Token date expired (getNotOnOrAfter = "
+ + assertion.getConditions().getNotOnOrAfter()
+ + " ), server_date: " + serverDate);
+ }
+
+ LOG.debug("Set notOnOrAfter.");
+ attrQueryResponse.setNotOnOrAfter(assertion.getConditions()
+ .getNotOnOrAfter());
+
+ LOG.debug("Set notBefore.");
+ attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ attrQueryResponse.setNotBefore(assertion.getConditions().getNotBefore());
+
+ attrQueryResponse.setAudienceRestriction(((AudienceRestriction) assertion
+ .getConditions().getAudienceRestrictions().get(0))
+ .getAudiences().get(0).getAudienceURI());
+ }
+
+ // Case no error.
+ if (assertion!=null && StatusCode.SUCCESS_URI.equalsIgnoreCase(attrQueryResponse
+ .getStatusCode())) {
+ LOG.debug("Status Success. Set PersonalAttributeList.");
+ attrQueryResponse
+ .setPersonalAttributeList(generatePersonalAttributeList(assertion));
+ attrQueryResponse.setFail(false);
+ } else {
+ LOG.debug("Status Fail.");
+ attrQueryResponse.setFail(true);
+ }
+
+ attrQueryResponse.setAssertions(samlResponse.getAssertions());
+ if (samlResponse.getAssertions().size() > 1)
+ {
+ PersonalAttributeList total = new PersonalAttributeList();
+ List<IPersonalAttributeList> attrList = new ArrayList();
+ for (int i = 0; i < samlResponse.getAssertions().size(); i++)
+ {
+ Assertion tempAssertion = (Assertion)samlResponse.getAssertions().get(i);
+ IPersonalAttributeList temp = generatePersonalAttributeList(tempAssertion);
+ if (temp != null)
+ {
+ attrList.add(temp);
+ for (PersonalAttribute attribute : temp) {
+ PersonalAttribute attr = (PersonalAttribute)attribute.clone();
+ attr.setName(attr.getName()+tempAssertion.getID());
+ total.add(attr);
+ }
+ }
+ }
+ attrQueryResponse.setPersonalAttributeLists(attrList);
+ attrQueryResponse.setTotalPersonalAttributeList(total);
+ }
+
+ LOG.debug("Return result.");
+ return attrQueryResponse;
+
+ }
+
+ /**
+ * Validate stork response.
+ *
+ * @param samlResponse the SAML response
+ * @param userIP the user IP
+ *
+ * @return the assertion
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private Assertion validateStorkResponse(final Response samlResponse,
+ final String userIP) throws STORKSAMLEngineException {
+ // Exist only one Assertion
+
+ if (samlResponse.getAssertions() == null
+ || samlResponse.getAssertions().isEmpty()) {
+ LOG.info("Assertion is null or empty."); //in replace of throw new STORKSAMLEngineException("Assertion is null or empty.")
+ return null;
+ }
+
+ final Assertion assertion = (Assertion) samlResponse.getAssertions()
+ .get(0);
+
+ LOG.debug("Verified method Bearer");
+ for (final Iterator<SubjectConfirmation> iter = assertion.getSubject()
+ .getSubjectConfirmations().iterator(); iter.hasNext();) {
+ final SubjectConfirmation element = iter.next();
+ final boolean isBearer = SubjectConfirmation.METHOD_BEARER
+ .equals(element.getMethod());
+
+ final boolean ipValidate = super.getSamlCoreProperties()
+ .isIpValidation();
+
+ if (ipValidate) {
+ if (isBearer) {
+ if (StringUtils.isBlank(userIP)) {
+ LOG.error("browser_ip is null or empty.");
+ throw new STORKSAMLEngineException(
+ "browser_ip is null or empty.");
+ } else if (StringUtils.isBlank(element
+ .getSubjectConfirmationData().getAddress())) {
+ LOG.error("token_ip attribute is null or empty.");
+ throw new STORKSAMLEngineException(
+ "token_ip attribute is null or empty.");
+ }
+ }
+
+ final boolean ipEqual = element.getSubjectConfirmationData()
+ .getAddress().equals(userIP);
+
+ // Validation ipUser
+ if (!ipEqual && ipValidate) {
+ LOG.error("SubjectConfirmation BEARER: ");
+ throw new STORKSAMLEngineException(
+ "IPs doesn't match : token_ip ("
+ + element.getSubjectConfirmationData()
+ .getAddress() + ") browser_ip ("
+ + userIP + ")");
+ }
+ }
+
+ }
+ return assertion;
+ }
+
+ /**
+ * Validate stork SAML.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the signable SAML object
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ private SignableSAMLObject validateStorkSaml(final byte[] tokenSaml)
+ throws STORKSAMLEngineException {
+
+ LOG.info("Validate StorkSaml message.");
+
+ if (tokenSaml == null) {
+ LOG.error("Saml authentication request is null.");
+ throw new STORKSAMLEngineException(
+ "Saml authentication request is null.");
+ }
+
+ LOG.debug("Generate AuthnRequest from request.");
+ SignableSAMLObject samlObject;
+
+ try {
+ samlObject = (SignableSAMLObject) super.unmarshall(tokenSaml);
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException unmarshall.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ boolean validateSign = true;
+
+ if (StringUtils.isNotBlank(super.getSamlCoreProperties().getProperty(
+ "validateSignature"))) {
+ validateSign = Boolean.valueOf(super.getSamlCoreProperties()
+ .getProperty("validateSignature"));
+ }
+
+ if (validateSign) {
+ LOG.debug("Validate Signature.");
+ try {
+ super.validateSignature(samlObject);
+ } catch (SAMLEngineException e) {
+ LOG.error("SAMLEngineException validateSignature.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ LOG.debug("Validate Schema.");
+ final ValidatorSuite validatorSuite = Configuration
+ .getValidatorSuite("saml2-core-schema-validator");
+ try {
+ if (samlObject.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ CustomAttributeQueryValidator val =
+ new CustomAttributeQueryValidator();
+ val.validate((CustomAttributeQuery)samlObject);
+ }
+ else if (samlObject instanceof Response
+ && ((Response) samlObject).getAssertions().size() > 1) {
+ MultipleAssertionResponseValidator val =
+ new MultipleAssertionResponseValidator();
+ val.validate((Response)samlObject);
+ }
+ else
+ validatorSuite.validate(samlObject);
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.", e);
+ throw new STORKSAMLEngineException(e);
+ }
+
+ return samlObject;
+ }
+
+ private boolean isComplex(XMLObject xmlObject)
+ {
+ boolean isComplex = false;
+
+ final XSAnyImpl complexValue = (XSAnyImpl) xmlObject;
+
+ for (int nextComplexValue = 0; nextComplexValue < complexValue
+ .getUnknownXMLObjects().size(); nextComplexValue++) {
+
+ final XSAnyImpl simple = (XSAnyImpl) complexValue
+ .getUnknownXMLObjects().get(
+ nextComplexValue);
+
+ if (simple.getElementQName().getLocalPart() != null)
+ {
+ isComplex = true;
+ break;
+ }
+ }
+
+ return isComplex;
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java
index e38cc5f0b..724a522d1 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/X509PrincipalUtil.java
@@ -1,69 +1,69 @@
-package eu.stork.peps.auth.engine;
-
-import org.bouncycastle.asn1.DERObjectIdentifier;
-import org.bouncycastle.jce.X509Principal;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class used to decrease complexity of comparison of 2 X509principal
- *
- * @author vanegdi
- * @version $Revision: 1.00 $, $Date: 2013-05-24 20:53:51 $
- */
-public final class X509PrincipalUtil{
-
- private static final DERObjectIdentifier[] DER_OBJECT_IDENTIFIERS_ARRAY= {
- X509Principal.CN,
- X509Principal.OU,
- X509Principal.O,
- X509Principal.L,
- X509Principal.ST,
- X509Principal.C,
- X509Principal.E
- };
-
- private static final Logger LOG = LoggerFactory.getLogger(eu.stork.peps.auth.engine.X509PrincipalUtil.class);
-
- /**
- * Compares 2 X509Principals to detect if they equals
- * @param principal1
- * @param principal2
- * @return true if arguments are not null and equals
- */
- public static boolean equals(X509Principal principal1, X509Principal principal2) {
- boolean continueProcess = true;
- if (principal1 == null || principal2 == null){
- return false;
- }
-
- int cpt = 0;
- while(continueProcess && cpt < DER_OBJECT_IDENTIFIERS_ARRAY.length){
- continueProcess = continueProcess && x509ValuesByIdentifierEquals(principal1, principal2, DER_OBJECT_IDENTIFIERS_ARRAY[cpt]);
- cpt++;
- }
- return continueProcess;
- }
-
- public static boolean equals2(X509Principal principal1, X509Principal principal2) {
-
- if (principal1 == null || principal2 == null){
- return false;
- }
-
- if (principal1.getName().equals(principal2.getName()))
- return true;
- else
- return false;
-
- }
-
- private static boolean x509ValuesByIdentifierEquals(X509Principal principal1, X509Principal principal2, DERObjectIdentifier identifier){
- return principal1.getValues(identifier).equals(principal2.getValues(identifier));
- }
-
- private X509PrincipalUtil(){
- // default contructor
- LOG.error("Fake X509PrincipalUtil : never be called");
- }
-}
+package eu.stork.peps.auth.engine;
+
+import org.bouncycastle.asn1.DERObjectIdentifier;
+import org.bouncycastle.jce.X509Principal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility class used to decrease complexity of comparison of 2 X509principal
+ *
+ * @author vanegdi
+ * @version $Revision: 1.00 $, $Date: 2013-05-24 20:53:51 $
+ */
+public final class X509PrincipalUtil{
+
+ private static final DERObjectIdentifier[] DER_OBJECT_IDENTIFIERS_ARRAY= {
+ X509Principal.CN,
+ X509Principal.OU,
+ X509Principal.O,
+ X509Principal.L,
+ X509Principal.ST,
+ X509Principal.C,
+ X509Principal.E
+ };
+
+ private static final Logger LOG = LoggerFactory.getLogger(eu.stork.peps.auth.engine.X509PrincipalUtil.class);
+
+ /**
+ * Compares 2 X509Principals to detect if they equals
+ * @param principal1
+ * @param principal2
+ * @return true if arguments are not null and equals
+ */
+ public static boolean equals(X509Principal principal1, X509Principal principal2) {
+ boolean continueProcess = true;
+ if (principal1 == null || principal2 == null){
+ return false;
+ }
+
+ int cpt = 0;
+ while(continueProcess && cpt < DER_OBJECT_IDENTIFIERS_ARRAY.length){
+ continueProcess = continueProcess && x509ValuesByIdentifierEquals(principal1, principal2, DER_OBJECT_IDENTIFIERS_ARRAY[cpt]);
+ cpt++;
+ }
+ return continueProcess;
+ }
+
+ public static boolean equals2(X509Principal principal1, X509Principal principal2) {
+
+ if (principal1 == null || principal2 == null){
+ return false;
+ }
+
+ if (principal1.getName().equals(principal2.getName()))
+ return true;
+ else
+ return false;
+
+ }
+
+ private static boolean x509ValuesByIdentifierEquals(X509Principal principal1, X509Principal principal2, DERObjectIdentifier identifier){
+ return principal1.getValues(identifier).equals(principal2.getValues(identifier));
+ }
+
+ private X509PrincipalUtil(){
+ // default contructor
+ LOG.error("Fake X509PrincipalUtil : never be called");
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java
index 07157073c..a9efe6362 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/AuthenticationAttributes.java
@@ -1,57 +1,57 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface AuthenticationAttributes.
- * @author fjquevedo
- */
-public interface AuthenticationAttributes extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "AuthenticationAttributes";
-
- /** Default element name. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** Local name of the XSI type. */
- String TYPE_LOCAL_NAME = "AuthenticationAttributesType";
-
- /** QName of the XSI type. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
-
- /**
- * Gets the citizen country code.
- *
- * @return the citizen country code
- */
- VIDPAuthenticationAttributes getVIDPAuthenticationAttributes();
-
-
- /**
- * Sets the vIDP authentication attributes.
- *
- * @param newVIDPAuthenticationAttr the new vIDP authentication attributes
- */
- void setVIDPAuthenticationAttributes(VIDPAuthenticationAttributes newVIDPAuthenticationAttr);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface AuthenticationAttributes.
+ * @author fjquevedo
+ */
+public interface AuthenticationAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "AuthenticationAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "AuthenticationAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ VIDPAuthenticationAttributes getVIDPAuthenticationAttributes();
+
+
+ /**
+ * Sets the vIDP authentication attributes.
+ *
+ * @param newVIDPAuthenticationAttr the new vIDP authentication attributes
+ */
+ void setVIDPAuthenticationAttributes(VIDPAuthenticationAttributes newVIDPAuthenticationAttr);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java
index 859d37feb..4af7524ea 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CitizenCountryCode.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossBorderShare.
- * @author fjquevedo
- */
-public interface CitizenCountryCode extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "CitizenCountryCode";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "CitizenCountryCodeType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /**
- * Gets the SP country.
- *
- * @return the sP country
- */
- String getCitizenCountryCode();
-
-
- /**
- * Sets the citizen country code.
- *
- * @param citizenCountryCode the new citizen country code
- */
- void setCitizenCountryCode(String citizenCountryCode);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author fjquevedo
+ */
+public interface CitizenCountryCode extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "CitizenCountryCode";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "CitizenCountryCodeType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP country.
+ *
+ * @return the sP country
+ */
+ String getCitizenCountryCode();
+
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param citizenCountryCode the new citizen country code
+ */
+ void setCitizenCountryCode(String citizenCountryCode);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java
index c326ae8d9..b558fc19d 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomAttributeQuery.java
@@ -1,51 +1,51 @@
-package eu.stork.peps.auth.engine.core;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.xml.SAMLConstants;
-import org.opensaml.saml2.core.Attribute;
-import org.opensaml.saml2.core.Subject;
-import org.opensaml.saml2.core.SubjectQuery;
-
-public interface CustomAttributeQuery extends CustomRequestAbstractType {
- /** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AttributeQuery";
-
- /** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
- SAMLConstants.SAML20P_PREFIX);
-
- /** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "CustomAttributeQueryType";
-
- /** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
- SAMLConstants.SAML20P_PREFIX);
-
- /** AssertionConsumerServiceURL attribute name. */
- public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME
- = "AssertionConsumerServiceURL";
-
- /**
- * Gets the Attributes of this query.
- *
- * @return the list of Attributes of this query
- */
- public List<Attribute> getAttributes();
-
- /**
- * Gets the Subject of this request.
- *
- * @return the Subject of this request
- */
- public Subject getSubject();
-
- /**
- * Sets the Subject of this request.
- *
- * @param newSubject the Subject of this request
- */
- public void setSubject(Subject newSubject);
-
-}
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.Subject;
+import org.opensaml.saml2.core.SubjectQuery;
+
+public interface CustomAttributeQuery extends CustomRequestAbstractType {
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AttributeQuery";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "CustomAttributeQueryType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** AssertionConsumerServiceURL attribute name. */
+ public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME
+ = "AssertionConsumerServiceURL";
+
+ /**
+ * Gets the Attributes of this query.
+ *
+ * @return the list of Attributes of this query
+ */
+ public List<Attribute> getAttributes();
+
+ /**
+ * Gets the Subject of this request.
+ *
+ * @return the Subject of this request
+ */
+ public Subject getSubject();
+
+ /**
+ * Sets the Subject of this request.
+ *
+ * @param newSubject the Subject of this request
+ */
+ public void setSubject(Subject newSubject);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java
index fa847378b..77dd8c4a5 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/CustomRequestAbstractType.java
@@ -1,176 +1,176 @@
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.joda.time.DateTime;
-import org.opensaml.common.SAMLVersion;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.common.xml.SAMLConstants;
-import org.opensaml.saml2.common.Extensions;
-import org.opensaml.saml2.core.Issuer;
-
-public interface CustomRequestAbstractType extends SignableSAMLObject {
-
- /** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "RequestAbstractType";
-
- /** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
- SAMLConstants.SAML20P_PREFIX);
-
- /** ID attribute name. */
- public static final String ID_ATTRIB_NAME = "ID";
-
- /** Version attribute name. */
- public static final String VERSION_ATTRIB_NAME = "Version";
-
- /** IssueInstant attribute name. */
- public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
-
- /** Destination attribute name. */
- public static final String DESTINATION_ATTRIB_NAME = "Destination";
-
- /** Destination attribute name. */
- public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME = "AssertionConsumerServiceURL";
-
- /** Consent attribute name. */
- public static final String CONSENT_ATTRIB_NAME = "Consent";
-
- /** Unspecified consent URI. */
- public static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
-
- /** Obtained consent URI. */
- public static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
-
- /** Prior consent URI. */
- public static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
-
- /** Implicit consent URI. */
- public static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
-
- /** Explicit consent URI. */
- public static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
-
- /** Unavailable consent URI. */
- public static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
-
- /** Inapplicable consent URI. */
- public static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
-
- /**
- * Gets the SAML Version of this request.
- *
- * @return the SAML Version of this request.
- */
- public SAMLVersion getVersion();
-
- /**
- * Sets the SAML Version of this request.
- *
- * @param newVersion the SAML Version of this request
- */
- public void setVersion(SAMLVersion newVersion);
-
- /**
- * Gets the unique identifier of the request.
- *
- * @return the unique identifier of the request
- */
- public String getID();
-
- /**
- * Sets the unique identifier of the request.
- *
- * @param newID the unique identifier of the request
- */
-
- public void setID(String newID);
-
- /**
- * Gets the date/time the request was issued.
- *
- * @return the date/time the request was issued
- */
-
- public DateTime getIssueInstant();
-
- /**
- * Sets the date/time the request was issued.
- *
- * @param newIssueInstant the date/time the request was issued
- */
- public void setIssueInstant(DateTime newIssueInstant);
-
- /**
- * Gets the URI of the destination of the request.
- *
- * @return the URI of the destination of the request
- */
- public String getDestination();
-
- /**
- * Sets the URI of the destination of the request.
- *
- * @param newDestination the URI of the destination of the request
- */
- public void setDestination(String newDestination);
-
- /**
- * Sets the index of the particular Assertion Consumer Service to which the response to this request should be
- * delivered.
- *
- * @param newAssertionConsumerServiceIndex the new value of the AssertionConsumerServiceIndex attribute
- */
- public void setAssertionConsumerServiceURL(String newServiceUrl);
-
- /**
- * Gets the URL of the particular Assertion Consumer Service to which the response to this request should be
- * delivered.
- *
- * @return the value of the AssertionConsumerServiceURL attribute
- */
- public String getAssertionConsumerServiceURL();
-
- /**
- * Gets the consent obtained from the principal for sending this request.
- *
- * @return the consent obtained from the principal for sending this request
- */
- public String getConsent();
-
- /**
- * Sets the consent obtained from the principal for sending this request.
- *
- * @param newConsent the new consent obtained from the principal for sending this request
- */
- public void setConsent(String newConsent);
-
- /**
- * Gets the issuer of this request.
- *
- * @return the issuer of this request
- */
- public Issuer getIssuer();
-
- /**
- * Sets the issuer of this request.
- *
- * @param newIssuer the issuer of this request
- */
- public void setIssuer(Issuer newIssuer);
-
- /**
- * Gets the Extensions of this request.
- *
- * @return the Status of this request
- */
- public Extensions getExtensions();
-
- /**
- * Sets the Extensions of this request.
- *
- * @param newExtensions the Extensions of this request
- */
- public void setExtensions(Extensions newExtensions);
-
-}
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.joda.time.DateTime;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.saml2.core.Issuer;
+
+public interface CustomRequestAbstractType extends SignableSAMLObject {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "RequestAbstractType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ /** ID attribute name. */
+ public static final String ID_ATTRIB_NAME = "ID";
+
+ /** Version attribute name. */
+ public static final String VERSION_ATTRIB_NAME = "Version";
+
+ /** IssueInstant attribute name. */
+ public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
+
+ /** Destination attribute name. */
+ public static final String DESTINATION_ATTRIB_NAME = "Destination";
+
+ /** Destination attribute name. */
+ public static final String ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME = "AssertionConsumerServiceURL";
+
+ /** Consent attribute name. */
+ public static final String CONSENT_ATTRIB_NAME = "Consent";
+
+ /** Unspecified consent URI. */
+ public static final String UNSPECIFIED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified";
+
+ /** Obtained consent URI. */
+ public static final String OBTAINED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:obtained";
+
+ /** Prior consent URI. */
+ public static final String PRIOR_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:prior";
+
+ /** Implicit consent URI. */
+ public static final String IMPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+
+ /** Explicit consent URI. */
+ public static final String EXPLICIT_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+
+ /** Unavailable consent URI. */
+ public static final String UNAVAILABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unavailable";
+
+ /** Inapplicable consent URI. */
+ public static final String INAPPLICABLE_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:inapplicable";
+
+ /**
+ * Gets the SAML Version of this request.
+ *
+ * @return the SAML Version of this request.
+ */
+ public SAMLVersion getVersion();
+
+ /**
+ * Sets the SAML Version of this request.
+ *
+ * @param newVersion the SAML Version of this request
+ */
+ public void setVersion(SAMLVersion newVersion);
+
+ /**
+ * Gets the unique identifier of the request.
+ *
+ * @return the unique identifier of the request
+ */
+ public String getID();
+
+ /**
+ * Sets the unique identifier of the request.
+ *
+ * @param newID the unique identifier of the request
+ */
+
+ public void setID(String newID);
+
+ /**
+ * Gets the date/time the request was issued.
+ *
+ * @return the date/time the request was issued
+ */
+
+ public DateTime getIssueInstant();
+
+ /**
+ * Sets the date/time the request was issued.
+ *
+ * @param newIssueInstant the date/time the request was issued
+ */
+ public void setIssueInstant(DateTime newIssueInstant);
+
+ /**
+ * Gets the URI of the destination of the request.
+ *
+ * @return the URI of the destination of the request
+ */
+ public String getDestination();
+
+ /**
+ * Sets the URI of the destination of the request.
+ *
+ * @param newDestination the URI of the destination of the request
+ */
+ public void setDestination(String newDestination);
+
+ /**
+ * Sets the index of the particular Assertion Consumer Service to which the response to this request should be
+ * delivered.
+ *
+ * @param newAssertionConsumerServiceIndex the new value of the AssertionConsumerServiceIndex attribute
+ */
+ public void setAssertionConsumerServiceURL(String newServiceUrl);
+
+ /**
+ * Gets the URL of the particular Assertion Consumer Service to which the response to this request should be
+ * delivered.
+ *
+ * @return the value of the AssertionConsumerServiceURL attribute
+ */
+ public String getAssertionConsumerServiceURL();
+
+ /**
+ * Gets the consent obtained from the principal for sending this request.
+ *
+ * @return the consent obtained from the principal for sending this request
+ */
+ public String getConsent();
+
+ /**
+ * Sets the consent obtained from the principal for sending this request.
+ *
+ * @param newConsent the new consent obtained from the principal for sending this request
+ */
+ public void setConsent(String newConsent);
+
+ /**
+ * Gets the issuer of this request.
+ *
+ * @return the issuer of this request
+ */
+ public Issuer getIssuer();
+
+ /**
+ * Sets the issuer of this request.
+ *
+ * @param newIssuer the issuer of this request
+ */
+ public void setIssuer(Issuer newIssuer);
+
+ /**
+ * Gets the Extensions of this request.
+ *
+ * @return the Status of this request
+ */
+ public Extensions getExtensions();
+
+ /**
+ * Sets the Extensions of this request.
+ *
+ * @param newExtensions the Extensions of this request
+ */
+ public void setExtensions(Extensions newExtensions);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java
index c892eae78..03541ece1 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossBorderShare.java
@@ -1,58 +1,58 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossBorderShare.
- * @author fjquevedo
- */
-public interface EIDCrossBorderShare extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "eIDCrossBorderShare";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "eIDCrossBorderShareType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
-
- /**
- * Gets the eID cross border share.
- *
- * @return the eID cross border share
- */
- String getEIDCrossBorderShare();
-
-
- /**
- * Sets the eID cross border share.
- *
- * @param eIDCrossBorderShare the new eID cross border share
- */
- void setEIDCrossBorderShare(String eIDCrossBorderShare);
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author fjquevedo
+ */
+public interface EIDCrossBorderShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "eIDCrossBorderShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDCrossBorderShareType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the eID cross border share.
+ *
+ * @return the eID cross border share
+ */
+ String getEIDCrossBorderShare();
+
+
+ /**
+ * Sets the eID cross border share.
+ *
+ * @param eIDCrossBorderShare the new eID cross border share
+ */
+ void setEIDCrossBorderShare(String eIDCrossBorderShare);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java
index f879914f9..14c504510 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDCrossSectorShare.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossSectorShare.
- * @author fjquevedo
- */
-public interface EIDCrossSectorShare extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String ELEM_LOCAL_NAME = "eIDCrossSectorShare";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), ELEM_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "eIDCrossSectorShareType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /**
- * Gets the eID cross sector share.
- *
- * @return the eID cross sector share
- */
- String getEIDCrossSectorShare();
-
- /**
- * Sets the eID cross sector share.
- *
- * @param eIDCrossSectorShare the new eID cross sector share
- */
- void setEIDCrossSectorShare(String eIDCrossSectorShare);
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossSectorShare.
+ * @author fjquevedo
+ */
+public interface EIDCrossSectorShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String ELEM_LOCAL_NAME = "eIDCrossSectorShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), ELEM_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDCrossSectorShareType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the eID cross sector share.
+ *
+ * @return the eID cross sector share
+ */
+ String getEIDCrossSectorShare();
+
+ /**
+ * Sets the eID cross sector share.
+ *
+ * @param eIDCrossSectorShare the new eID cross sector share
+ */
+ void setEIDCrossSectorShare(String eIDCrossSectorShare);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java
index dc88f3318..0202f000c 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/EIDSectorShare.java
@@ -1,57 +1,57 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDSectorShare.
- * @author fjquevedo
- */
-public interface EIDSectorShare extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "eIDSectorShare";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "eIDSectorShare";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
-
- /**
- * Gets the eID sector share.
- *
- * @return the eID sector share
- */
- String getEIDSectorShare();
-
- /**
- * Sets the eID sector share.
- *
- * @param eIDSectorShare the new eID sector share
- */
- void setEIDSectorShare(String eIDSectorShare);
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDSectorShare.
+ * @author fjquevedo
+ */
+public interface EIDSectorShare extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "eIDSectorShare";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "eIDSectorShare";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the eID sector share.
+ *
+ * @return the eID sector share
+ */
+ String getEIDSectorShare();
+
+ /**
+ * Sets the eID sector share.
+ *
+ * @param eIDSectorShare the new eID sector share
+ */
+ void setEIDSectorShare(String eIDSectorShare);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java
index 2c09cf85b..d99d23896 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/QAAAttribute.java
@@ -1,63 +1,63 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * STORK Quality Authentication Assurance Level Attribute Interface.
- *
- * @author fjquevedo
- */
-public interface QAAAttribute extends SAMLObject {
-
- /** Element local name. */
- String DEF_LOCAL_NAME = "QualityAuthenticationAssuranceLevel";
-
- /** Default element name. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** Local name of the XSI type. */
- String TYPE_LOCAL_NAME = "QualityAuthenticationAssuranceLevelAbstractType";
-
- /** QName of the XSI type. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** The minimum value allowed. */
- int MIN_VALUE = 1;
-
- /** The Max value allowed. */
- int MAX_VALUE = 4;
-
- /**
- * Gets the qAA level.
- *
- * @return the qAA level
- */
- String getQaaLevel();
-
- /**
- * Sets the qAA level.
- *
- * @param qaaLevel the new qAA level
- *
- */
- void setQaaLevel(String qaaLevel);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * STORK Quality Authentication Assurance Level Attribute Interface.
+ *
+ * @author fjquevedo
+ */
+public interface QAAAttribute extends SAMLObject {
+
+ /** Element local name. */
+ String DEF_LOCAL_NAME = "QualityAuthenticationAssuranceLevel";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "QualityAuthenticationAssuranceLevelAbstractType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The minimum value allowed. */
+ int MIN_VALUE = 1;
+
+ /** The Max value allowed. */
+ int MAX_VALUE = 4;
+
+ /**
+ * Gets the qAA level.
+ *
+ * @return the qAA level
+ */
+ String getQaaLevel();
+
+ /**
+ * Sets the qAA level.
+ *
+ * @param qaaLevel the new qAA level
+ *
+ */
+ void setQaaLevel(String qaaLevel);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java
index 02be9e104..ffd32b3cf 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttribute.java
@@ -1,140 +1,140 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-import org.opensaml.xml.AttributeExtensibleXMLObject;
-import org.opensaml.xml.schema.XSBooleanValue;
-import org.opensaml.xml.XMLObject;
-
-/**
- * The Interface RequestedAttribute.
- *
- * @author fjquevedo
- */
-public interface RequestedAttribute extends SAMLObject,
- AttributeExtensibleXMLObject {
-
- /** Element local name. */
- String DEF_LOCAL_NAME = "RequestedAttribute";
-
- /** Default element name. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** Local name of the XSI type. */
- String TYPE_LOCAL_NAME = "RequestedAttributeAbstractType";
-
- /** QName of the XSI type. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** NAME_ATTRIB_NAME attribute name. */
- String NAME_ATTRIB_NAME = "Name";
-
- /** NAME_FORMAT_ATTRIB_NAME attribute name. */
- String NAME_FORMAT_ATTR = "NameFormat";
-
- /** IS_REQUIRED_ATTRIB_NAME attribute name. */
- String IS_REQUIRED_ATTR = "isRequired";
-
- /** FRIENDLY_NAME_ATTRIB_NAME attribute name. */
- String FRIENDLY_NAME_ATT = "FriendlyName";
-
- /** Unspecified attribute format ID. */
- String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
-
- /** URI reference attribute format ID. */
- String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
-
- /** Basic attribute format ID. */
- String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- String getName();
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- void setName(String name);
-
- /**
- * Gets the name format.
- *
- * @return the name format
- */
- String getNameFormat();
-
- /**
- * Sets the name format.
- *
- * @param nameFormat the new name format
- */
- void setNameFormat(String nameFormat);
-
- /**
- * Gets the friendly name.
- *
- * @return the friendly name
- */
- String getFriendlyName();
-
- /**
- * Sets the friendly name.
- *
- * @param friendlyName the new friendly name
- */
- void setFriendlyName(String friendlyName);
-
- /**
- * Gets the checks if is required.
- *
- * @return the checks if is required
- */
- String isRequired();
-
- /**
- * Gets the checks if is required xs boolean.
- *
- * @return the checks if is required xs boolean
- */
- String getIsRequiredXSBoolean();
-
- /**
- * Sets the checks if is required.
- *
- * @param newIsRequired the new checks if is required
- */
- void setIsRequired(String newIsRequired);
-
- /**
- * Gets the attribute values.
- *
- * @return the attribute values
- */
- List<XMLObject> getAttributeValues();
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * The Interface RequestedAttribute.
+ *
+ * @author fjquevedo
+ */
+public interface RequestedAttribute extends SAMLObject,
+ AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ String DEF_LOCAL_NAME = "RequestedAttribute";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "RequestedAttributeAbstractType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** NAME_ATTRIB_NAME attribute name. */
+ String NAME_ATTRIB_NAME = "Name";
+
+ /** NAME_FORMAT_ATTRIB_NAME attribute name. */
+ String NAME_FORMAT_ATTR = "NameFormat";
+
+ /** IS_REQUIRED_ATTRIB_NAME attribute name. */
+ String IS_REQUIRED_ATTR = "isRequired";
+
+ /** FRIENDLY_NAME_ATTRIB_NAME attribute name. */
+ String FRIENDLY_NAME_ATT = "FriendlyName";
+
+ /** Unspecified attribute format ID. */
+ String UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
+
+ /** URI reference attribute format ID. */
+ String URI_REFERENCE = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri";
+
+ /** Basic attribute format ID. */
+ String BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ String getName();
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ void setName(String name);
+
+ /**
+ * Gets the name format.
+ *
+ * @return the name format
+ */
+ String getNameFormat();
+
+ /**
+ * Sets the name format.
+ *
+ * @param nameFormat the new name format
+ */
+ void setNameFormat(String nameFormat);
+
+ /**
+ * Gets the friendly name.
+ *
+ * @return the friendly name
+ */
+ String getFriendlyName();
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param friendlyName the new friendly name
+ */
+ void setFriendlyName(String friendlyName);
+
+ /**
+ * Gets the checks if is required.
+ *
+ * @return the checks if is required
+ */
+ String isRequired();
+
+ /**
+ * Gets the checks if is required xs boolean.
+ *
+ * @return the checks if is required xs boolean
+ */
+ String getIsRequiredXSBoolean();
+
+ /**
+ * Sets the checks if is required.
+ *
+ * @param newIsRequired the new checks if is required
+ */
+ void setIsRequired(String newIsRequired);
+
+ /**
+ * Gets the attribute values.
+ *
+ * @return the attribute values
+ */
+ List<XMLObject> getAttributeValues();
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java
index 9004b10f4..6e3da28c3 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/RequestedAttributes.java
@@ -1,51 +1,51 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface RequestedAttributes.
- *
- * @author fjquevedo
- */
-public interface RequestedAttributes extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "RequestedAttributes";
-
- /** Default element name. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** Local name of the XSI type. */
- String TYPE_LOCAL_NAME = "RequestedAttributesType";
-
- /** QName of the XSI type. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /**
- * Gets the attributes.
- *
- * @return the attributes
- */
- List<RequestedAttribute> getAttributes();
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface RequestedAttributes.
+ *
+ * @author fjquevedo
+ */
+public interface RequestedAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "RequestedAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "RequestedAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the attributes.
+ *
+ * @return the attributes
+ */
+ List<RequestedAttribute> getAttributes();
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java
index e511bbaeb..cbedcf7d9 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLCore.java
@@ -1,98 +1,98 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-/**
- * The Enumeration SAMLCore.
- *
- * @author fjquevedo
- */
-
-public enum SAMLCore {
-
- /** The consent authentication request. */
- CONSENT_AUTHN_REQ("consentAuthnRequest"),
-
- /** The consent authentication response. */
- CONSENT_AUTHN_RES("consentAuthnResponse"),
-
- /** The FORC e_ auth n_ tag. */
- FORCE_AUTHN_TAG("forceAuthN"),
-
- /** The I s_ passiv e_ tag. */
- IS_PASSIVE_TAG("isPassive"),
-
- /** The FORMA t_ entity. */
- FORMAT_ENTITY("formatEntity"),
-
- /** The FRIENDLY name. */
- FRIENDLY_NAME("friendlyName"),
-
- /** The IS_REQUIRED AN ATTRIBUTE */
- IS_REQUIRED("isRequired"),
-
- /** The PRO t_ bindin g_ tag. */
- PROT_BINDING_TAG("protocolBinding"),
-
- /** The ASSER t_ con s_ tag. */
- ASSERT_CONS_TAG("assertionConsumerServiceURL"),
-
- /** The REQUESTE r_ tag. */
- REQUESTER_TAG("requester"),
-
- /** The RESPONDE r_ tag. */
- RESPONDER_TAG("responder"),
-
- /** The STOR k10_ ns. */
- STORK10_NS("urn:eu:stork:names:tc:STORK:1.0:assertion"),
-
- /** The STOR k10 p_ ns. */
- STORK10P_NS("urn:eu:stork:names:tc:STORK:1.0:protocol"),
-
- /** The STOR k10_ prefix. */
- STORK10_PREFIX("stork"),
-
- /** The STOR k10 p_ prefix. */
- STORK10P_PREFIX("storkp"),
-
- /** The STOR k10_ bas e_ uri. */
- STORK10_BASE_URI("http://www.stork.gov.eu/1.0/"),
-
- /** The ON e_ tim e_ use. */
- ONE_TIME_USE("oneTimeUse");
-
- /** The value. */
- private String value;
-
- /**
- * Instantiates a new sAML core.
- *
- * @param fullName the full name
- */
- private SAMLCore(final String fullName) {
- this.value = fullName;
- }
-
- /**
- * Gets the value.
- *
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+/**
+ * The Enumeration SAMLCore.
+ *
+ * @author fjquevedo
+ */
+
+public enum SAMLCore {
+
+ /** The consent authentication request. */
+ CONSENT_AUTHN_REQ("consentAuthnRequest"),
+
+ /** The consent authentication response. */
+ CONSENT_AUTHN_RES("consentAuthnResponse"),
+
+ /** The FORC e_ auth n_ tag. */
+ FORCE_AUTHN_TAG("forceAuthN"),
+
+ /** The I s_ passiv e_ tag. */
+ IS_PASSIVE_TAG("isPassive"),
+
+ /** The FORMA t_ entity. */
+ FORMAT_ENTITY("formatEntity"),
+
+ /** The FRIENDLY name. */
+ FRIENDLY_NAME("friendlyName"),
+
+ /** The IS_REQUIRED AN ATTRIBUTE */
+ IS_REQUIRED("isRequired"),
+
+ /** The PRO t_ bindin g_ tag. */
+ PROT_BINDING_TAG("protocolBinding"),
+
+ /** The ASSER t_ con s_ tag. */
+ ASSERT_CONS_TAG("assertionConsumerServiceURL"),
+
+ /** The REQUESTE r_ tag. */
+ REQUESTER_TAG("requester"),
+
+ /** The RESPONDE r_ tag. */
+ RESPONDER_TAG("responder"),
+
+ /** The STOR k10_ ns. */
+ STORK10_NS("urn:eu:stork:names:tc:STORK:1.0:assertion"),
+
+ /** The STOR k10 p_ ns. */
+ STORK10P_NS("urn:eu:stork:names:tc:STORK:1.0:protocol"),
+
+ /** The STOR k10_ prefix. */
+ STORK10_PREFIX("stork"),
+
+ /** The STOR k10 p_ prefix. */
+ STORK10P_PREFIX("storkp"),
+
+ /** The STOR k10_ bas e_ uri. */
+ STORK10_BASE_URI("http://www.stork.gov.eu/1.0/"),
+
+ /** The ON e_ tim e_ use. */
+ ONE_TIME_USE("oneTimeUse");
+
+ /** The value. */
+ private String value;
+
+ /**
+ * Instantiates a new sAML core.
+ *
+ * @param fullName the full name
+ */
+ private SAMLCore(final String fullName) {
+ this.value = fullName;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java
index b382646be..e846983d8 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SAMLEngineSignI.java
@@ -1,88 +1,88 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import java.security.KeyStore;
-import java.security.cert.X509Certificate;
-
-import org.opensaml.common.SAMLObject;
-import org.opensaml.common.SignableSAMLObject;
-
-import eu.stork.peps.exceptions.SAMLEngineException;
-
-/**
- * The Interface SAMLEngineSignI.
- *
- * @author fjquevedo
- */
-public interface SAMLEngineSignI {
-
- /**
- * Sign.
- *
- * @param tokenSaml the token SAML
- *
- * @return the sAML object
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- SAMLObject sign(SignableSAMLObject tokenSaml) throws SAMLEngineException;
-
- /**
- * Gets the certificate.
- *
- * @return the certificate
- */
- X509Certificate getCertificate();
-
- /**
- * Gets the trustStore used when validating SAMLTokens
- *
- * @return the trustStore
- *
- */
- KeyStore getTrustStore();
-
- /**
- * Validate signature.
- *
- * @param tokenSaml the token SAML
- *
- * @return the sAML object
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- SAMLObject validateSignature(SignableSAMLObject tokenSaml)
- throws SAMLEngineException;
-
- /**
- * Initialize the signature module.
- *
- * @param fileConf the configuration file.
- *
- * @throws SAMLEngineException the STORKSAML engine runtime
- * exception
- */
- void init(String fileConf) throws SAMLEngineException;
-
- /**
- * Load cryptographic service provider.
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- void loadCryptServiceProvider() throws SAMLEngineException;
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Interface SAMLEngineSignI.
+ *
+ * @author fjquevedo
+ */
+public interface SAMLEngineSignI {
+
+ /**
+ * Sign.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ SAMLObject sign(SignableSAMLObject tokenSaml) throws SAMLEngineException;
+
+ /**
+ * Gets the certificate.
+ *
+ * @return the certificate
+ */
+ X509Certificate getCertificate();
+
+ /**
+ * Gets the trustStore used when validating SAMLTokens
+ *
+ * @return the trustStore
+ *
+ */
+ KeyStore getTrustStore();
+
+ /**
+ * Validate signature.
+ *
+ * @param tokenSaml the token SAML
+ *
+ * @return the sAML object
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ SAMLObject validateSignature(SignableSAMLObject tokenSaml)
+ throws SAMLEngineException;
+
+ /**
+ * Initialize the signature module.
+ *
+ * @param fileConf the configuration file.
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ void init(String fileConf) throws SAMLEngineException;
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ void loadCryptServiceProvider() throws SAMLEngineException;
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java
index 9ace6d37c..9510bf790 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPApplication.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface SPApplication.
- *
- * @author fjquevedo
- */
-public interface SPApplication extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "spApplication";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "spApplicationType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /**
- * Gets the service provider application.
- *
- * @return the service provider application
- */
- String getSPApplication();
-
- /**
- * Sets the service provider application.
- *
- * @param spApplication the new service provider application
- */
- void setSPApplication(String spApplication);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPApplication.
+ *
+ * @author fjquevedo
+ */
+public interface SPApplication extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spApplication";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spApplicationType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return the service provider application
+ */
+ String getSPApplication();
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param spApplication the new service provider application
+ */
+ void setSPApplication(String spApplication);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java
index 569ea48c2..829ace878 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPCountry.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface SPCountry.
- *
- * @author fjquevedo
- */
-public interface SPCountry extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "spCountry";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "spCountryType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /**
- * Gets the service provider country.
- *
- * @return the service provider country
- */
- String getSPCountry();
-
- /**
- * Sets the service provider country.
- *
- * @param spCountry the new service provider country
- */
- void setSPCountry(String spCountry);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPCountry.
+ *
+ * @author fjquevedo
+ */
+public interface SPCountry extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spCountry";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spCountryType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider country.
+ *
+ * @return the service provider country
+ */
+ String getSPCountry();
+
+ /**
+ * Sets the service provider country.
+ *
+ * @param spCountry the new service provider country
+ */
+ void setSPCountry(String spCountry);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java
index c0cf02ad0..bd13f6dbf 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPID.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossBorderShare.
- * @author iinigo
- */
-public interface SPID extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "SPID";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "SPIDType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /**
- * Gets the SP ID.
- *
- * @return the SP ID
- */
- String getSPID();
-
-
- /**
- * Sets the SP ID.
- *
- * @param SPID the new SP ID
- */
- void setSPID(String newSPID);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author iinigo
+ */
+public interface SPID extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "SPID";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "SPIDType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return the SP ID
+ */
+ String getSPID();
+
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param SPID the new SP ID
+ */
+ void setSPID(String newSPID);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java
index 34ba9c9c5..bc870c2cc 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInformation.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossBorderShare.
- * @author iinigo
- */
-public interface SPInformation extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "SPInformation";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "SPInformationType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /**
- * Gets the SP Id.
- *
- * @return the SP Id
- */
- SPID getSPID();
-
-
- /**
- * Sets the SP Id.
- *
- * @param newSPId the new SP Id
- */
- void setSPID(SPID newSPID);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ * @author iinigo
+ */
+public interface SPInformation extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "SPInformation";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "SPInformationType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /**
+ * Gets the SP Id.
+ *
+ * @return the SP Id
+ */
+ SPID getSPID();
+
+
+ /**
+ * Sets the SP Id.
+ *
+ * @param newSPId the new SP Id
+ */
+ void setSPID(SPID newSPID);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java
index 33dad474b..add45023c 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPInstitution.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface EIDCrossBorderShare.
- *
- * @author fjquevedo
- */
-public interface SPInstitution extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "spInstitution";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "spInstitutionType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /**
- * Gets the service provider institution.
- *
- * @return the service provider institution
- */
- String getSPInstitution();
-
- /**
- * Sets the service provider institution.
- *
- * @param spInstitution the new service provider institution
- */
- void setSPInstitution(String spInstitution);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface EIDCrossBorderShare.
+ *
+ * @author fjquevedo
+ */
+public interface SPInstitution extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spInstitution";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spInstitutionType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return the service provider institution
+ */
+ String getSPInstitution();
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param spInstitution the new service provider institution
+ */
+ void setSPInstitution(String spInstitution);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java
index 1f49a4015..8322a0d47 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/SPSector.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface SPSector.
- *
- * @author fjquevedo
- */
-public interface SPSector extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "spSector";
-
- /** The Constant DEFAULT_ELEMENT_NAME. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /** The Constant TYPE_LOCAL_NAME. */
- String TYPE_LOCAL_NAME = "spSectorType";
-
- /** The Constant TYPE_NAME. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10_PREFIX.getValue());
-
- /**
- * Gets the service provider sector.
- *
- * @return the service provider sector
- */
- String getSPSector();
-
- /**
- * Sets the service provider sector.
- *
- * @param spSector the new service provider sector
- */
- void setSPSector(String spSector);
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface SPSector.
+ *
+ * @author fjquevedo
+ */
+public interface SPSector extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "spSector";
+
+ /** The Constant DEFAULT_ELEMENT_NAME. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /** The Constant TYPE_LOCAL_NAME. */
+ String TYPE_LOCAL_NAME = "spSectorType";
+
+ /** The Constant TYPE_NAME. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10_PREFIX.getValue());
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return the service provider sector
+ */
+ String getSPSector();
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param spSector the new service provider sector
+ */
+ void setSPSector(String spSector);
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java
index 19c71dd74..4c314ae68 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/STORKSAMLCore.java
@@ -1,508 +1,508 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import java.util.Properties;
-
-import org.apache.commons.lang.StringUtils;
-import org.opensaml.common.xml.SAMLConstants;
-import org.opensaml.saml2.core.NameIDType;
-import org.opensaml.saml2.core.RequestAbstractType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eu.stork.peps.exceptions.SAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * The Class SAMLCore.
- *
- * @author fjquevedo
- */
-public final class STORKSAMLCore {
-
- /** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(STORKSAMLCore.class.getName());
-
- /** The consent authentication request. */
- private String consentAuthnReq = null;
-
- /** The consent authentication response. */
- private String consentAuthnResp = null;
-
- /** The id cross border share. */
- private String eIDCrossBordShare = null;
-
- /** The e id cross sect share. */
- private String eIDCrossSectShare = null;
-
- /** The e id sector share. */
- private String eIDSectorShare = null;
-
- /** The format entity. */
- private String formatEntity = null;
-
- /** The friendly name. */
- private boolean friendlyName = false;
-
- /** The IP validation. */
- private boolean ipValidation = false;
-
- /** The one time use. */
- private boolean oneTimeUse = true;
-
- /** The protocol binding. */
- private String protocolBinding = null;
-
- /** The requester. */
- private String requester = null;
-
-
- /** The responder. */
- private String responder = null;
-
- /** The SAML core properties. */
- private Properties samlCoreProp = null;
-
- /** The time not on or after. */
- private Integer timeNotOnOrAfter = null;
-
- /** The is required parameter. */
- private boolean isRequired = true;
-
- private static final String SAML_ENGINE_LITERAL = "SamlEngine.xml: ";
-
- /**
- * Gets the isRequired.
- *
- * @return the isRequired
- */
- public boolean isRequired() {
- return isRequired;
- }
-
- /**
- * Sets the isRequired.
- *
- * @param isRequired the required.
- */
- public void setRequired(boolean isRequired) {
- this.isRequired = isRequired;
- }
-
- /**
- * Instantiates a new sAML core.
- *
- * @param instance the instance
- */
- public STORKSAMLCore(final Properties instance) {
- loadConfiguration(instance);
- }
-
- /**
- * Gets the consent.
- *
- * @return the consent
- */
- public String getConsentAuthnRequest() {
- return consentAuthnReq;
- }
-
- /**
- * Gets the consent authentication response.
- *
- * @return the consent authentication response.
- */
- public String getConsentAuthnResp() {
- return consentAuthnResp;
- }
-
- /**
- * Gets the consent authentication response.
- *
- * @return the consent authentication response
- */
- public String getConsentAuthnResponse() {
- return consentAuthnResp;
- }
-
- /**
- * Gets the format entity.
- *
- * @return the format entity
- */
- public String getFormatEntity() {
- return formatEntity;
- }
-
- /**
- * Gets the property.
- *
- * @param key the key
- *
- * @return the property
- */
- public String getProperty(final String key) {
- return samlCoreProp.getProperty(key);
- }
-
- /**
- * Gets the protocol binding.
- *
- * @return the protocol binding
- */
- public String getProtocolBinding() {
- return protocolBinding;
- }
-
- /**
- * Gets the requester.
- *
- * @return the requester
- */
- public String getRequester() {
- return requester;
- }
-
- /**
- * Gets the responder.
- *
- * @return the responder
- */
- public String getResponder() {
- return responder;
- }
-
- /**
- * Gets the time not on or after.
- *
- * @return the time not on or after
- */
- public Integer getTimeNotOnOrAfter() {
- return timeNotOnOrAfter;
- }
-
- /**
- * Checks if is e id cross border share.
- *
- * @return true, if is e id cross border share
- */
- public String iseIDCrossBorderShare() {
- return eIDCrossBordShare;
- }
-
- /**
- * Checks if is e id cross border share.
- *
- * @return true, if is e id cross border share
- */
- public String iseIDCrossBordShare() {
- return eIDCrossBordShare;
- }
-
- /**
- * Checks if is e id cross sector share.
- *
- * @return true, if is e id cross sector share
- */
- public String iseIDCrossSectorShare() {
- return eIDCrossSectShare;
- }
-
- /**
- * Checks if is e id cross sect share.
- *
- * @return true, if is e id cross sect share
- */
- public String iseIDCrossSectShare() {
- return eIDCrossSectShare;
- }
-
- /**
- * Checks if is e id sector share.
- *
- * @return true, if is e id sector share
- */
- public String iseIDSectorShare() {
- return eIDSectorShare;
- }
-
- /**
- * Checks if is friendly name.
- *
- * @return true, if checks if is friendly name
- */
- public boolean isFriendlyName() {
- return friendlyName;
- }
-
- /**
- * Checks if is IP validation.
- *
- * @return true, if is IP validation
- */
- public boolean isIpValidation() {
- return ipValidation;
- }
-
- /**
- * Checks if is one time use.
- *
- * @return true, if is one time use
- */
- public boolean isOneTimeUse() {
- return oneTimeUse;
- }
-
- /**
- * Method that loads the configuration file for the SAML Engine.
- *
- * @param instance the instance of the Engine properties.
- */
- private void loadConfiguration(final Properties instance) {
-
- try {
- LOGGER.info("SAMLCore: Loading SAMLEngine properties.");
-
- samlCoreProp = instance;
-
- final String parameter = samlCoreProp
- .getProperty(SAMLCore.FORMAT_ENTITY.getValue());
-
- if ("entity".equalsIgnoreCase(parameter)) {
- formatEntity = NameIDType.ENTITY;
- }
-
- friendlyName = Boolean.valueOf(samlCoreProp
- .getProperty(SAMLCore.FRIENDLY_NAME.getValue()));
-
- String isRequiredValue = samlCoreProp.
- getProperty(SAMLCore.IS_REQUIRED.getValue());
- if (isRequiredValue != null) {
- isRequired = Boolean.valueOf(isRequiredValue);
- }
-
- eIDSectorShare = samlCoreProp
- .getProperty("eIDSectorShare");
- eIDCrossSectShare = samlCoreProp
- .getProperty("eIDCrossSectorShare");
- eIDCrossBordShare = samlCoreProp
- .getProperty("eIDCrossBorderShare");
-
- ipValidation = Boolean.valueOf(samlCoreProp
- .getProperty("ipAddrValidation"));
-
- final String oneTimeUseProp = samlCoreProp
- .getProperty(SAMLCore.ONE_TIME_USE.getValue());
-
- if (StringUtils.isNotBlank(oneTimeUseProp)) {
- oneTimeUse = Boolean.valueOf(oneTimeUseProp);
- }
-
- // Protocol Binding
- loadProtocolBiding();
-
- // Consent Authentication Request
- consentAuthnReq = samlCoreProp
- .getProperty(SAMLCore.CONSENT_AUTHN_REQ.getValue());
-
- if ("unspecified".equalsIgnoreCase(consentAuthnReq)) {
- consentAuthnReq = RequestAbstractType.UNSPECIFIED_CONSENT;
- }
-
- loadConsentAuthResp();
-
- timeNotOnOrAfter = Integer.valueOf(samlCoreProp
- .getProperty("timeNotOnOrAfter"));
-
- if (timeNotOnOrAfter.intValue() < 0) {
- LOGGER.error(SAML_ENGINE_LITERAL + "timeNotOnOrAfter"
- + " is negative number.");
-
- throw new SAMLEngineException(SAML_ENGINE_LITERAL
- + "timeNotOnOrAfter" + " is negative number.");
- }
-
- requester = samlCoreProp.getProperty(SAMLCore.REQUESTER_TAG.getValue());
- responder = samlCoreProp.getProperty(SAMLCore.RESPONDER_TAG.getValue());
-
- } catch (SAMLEngineException e) {
- LOGGER.error("SAMLCore: error loadConfiguration. ", e);
- throw new STORKSAMLEngineRuntimeException(e);
- } catch (RuntimeException e) {
- LOGGER.error("SAMLCore: error loadConfiguration. ", e);
- throw new STORKSAMLEngineRuntimeException(e);
- }
- }
-
- /**
- * Load consent authentication response.
- */
- private void loadConsentAuthResp() {
- // Consent Authentication Response
- consentAuthnResp = samlCoreProp
- .getProperty(SAMLCore.CONSENT_AUTHN_RES.getValue());
-
- if ("obtained".equalsIgnoreCase(consentAuthnResp)) {
- consentAuthnResp = RequestAbstractType.OBTAINED_CONSENT;
- } else if ("prior".equalsIgnoreCase(consentAuthnResp)) {
- consentAuthnResp = RequestAbstractType.PRIOR_CONSENT;
- } else if ("curent-implicit".equalsIgnoreCase(consentAuthnResp)) {
- consentAuthnResp =
- "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
- } else if ("curent-explicit".equalsIgnoreCase(consentAuthnResp)) {
- consentAuthnResp =
- "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
- } else if ("unspecified".equalsIgnoreCase(consentAuthnResp)) {
- consentAuthnResp = RequestAbstractType.UNSPECIFIED_CONSENT;
- }
- }
-
- /**
- * Load protocol biding.
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- private void loadProtocolBiding() throws SAMLEngineException {
- // Protocol Binding
- protocolBinding = samlCoreProp.getProperty(SAMLCore.PROT_BINDING_TAG.getValue());
-
- if (StringUtils.isBlank(protocolBinding)) {
- LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
- + " it's mandatory.");
- throw new SAMLEngineException(SAML_ENGINE_LITERAL
- + SAMLCore.PROT_BINDING_TAG + " it's mandatory.");
- } else if (protocolBinding.equalsIgnoreCase("HTTP-POST")) {
- protocolBinding = SAMLConstants.SAML2_POST_BINDING_URI;
- } else {
- LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
- + " it's not supporting.");
-
- throw new SAMLEngineException(SAML_ENGINE_LITERAL
- + SAMLCore.PROT_BINDING_TAG + " it's not supporting.");
- }
- }
-
- /**
- * Sets the consent authentication response.
- *
- * @param newConsAuthnResp the new consent authentication response
- */
- public void setConsentAuthnResp(final String newConsAuthnResp) {
- this.consentAuthnResp = newConsAuthnResp;
- }
-
- /**
- * Sets an eID that can be shared outside of the Service Provider’s member state.
- *
- * @param newEIDCrossBord the new eid cross border share
- */
- public void setEIDCrossBordShare(final String newEIDCrossBord) {
- this.eIDCrossBordShare = newEIDCrossBord;
- }
-
- /**
- * Sets an eID that can be shared outside of the Service Provider’s sector.
- *
- * @param newEIDCrossSect the new eid cross sect share
- */
- public void setEIDCrossSectShare(final String newEIDCrossSect) {
- this.eIDCrossSectShare = newEIDCrossSect;
- }
-
- /**
- * Sets an eID that can be shared within the Service Provider’s sector.
- *
- * @param newEIDSectorShare the new eid sector share
- */
- public void seteIDSectorShare(final String newEIDSectorShare) {
- this.eIDSectorShare = newEIDSectorShare;
- }
-
- /**
- * Sets the format entity.
- *
- * @param newFormatEntity the new format entity
- */
- public void setFormatEntity(final String newFormatEntity) {
- this.formatEntity = newFormatEntity;
- }
-
- /**
- * Sets the friendly name.
- *
- * @param newFriendlyName the new friendly name
- */
- public void setFriendlyName(final boolean newFriendlyName) {
- this.friendlyName = newFriendlyName;
- }
-
- /**
- * Sets the IP validation.
- *
- * @param newIpValidation the new IP validation
- */
- public void setIpValidation(final boolean newIpValidation) {
- this.ipValidation = newIpValidation;
- }
-
- /**
- * Sets the one time use.
- *
- * @param newOneTimeUse the new one time use
- */
- public void setOneTimeUse(final boolean newOneTimeUse) {
- this.oneTimeUse = newOneTimeUse;
- }
-
- /**
- * Sets the protocol binding.
- *
- * @param newProtBinding the new protocol binding
- */
- public void setProtocolBinding(final String newProtBinding) {
- this.protocolBinding = newProtBinding;
- }
-
- /**
- * Sets the requester.
- *
- * @param newRequester the new requester
- */
- public void setRequester(final String newRequester) {
- this.requester = newRequester;
- }
-
- /**
- * Sets the responder.
- *
- * @param newResponder the new responder
- */
- public void setResponder(final String newResponder) {
- this.responder = newResponder;
- }
-
- /**
- * Sets the time not on or after.
- *
- * @param newTimeNotOnOrAft the new time not on or after
- */
- public void setTimeNotOnOrAfter(final Integer newTimeNotOnOrAft) {
- this.timeNotOnOrAfter = newTimeNotOnOrAft;
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.NameIDType;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class SAMLCore.
+ *
+ * @author fjquevedo
+ */
+public final class STORKSAMLCore {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(STORKSAMLCore.class.getName());
+
+ /** The consent authentication request. */
+ private String consentAuthnReq = null;
+
+ /** The consent authentication response. */
+ private String consentAuthnResp = null;
+
+ /** The id cross border share. */
+ private String eIDCrossBordShare = null;
+
+ /** The e id cross sect share. */
+ private String eIDCrossSectShare = null;
+
+ /** The e id sector share. */
+ private String eIDSectorShare = null;
+
+ /** The format entity. */
+ private String formatEntity = null;
+
+ /** The friendly name. */
+ private boolean friendlyName = false;
+
+ /** The IP validation. */
+ private boolean ipValidation = false;
+
+ /** The one time use. */
+ private boolean oneTimeUse = true;
+
+ /** The protocol binding. */
+ private String protocolBinding = null;
+
+ /** The requester. */
+ private String requester = null;
+
+
+ /** The responder. */
+ private String responder = null;
+
+ /** The SAML core properties. */
+ private Properties samlCoreProp = null;
+
+ /** The time not on or after. */
+ private Integer timeNotOnOrAfter = null;
+
+ /** The is required parameter. */
+ private boolean isRequired = true;
+
+ private static final String SAML_ENGINE_LITERAL = "SamlEngine.xml: ";
+
+ /**
+ * Gets the isRequired.
+ *
+ * @return the isRequired
+ */
+ public boolean isRequired() {
+ return isRequired;
+ }
+
+ /**
+ * Sets the isRequired.
+ *
+ * @param isRequired the required.
+ */
+ public void setRequired(boolean isRequired) {
+ this.isRequired = isRequired;
+ }
+
+ /**
+ * Instantiates a new sAML core.
+ *
+ * @param instance the instance
+ */
+ public STORKSAMLCore(final Properties instance) {
+ loadConfiguration(instance);
+ }
+
+ /**
+ * Gets the consent.
+ *
+ * @return the consent
+ */
+ public String getConsentAuthnRequest() {
+ return consentAuthnReq;
+ }
+
+ /**
+ * Gets the consent authentication response.
+ *
+ * @return the consent authentication response.
+ */
+ public String getConsentAuthnResp() {
+ return consentAuthnResp;
+ }
+
+ /**
+ * Gets the consent authentication response.
+ *
+ * @return the consent authentication response
+ */
+ public String getConsentAuthnResponse() {
+ return consentAuthnResp;
+ }
+
+ /**
+ * Gets the format entity.
+ *
+ * @return the format entity
+ */
+ public String getFormatEntity() {
+ return formatEntity;
+ }
+
+ /**
+ * Gets the property.
+ *
+ * @param key the key
+ *
+ * @return the property
+ */
+ public String getProperty(final String key) {
+ return samlCoreProp.getProperty(key);
+ }
+
+ /**
+ * Gets the protocol binding.
+ *
+ * @return the protocol binding
+ */
+ public String getProtocolBinding() {
+ return protocolBinding;
+ }
+
+ /**
+ * Gets the requester.
+ *
+ * @return the requester
+ */
+ public String getRequester() {
+ return requester;
+ }
+
+ /**
+ * Gets the responder.
+ *
+ * @return the responder
+ */
+ public String getResponder() {
+ return responder;
+ }
+
+ /**
+ * Gets the time not on or after.
+ *
+ * @return the time not on or after
+ */
+ public Integer getTimeNotOnOrAfter() {
+ return timeNotOnOrAfter;
+ }
+
+ /**
+ * Checks if is e id cross border share.
+ *
+ * @return true, if is e id cross border share
+ */
+ public String iseIDCrossBorderShare() {
+ return eIDCrossBordShare;
+ }
+
+ /**
+ * Checks if is e id cross border share.
+ *
+ * @return true, if is e id cross border share
+ */
+ public String iseIDCrossBordShare() {
+ return eIDCrossBordShare;
+ }
+
+ /**
+ * Checks if is e id cross sector share.
+ *
+ * @return true, if is e id cross sector share
+ */
+ public String iseIDCrossSectorShare() {
+ return eIDCrossSectShare;
+ }
+
+ /**
+ * Checks if is e id cross sect share.
+ *
+ * @return true, if is e id cross sect share
+ */
+ public String iseIDCrossSectShare() {
+ return eIDCrossSectShare;
+ }
+
+ /**
+ * Checks if is e id sector share.
+ *
+ * @return true, if is e id sector share
+ */
+ public String iseIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Checks if is friendly name.
+ *
+ * @return true, if checks if is friendly name
+ */
+ public boolean isFriendlyName() {
+ return friendlyName;
+ }
+
+ /**
+ * Checks if is IP validation.
+ *
+ * @return true, if is IP validation
+ */
+ public boolean isIpValidation() {
+ return ipValidation;
+ }
+
+ /**
+ * Checks if is one time use.
+ *
+ * @return true, if is one time use
+ */
+ public boolean isOneTimeUse() {
+ return oneTimeUse;
+ }
+
+ /**
+ * Method that loads the configuration file for the SAML Engine.
+ *
+ * @param instance the instance of the Engine properties.
+ */
+ private void loadConfiguration(final Properties instance) {
+
+ try {
+ LOGGER.info("SAMLCore: Loading SAMLEngine properties.");
+
+ samlCoreProp = instance;
+
+ final String parameter = samlCoreProp
+ .getProperty(SAMLCore.FORMAT_ENTITY.getValue());
+
+ if ("entity".equalsIgnoreCase(parameter)) {
+ formatEntity = NameIDType.ENTITY;
+ }
+
+ friendlyName = Boolean.valueOf(samlCoreProp
+ .getProperty(SAMLCore.FRIENDLY_NAME.getValue()));
+
+ String isRequiredValue = samlCoreProp.
+ getProperty(SAMLCore.IS_REQUIRED.getValue());
+ if (isRequiredValue != null) {
+ isRequired = Boolean.valueOf(isRequiredValue);
+ }
+
+ eIDSectorShare = samlCoreProp
+ .getProperty("eIDSectorShare");
+ eIDCrossSectShare = samlCoreProp
+ .getProperty("eIDCrossSectorShare");
+ eIDCrossBordShare = samlCoreProp
+ .getProperty("eIDCrossBorderShare");
+
+ ipValidation = Boolean.valueOf(samlCoreProp
+ .getProperty("ipAddrValidation"));
+
+ final String oneTimeUseProp = samlCoreProp
+ .getProperty(SAMLCore.ONE_TIME_USE.getValue());
+
+ if (StringUtils.isNotBlank(oneTimeUseProp)) {
+ oneTimeUse = Boolean.valueOf(oneTimeUseProp);
+ }
+
+ // Protocol Binding
+ loadProtocolBiding();
+
+ // Consent Authentication Request
+ consentAuthnReq = samlCoreProp
+ .getProperty(SAMLCore.CONSENT_AUTHN_REQ.getValue());
+
+ if ("unspecified".equalsIgnoreCase(consentAuthnReq)) {
+ consentAuthnReq = RequestAbstractType.UNSPECIFIED_CONSENT;
+ }
+
+ loadConsentAuthResp();
+
+ timeNotOnOrAfter = Integer.valueOf(samlCoreProp
+ .getProperty("timeNotOnOrAfter"));
+
+ if (timeNotOnOrAfter.intValue() < 0) {
+ LOGGER.error(SAML_ENGINE_LITERAL + "timeNotOnOrAfter"
+ + " is negative number.");
+
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + "timeNotOnOrAfter" + " is negative number.");
+ }
+
+ requester = samlCoreProp.getProperty(SAMLCore.REQUESTER_TAG.getValue());
+ responder = samlCoreProp.getProperty(SAMLCore.RESPONDER_TAG.getValue());
+
+ } catch (SAMLEngineException e) {
+ LOGGER.error("SAMLCore: error loadConfiguration. ", e);
+ throw new STORKSAMLEngineRuntimeException(e);
+ } catch (RuntimeException e) {
+ LOGGER.error("SAMLCore: error loadConfiguration. ", e);
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Load consent authentication response.
+ */
+ private void loadConsentAuthResp() {
+ // Consent Authentication Response
+ consentAuthnResp = samlCoreProp
+ .getProperty(SAMLCore.CONSENT_AUTHN_RES.getValue());
+
+ if ("obtained".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.OBTAINED_CONSENT;
+ } else if ("prior".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.PRIOR_CONSENT;
+ } else if ("curent-implicit".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp =
+ "urn:oasis:names:tc:SAML:2.0:consent:current-implicit";
+ } else if ("curent-explicit".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp =
+ "urn:oasis:names:tc:SAML:2.0:consent:current-explicit";
+ } else if ("unspecified".equalsIgnoreCase(consentAuthnResp)) {
+ consentAuthnResp = RequestAbstractType.UNSPECIFIED_CONSENT;
+ }
+ }
+
+ /**
+ * Load protocol biding.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ private void loadProtocolBiding() throws SAMLEngineException {
+ // Protocol Binding
+ protocolBinding = samlCoreProp.getProperty(SAMLCore.PROT_BINDING_TAG.getValue());
+
+ if (StringUtils.isBlank(protocolBinding)) {
+ LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
+ + " it's mandatory.");
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + SAMLCore.PROT_BINDING_TAG + " it's mandatory.");
+ } else if (protocolBinding.equalsIgnoreCase("HTTP-POST")) {
+ protocolBinding = SAMLConstants.SAML2_POST_BINDING_URI;
+ } else {
+ LOGGER.error(SAML_ENGINE_LITERAL + SAMLCore.PROT_BINDING_TAG
+ + " it's not supporting.");
+
+ throw new SAMLEngineException(SAML_ENGINE_LITERAL
+ + SAMLCore.PROT_BINDING_TAG + " it's not supporting.");
+ }
+ }
+
+ /**
+ * Sets the consent authentication response.
+ *
+ * @param newConsAuthnResp the new consent authentication response
+ */
+ public void setConsentAuthnResp(final String newConsAuthnResp) {
+ this.consentAuthnResp = newConsAuthnResp;
+ }
+
+ /**
+ * Sets an eID that can be shared outside of the Service Provider’s member state.
+ *
+ * @param newEIDCrossBord the new eid cross border share
+ */
+ public void setEIDCrossBordShare(final String newEIDCrossBord) {
+ this.eIDCrossBordShare = newEIDCrossBord;
+ }
+
+ /**
+ * Sets an eID that can be shared outside of the Service Provider’s sector.
+ *
+ * @param newEIDCrossSect the new eid cross sect share
+ */
+ public void setEIDCrossSectShare(final String newEIDCrossSect) {
+ this.eIDCrossSectShare = newEIDCrossSect;
+ }
+
+ /**
+ * Sets an eID that can be shared within the Service Provider’s sector.
+ *
+ * @param newEIDSectorShare the new eid sector share
+ */
+ public void seteIDSectorShare(final String newEIDSectorShare) {
+ this.eIDSectorShare = newEIDSectorShare;
+ }
+
+ /**
+ * Sets the format entity.
+ *
+ * @param newFormatEntity the new format entity
+ */
+ public void setFormatEntity(final String newFormatEntity) {
+ this.formatEntity = newFormatEntity;
+ }
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param newFriendlyName the new friendly name
+ */
+ public void setFriendlyName(final boolean newFriendlyName) {
+ this.friendlyName = newFriendlyName;
+ }
+
+ /**
+ * Sets the IP validation.
+ *
+ * @param newIpValidation the new IP validation
+ */
+ public void setIpValidation(final boolean newIpValidation) {
+ this.ipValidation = newIpValidation;
+ }
+
+ /**
+ * Sets the one time use.
+ *
+ * @param newOneTimeUse the new one time use
+ */
+ public void setOneTimeUse(final boolean newOneTimeUse) {
+ this.oneTimeUse = newOneTimeUse;
+ }
+
+ /**
+ * Sets the protocol binding.
+ *
+ * @param newProtBinding the new protocol binding
+ */
+ public void setProtocolBinding(final String newProtBinding) {
+ this.protocolBinding = newProtBinding;
+ }
+
+ /**
+ * Sets the requester.
+ *
+ * @param newRequester the new requester
+ */
+ public void setRequester(final String newRequester) {
+ this.requester = newRequester;
+ }
+
+ /**
+ * Sets the responder.
+ *
+ * @param newResponder the new responder
+ */
+ public void setResponder(final String newResponder) {
+ this.responder = newResponder;
+ }
+
+ /**
+ * Sets the time not on or after.
+ *
+ * @param newTimeNotOnOrAft the new time not on or after
+ */
+ public void setTimeNotOnOrAfter(final Integer newTimeNotOnOrAft) {
+ this.timeNotOnOrAfter = newTimeNotOnOrAft;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java
index 3f812393e..6ee9e0e1b 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/VIDPAuthenticationAttributes.java
@@ -1,72 +1,72 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.SAMLObject;
-
-/**
- * The Interface VIDPAuthenticationAttributes.
- *
- * @author fjquevedo
- */
-public interface VIDPAuthenticationAttributes extends SAMLObject {
-
- /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
- String DEF_LOCAL_NAME = "VIDPAuthenticationAttributes";
-
- /** Default element name. */
- QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
- /** Local name of the XSI type. */
- String TYPE_LOCAL_NAME = "VIDPAuthenticationAttributesType";
-
- /** QName of the XSI type. */
- QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
- SAMLCore.STORK10P_PREFIX.getValue());
-
-
- /**
- * Gets the citizen country code.
- *
- * @return the citizen country code
- */
- CitizenCountryCode getCitizenCountryCode();
-
- /**
- * Sets the citizen country code.
- *
- * @param newCitizenCountryCode the new citizen country code
- */
- void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode);
-
- /**
- * Gets the SP information
- *
- * @return the SP information
- */
- SPInformation getSPInformation();
-
- /**
- * Sets the SP information
- *
- * @param newSPInformation the new SPInformation
- */
- void setSPInformation(SPInformation newSPInformation);
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+
+/**
+ * The Interface VIDPAuthenticationAttributes.
+ *
+ * @author fjquevedo
+ */
+public interface VIDPAuthenticationAttributes extends SAMLObject {
+
+ /** The Constant DEFAULT_ELEMENT_LOCAL_NAME. */
+ String DEF_LOCAL_NAME = "VIDPAuthenticationAttributes";
+
+ /** Default element name. */
+ QName DEF_ELEMENT_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), DEF_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+ /** Local name of the XSI type. */
+ String TYPE_LOCAL_NAME = "VIDPAuthenticationAttributesType";
+
+ /** QName of the XSI type. */
+ QName TYPE_NAME = new QName(SAMLCore.STORK10P_NS.getValue(), TYPE_LOCAL_NAME,
+ SAMLCore.STORK10P_PREFIX.getValue());
+
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ CitizenCountryCode getCitizenCountryCode();
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ */
+ void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode);
+
+ /**
+ * Gets the SP information
+ *
+ * @return the SP information
+ */
+ SPInformation getSPInformation();
+
+ /**
+ * Sets the SP information
+ *
+ * @param newSPInformation the new SPInformation
+ */
+ void setSPInformation(SPInformation newSPInformation);
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java
index 74840e135..2d9039d4c 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesBuilder.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
-
-/**
- * The Class AuthenticationAttributesBuilder.
- *
- * @author fjquevedo
- */
-public class AuthenticationAttributesBuilder extends
- AbstractSAMLObjectBuilder<AuthenticationAttributes> {
-
-
-
- /**
- * Builds the object.
- *
- * @return the authentication attributes
- */
- public final AuthenticationAttributes buildObject() {
- return buildObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
- }
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace URI
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- *
- * @return the authentication attributes
- */
- public final AuthenticationAttributes buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new AuthenticationAttributesImpl(namespaceURI, localName,
- namespacePrefix);
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+
+/**
+ * The Class AuthenticationAttributesBuilder.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesBuilder extends
+ AbstractSAMLObjectBuilder<AuthenticationAttributes> {
+
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the authentication attributes
+ */
+ public final AuthenticationAttributes buildObject() {
+ return buildObject(AuthenticationAttributes.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace URI
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ *
+ * @return the authentication attributes
+ */
+ public final AuthenticationAttributes buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new AuthenticationAttributesImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java
index 1e43e7ec3..e0de20f7d 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesImpl.java
@@ -1,109 +1,109 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSignableSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
-import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class AuthenticationAttributesImpl.
- *
- * @author fjquevedo
- */
-public final class AuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
-AuthenticationAttributes {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationAttributesImpl.class.getName());
-
- /** The indexed children. */
- private VIDPAuthenticationAttributes vIDPAuthenAttr;
-
- /**
- * Instantiates a new authentication attributes implementation.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected AuthenticationAttributesImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- *
- */
- public List<XMLObject> getOrderedChildren() {
- final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
-
- children.add(vIDPAuthenAttr);
-
- if (getSignature() != null) {
- children.add(getSignature());
- }
-
- return Collections.unmodifiableList(children);
- }
-
- /**
- * Gets the signature reference id.
- *
- * @return the signature reference id
- *
- */
- public String getSignatureReferenceID() {
- return null;
- }
-
- /**
- * Gets the vidp authentication attributes.
- *
- * @return the VIDP authentication attributes
- *
- */
- public VIDPAuthenticationAttributes getVIDPAuthenticationAttributes() {
- return vIDPAuthenAttr;
- }
-
- /**
- * Sets the vidp authentication attributes.
- *
- * @param newVIDPAuthenAttr the new vidp authen attr
- *
- */
- public void setVIDPAuthenticationAttributes(
- final VIDPAuthenticationAttributes newVIDPAuthenAttr) {
- vIDPAuthenAttr = prepareForAssignment(this.vIDPAuthenAttr, newVIDPAuthenAttr);
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class AuthenticationAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public final class AuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
+AuthenticationAttributes {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationAttributesImpl.class.getName());
+
+ /** The indexed children. */
+ private VIDPAuthenticationAttributes vIDPAuthenAttr;
+
+ /**
+ * Instantiates a new authentication attributes implementation.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected AuthenticationAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(vIDPAuthenAttr);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Gets the vidp authentication attributes.
+ *
+ * @return the VIDP authentication attributes
+ *
+ */
+ public VIDPAuthenticationAttributes getVIDPAuthenticationAttributes() {
+ return vIDPAuthenAttr;
+ }
+
+ /**
+ * Sets the vidp authentication attributes.
+ *
+ * @param newVIDPAuthenAttr the new vidp authen attr
+ *
+ */
+ public void setVIDPAuthenticationAttributes(
+ final VIDPAuthenticationAttributes newVIDPAuthenAttr) {
+ vIDPAuthenAttr = prepareForAssignment(this.vIDPAuthenAttr, newVIDPAuthenAttr);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java
index 698bf56b9..d31c052fe 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesMarshaller.java
@@ -1,30 +1,27 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-
-/**
- * The Class AuthenticationAttributesMarshaller.
- *
- * @author fjquevedo
- */
-public class AuthenticationAttributesMarshaller extends AbstractSAMLObjectMarshaller {
-
-
-
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class AuthenticationAttributesMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java
index af3e5c234..113214712 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/AuthenticationAttributesUnmarshaller.java
@@ -1,54 +1,54 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.UnmarshallingException;
-
-import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
-
-import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
-
-/**
- * The Class AuthenticationAttributesUnmarshaller.
- *
- * @author fjquevedo
- */
-public class AuthenticationAttributesUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process child element.
- *
- * @param parentObject the parent object
- * @param childObject the child object
- *
- * @throws UnmarshallingException the unmarshalling exception
- *
- */
- protected final void processChildElement(final XMLObject parentObject,
- final XMLObject childObject) throws UnmarshallingException {
- final AuthenticationAttributes attrStatement = (AuthenticationAttributes) parentObject;
-
- if (childObject instanceof VIDPAuthenticationAttributes) {
- attrStatement.setVIDPAuthenticationAttributes((VIDPAuthenticationAttributes) childObject);
- } else {
- super.processChildElement(parentObject, childObject);
- }
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+
+import eu.stork.peps.auth.engine.core.AuthenticationAttributes;
+
+/**
+ * The Class AuthenticationAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class AuthenticationAttributesUnmarshaller extends
+AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final AuthenticationAttributes attrStatement = (AuthenticationAttributes) parentObject;
+
+ if (childObject instanceof VIDPAuthenticationAttributes) {
+ attrStatement.setVIDPAuthenticationAttributes((VIDPAuthenticationAttributes) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java
index 4df8084a9..374398cf1 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CitizenCountryCodeImpl.java
@@ -1,82 +1,82 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.CitizenCountryCode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class CitizenCountryCodeImpl.
- *
- * @author fjquevedo
- */
-public class CitizenCountryCodeImpl extends AbstractSAMLObject implements CitizenCountryCode {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(CitizenCountryCodeImpl.class.getName());
- /** The citizen country code. */
- private String citizenCountryCode;
-
- /**
- * Instantiates a new sP country impl.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected CitizenCountryCodeImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the citizen country code.
- *
- * @return the citizen country code
- */
- public final String getCitizenCountryCode() {
- return citizenCountryCode;
- }
-
- /**
- * Sets the citizen country code.
- *
- * @param newCitizenCountryCode the new citizen country code
- */
- public final void setCitizenCountryCode(final String newCitizenCountryCode) {
- this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class CitizenCountryCodeImpl.
+ *
+ * @author fjquevedo
+ */
+public class CitizenCountryCodeImpl extends AbstractSAMLObject implements CitizenCountryCode {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CitizenCountryCodeImpl.class.getName());
+ /** The citizen country code. */
+ private String citizenCountryCode;
+
+ /**
+ * Instantiates a new sP country impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected CitizenCountryCodeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the citizen country code.
+ *
+ * @return the citizen country code
+ */
+ public final String getCitizenCountryCode() {
+ return citizenCountryCode;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ */
+ public final void setCitizenCountryCode(final String newCitizenCountryCode) {
+ this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java
index ca529d283..48da2a24b 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryBuilder.java
@@ -1,26 +1,26 @@
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-import org.opensaml.common.xml.SAMLConstants;
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-
-public class CustomAttributeQueryBuilder extends AbstractSAMLObjectBuilder<CustomAttributeQuery> {
- /**
- * Constructor.
- */
- public CustomAttributeQueryBuilder() {
-
- }
-
- /** {@inheritDoc} */
- public CustomAttributeQuery buildObject() {
- return buildObject(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
- SAMLConstants.SAML20P_PREFIX);
- }
-
- /** {@inheritDoc} */
- public CustomAttributeQuery buildObject(String namespaceURI, String localName, String namespacePrefix) {
- return new CustomAttributeQueryImpl(namespaceURI, localName, namespacePrefix);
- }
-
-}
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.common.xml.SAMLConstants;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+
+public class CustomAttributeQueryBuilder extends AbstractSAMLObjectBuilder<CustomAttributeQuery> {
+ /**
+ * Constructor.
+ */
+ public CustomAttributeQueryBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public CustomAttributeQuery buildObject() {
+ return buildObject(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public CustomAttributeQuery buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new CustomAttributeQueryImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java
index e485827c8..cbf9221eb 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryImpl.java
@@ -1,65 +1,65 @@
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.saml2.core.Attribute;
-import org.opensaml.saml2.core.impl.SubjectQueryImpl;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.util.XMLObjectChildrenList;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-
-
-public class CustomAttributeQueryImpl extends SubjectQueryImpl implements CustomAttributeQuery {
- /** Attribute child elements. */
- private final XMLObjectChildrenList<Attribute> attributes;
- private String serviceURL;
-
- /**
- * 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 CustomAttributeQueryImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- attributes = new XMLObjectChildrenList<Attribute>(this);
- }
-
- /** {@inheritDoc} */
- public List<Attribute> getAttributes() {
- return attributes;
- }
-
- /** {@inheritDoc} */
- public List<XMLObject> getOrderedChildren() {
- ArrayList<XMLObject> children = new ArrayList<XMLObject>();
-
- if (super.getOrderedChildren() != null) {
- children.addAll(super.getOrderedChildren());
- }
- children.addAll(attributes);
-
- if (children.size() == 0) {
- return null;
- }
-
- return Collections.unmodifiableList(children);
- }
-
- @Override
- public String getAssertionConsumerServiceURL() {
- // TODO Auto-generated method stub
- return this.serviceURL;
- }
-
- @Override
- public void setAssertionConsumerServiceURL(String newServiceUrl) {
- // TODO Auto-generated method stub
- this.serviceURL = newServiceUrl;
- }
-
-}
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.impl.SubjectQueryImpl;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+
+
+public class CustomAttributeQueryImpl extends SubjectQueryImpl implements CustomAttributeQuery {
+ /** Attribute child elements. */
+ private final XMLObjectChildrenList<Attribute> attributes;
+ private String serviceURL;
+
+ /**
+ * 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 CustomAttributeQueryImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ attributes = new XMLObjectChildrenList<Attribute>(this);
+ }
+
+ /** {@inheritDoc} */
+ public List<Attribute> getAttributes() {
+ return attributes;
+ }
+
+ /** {@inheritDoc} */
+ public List<XMLObject> getOrderedChildren() {
+ ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ if (super.getOrderedChildren() != null) {
+ children.addAll(super.getOrderedChildren());
+ }
+ children.addAll(attributes);
+
+ if (children.size() == 0) {
+ return null;
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ @Override
+ public String getAssertionConsumerServiceURL() {
+ // TODO Auto-generated method stub
+ return this.serviceURL;
+ }
+
+ @Override
+ public void setAssertionConsumerServiceURL(String newServiceUrl) {
+ // TODO Auto-generated method stub
+ this.serviceURL = newServiceUrl;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java
index 51b6a20f8..7f2013ca8 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryMarshaller.java
@@ -1,50 +1,50 @@
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.Configuration;
-import org.opensaml.saml2.core.RequestAbstractType;
-import org.opensaml.saml2.core.impl.SubjectQueryMarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
-
-public class CustomAttributeQueryMarshaller extends SubjectQueryMarshaller {
-
- /** {@inheritDoc} */
- protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
- CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
-
- if (req.getVersion() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
- }
-
- if (req.getID() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
- domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
- }
-
- if (req.getVersion() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
- }
-
- if (req.getIssueInstant() != null) {
- String iiStr = Configuration.getSAMLDateFormatter().print(req.getIssueInstant());
- domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
- }
-
- if (req.getDestination() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.DESTINATION_ATTRIB_NAME, req.getDestination());
- }
-
- if (req.getAssertionConsumerServiceURL() != null) {
- domElement.setAttributeNS(null, CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME, req.getAssertionConsumerServiceURL());
- }
-
- if (req.getConsent() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
- }
- }
-
-
-}
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.Configuration;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.saml2.core.impl.SubjectQueryMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+
+public class CustomAttributeQueryMarshaller extends SubjectQueryMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
+ CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
+
+ if (req.getVersion() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
+ }
+
+ if (req.getID() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
+ domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
+ }
+
+ if (req.getVersion() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
+ }
+
+ if (req.getIssueInstant() != null) {
+ String iiStr = Configuration.getSAMLDateFormatter().print(req.getIssueInstant());
+ domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
+ }
+
+ if (req.getDestination() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.DESTINATION_ATTRIB_NAME, req.getDestination());
+ }
+
+ if (req.getAssertionConsumerServiceURL() != null) {
+ domElement.setAttributeNS(null, CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME, req.getAssertionConsumerServiceURL());
+ }
+
+ if (req.getConsent() != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
+ }
+ }
+
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java
index f28ec1fef..e351b65b0 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/CustomAttributeQueryUnmarshaller.java
@@ -1,114 +1,114 @@
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.joda.time.DateTime;
-import org.joda.time.chrono.ISOChronology;
-import org.opensaml.common.SAMLVersion;
-import org.opensaml.common.xml.SAMLConstants;
-import org.opensaml.saml2.core.Attribute;
-import org.opensaml.saml2.core.RequestAbstractType;
-import org.opensaml.saml2.core.impl.SubjectQueryUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
-import org.opensaml.xml.io.UnmarshallingException;
-import org.opensaml.xml.util.DatatypeHelper;
-import org.opensaml.xml.util.XMLHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
-
-public class CustomAttributeQueryUnmarshaller extends SubjectQueryUnmarshaller {
-
- private final Logger log = LoggerFactory.getLogger(AbstractXMLObjectUnmarshaller.class);
- /** {@inheritDoc} */
- protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
- throws UnmarshallingException {
- CustomAttributeQuery query = (CustomAttributeQuery) parentSAMLObject;
-
- if (childSAMLObject instanceof Attribute) {
- query.getAttributes().add((Attribute) childSAMLObject);
- } else {
- super.processChildElement(parentSAMLObject, childSAMLObject);
- }
- }
-
- /** {@inheritDoc} */
- public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
- if (log.isTraceEnabled()) {
- log.trace("Starting to unmarshall DOM element {}", XMLHelper.getNodeQName(domElement));
- }
-
- checkElementIsTarget(domElement);
-
- //String namespaceURI, String elementLocalName, String namespacePrefix
- XMLObject xmlObject = new CustomAttributeQueryImpl(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
- SAMLConstants.SAML20P_PREFIX);
-
- if (log.isTraceEnabled()) {
- log.trace("Unmarshalling attributes of DOM Element {}", XMLHelper.getNodeQName(domElement));
- }
-
- NamedNodeMap attributes = domElement.getAttributes();
- Node attribute;
- for (int i = 0; i < attributes.getLength(); i++) {
- attribute = attributes.item(i);
-
- // These should allows be attribute nodes, but just in case...
- if (attribute.getNodeType() == Node.ATTRIBUTE_NODE) {
- unmarshallAttribute(xmlObject, (Attr) attribute);
- }
- }
-
- if (log.isTraceEnabled()) {
- log.trace("Unmarshalling other child nodes of DOM Element {}", XMLHelper.getNodeQName(domElement));
- }
-
- Node childNode = domElement.getFirstChild();
- while (childNode != null) {
-
- if (childNode.getNodeType() == Node.ATTRIBUTE_NODE) {
- unmarshallAttribute(xmlObject, (Attr) childNode);
- } else if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- unmarshallChildElement(xmlObject, (Element) childNode);
- } else if (childNode.getNodeType() == Node.TEXT_NODE
- || childNode.getNodeType() == Node.CDATA_SECTION_NODE) {
- unmarshallTextContent(xmlObject, (Text) childNode);
- }
-
- childNode = childNode.getNextSibling();
- }
-
- xmlObject.setDOM(domElement);
- return xmlObject;
- }
-
- /** {@inheritDoc} */
- protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
- CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
-
- if (attribute.getLocalName().equals(RequestAbstractType.VERSION_ATTRIB_NAME)) {
- req.setVersion(SAMLVersion.valueOf(attribute.getValue()));
- } else if (attribute.getLocalName().equals(RequestAbstractType.ID_ATTRIB_NAME)) {
- req.setID(attribute.getValue());
- attribute.getOwnerElement().setIdAttributeNode(attribute, true);
- } else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
- && !DatatypeHelper.isEmpty(attribute.getValue())) {
- req.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
- } else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
- req.setDestination(attribute.getValue());
- } else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
- req.setConsent(attribute.getValue());
- } else if (attribute.getLocalName().equals(CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME)) {
- req.setAssertionConsumerServiceURL(attribute.getValue());
- }else {
- super.processAttribute(samlObject, attribute);
- }
- }
-
-}
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.common.SAMLVersion;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.saml2.core.impl.SubjectQueryUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.CustomRequestAbstractType;
+
+public class CustomAttributeQueryUnmarshaller extends SubjectQueryUnmarshaller {
+
+ private final Logger log = LoggerFactory.getLogger(AbstractXMLObjectUnmarshaller.class);
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
+ throws UnmarshallingException {
+ CustomAttributeQuery query = (CustomAttributeQuery) parentSAMLObject;
+
+ if (childSAMLObject instanceof Attribute) {
+ query.getAttributes().add((Attribute) childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
+ if (log.isTraceEnabled()) {
+ log.trace("Starting to unmarshall DOM element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ checkElementIsTarget(domElement);
+
+ //String namespaceURI, String elementLocalName, String namespacePrefix
+ XMLObject xmlObject = new CustomAttributeQueryImpl(SAMLConstants.SAML20P_NS, CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20P_PREFIX);
+
+ if (log.isTraceEnabled()) {
+ log.trace("Unmarshalling attributes of DOM Element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ NamedNodeMap attributes = domElement.getAttributes();
+ Node attribute;
+ for (int i = 0; i < attributes.getLength(); i++) {
+ attribute = attributes.item(i);
+
+ // These should allows be attribute nodes, but just in case...
+ if (attribute.getNodeType() == Node.ATTRIBUTE_NODE) {
+ unmarshallAttribute(xmlObject, (Attr) attribute);
+ }
+ }
+
+ if (log.isTraceEnabled()) {
+ log.trace("Unmarshalling other child nodes of DOM Element {}", XMLHelper.getNodeQName(domElement));
+ }
+
+ Node childNode = domElement.getFirstChild();
+ while (childNode != null) {
+
+ if (childNode.getNodeType() == Node.ATTRIBUTE_NODE) {
+ unmarshallAttribute(xmlObject, (Attr) childNode);
+ } else if (childNode.getNodeType() == Node.ELEMENT_NODE) {
+ unmarshallChildElement(xmlObject, (Element) childNode);
+ } else if (childNode.getNodeType() == Node.TEXT_NODE
+ || childNode.getNodeType() == Node.CDATA_SECTION_NODE) {
+ unmarshallTextContent(xmlObject, (Text) childNode);
+ }
+
+ childNode = childNode.getNextSibling();
+ }
+
+ xmlObject.setDOM(domElement);
+ return xmlObject;
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
+ CustomRequestAbstractType req = (CustomRequestAbstractType) samlObject;
+
+ if (attribute.getLocalName().equals(RequestAbstractType.VERSION_ATTRIB_NAME)) {
+ req.setVersion(SAMLVersion.valueOf(attribute.getValue()));
+ } else if (attribute.getLocalName().equals(RequestAbstractType.ID_ATTRIB_NAME)) {
+ req.setID(attribute.getValue());
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ } else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
+ && !DatatypeHelper.isEmpty(attribute.getValue())) {
+ req.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
+ } else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
+ req.setDestination(attribute.getValue());
+ } else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
+ req.setConsent(attribute.getValue());
+ } else if (attribute.getLocalName().equals(CustomRequestAbstractType.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME)) {
+ req.setAssertionConsumerServiceURL(attribute.getValue());
+ }else {
+ super.processAttribute(samlObject, attribute);
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java
index b939da776..3f4fc633d 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareBuilder.java
@@ -1,52 +1,52 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
-
-/**
- * The Class EIDCrossBorderShareBuilder.
- *
- * @author fjquevedo
- */
-public class EIDCrossBorderShareBuilder extends AbstractSAMLObjectBuilder<EIDCrossBorderShare> {
-
-
- /**
- * Builds the object.
- *
- * @return the identifier cross border share
- */
- public final EIDCrossBorderShare buildObject() {
- return buildObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
- }
-
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace uri
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- * @return the eID cross border share
- */
- public final EIDCrossBorderShare buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new EIDCrossBorderShareImpl(namespaceURI, localName, namespacePrefix);
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+/**
+ * The Class EIDCrossBorderShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareBuilder extends AbstractSAMLObjectBuilder<EIDCrossBorderShare> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the identifier cross border share
+ */
+ public final EIDCrossBorderShare buildObject() {
+ return buildObject(EIDCrossBorderShare.DEF_ELEMENT_NAME);
+ }
+
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID cross border share
+ */
+ public final EIDCrossBorderShare buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDCrossBorderShareImpl(namespaceURI, localName, namespacePrefix);
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java
index 50a997031..3827f5085 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareImpl.java
@@ -1,87 +1,87 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class EIDCrossBorderShareImpl.
- *
- * @author fjquevedo
- */
-public class EIDCrossBorderShareImpl extends AbstractSAMLObject implements
- EIDCrossBorderShare {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossBorderShareImpl.class.getName());
- /** The citizen country code. */
- private String eIDCrossBorderShare;
-
- /**
- * Instantiates a new eID cross border share implementation.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected EIDCrossBorderShareImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
-
- /**
- * Gets the eID cross border share.
- *
- * @return the eID cross border share
- */
- public final String getEIDCrossBorderShare() {
- return eIDCrossBorderShare;
- }
-
-
- /**
- * Sets the eID cross border share.
- *
- * @param newEIDCrossBorderShare the new eID cross border share
- */
- public final void setEIDCrossBorderShare(String newEIDCrossBorderShare) {
- this.eIDCrossBorderShare = prepareForAssignment(this.eIDCrossBorderShare, newEIDCrossBorderShare);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- * {@inheritDoc}
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class EIDCrossBorderShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareImpl extends AbstractSAMLObject implements
+ EIDCrossBorderShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossBorderShareImpl.class.getName());
+ /** The citizen country code. */
+ private String eIDCrossBorderShare;
+
+ /**
+ * Instantiates a new eID cross border share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDCrossBorderShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+
+ /**
+ * Gets the eID cross border share.
+ *
+ * @return the eID cross border share
+ */
+ public final String getEIDCrossBorderShare() {
+ return eIDCrossBorderShare;
+ }
+
+
+ /**
+ * Sets the eID cross border share.
+ *
+ * @param newEIDCrossBorderShare the new eID cross border share
+ */
+ public final void setEIDCrossBorderShare(String newEIDCrossBorderShare) {
+ this.eIDCrossBorderShare = prepareForAssignment(this.eIDCrossBorderShare, newEIDCrossBorderShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ * {@inheritDoc}
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java
index 58fa8af65..c5e113013 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareMarshaller.java
@@ -1,47 +1,47 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
-
-
-/**
- * The Class EIDCrossBorderShareMarshaller.
- *
- * @author fjquevedo
- */
-public class EIDCrossBorderShareMarshaller extends AbstractSAMLObjectMarshaller {
-
-
- /**
- * Marshall element content.
- *
- * @param samlObject the SAML object
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void marshallElementContent(final XMLObject samlObject,
- final Element domElement) throws MarshallingException {
- final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
- XMLHelper.appendTextContent(domElement, crossBorderShare.getEIDCrossBorderShare());
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+
+/**
+ * The Class EIDCrossBorderShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
+ XMLHelper.appendTextContent(domElement, crossBorderShare.getEIDCrossBorderShare());
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java
index 457e70c23..e74bee6ca 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossBorderShareUnmarshaller.java
@@ -1,43 +1,43 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
-
-/**
- * The Class EIDCrossBorderShareUnmarshaller.
- *
- * @author fjquevedo
- */
-public class EIDCrossBorderShareUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
-
- /**
- * Process element content.
- *
- * @param samlObject the SAML object
- * @param elementContent the element content
- */
- protected final void processElementContent(final XMLObject samlObject,
- final String elementContent) {
- final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
- crossBorderShare.setEIDCrossBorderShare(elementContent);
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossBorderShare;
+
+/**
+ * The Class EIDCrossBorderShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossBorderShareUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param elementContent the element content
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String elementContent) {
+ final EIDCrossBorderShare crossBorderShare = (EIDCrossBorderShare) samlObject;
+ crossBorderShare.setEIDCrossBorderShare(elementContent);
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java
index 9683d2ad8..5e91e18fd 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareBuilder.java
@@ -1,52 +1,52 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
-
-/**
- * The Class EIDCrossSectorShareBuilder.
- *
- * @author fjquevedo
- */
-public class EIDCrossSectorShareBuilder extends
- AbstractSAMLObjectBuilder<EIDCrossSectorShare> {
-
- /**
- * Builds the object.
- *
- * @return the eID cross sector share
- */
- public final EIDCrossSectorShare buildObject() {
- return buildObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
- }
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace uri
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- * @return the eID cross sector share implementation
- */
- public final EIDCrossSectorShareImpl buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new EIDCrossSectorShareImpl(namespaceURI, localName,
- namespacePrefix);
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+/**
+ * The Class EIDCrossSectorShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareBuilder extends
+ AbstractSAMLObjectBuilder<EIDCrossSectorShare> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the eID cross sector share
+ */
+ public final EIDCrossSectorShare buildObject() {
+ return buildObject(EIDCrossSectorShare.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID cross sector share implementation
+ */
+ public final EIDCrossSectorShareImpl buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDCrossSectorShareImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java
index 30502f429..7b2ad3dbd 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareImpl.java
@@ -1,89 +1,89 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * The Class EIDCrossSectorShareImpl.
- *
- * @author fjquevedo
- */
-public class EIDCrossSectorShareImpl extends AbstractSAMLObject implements
- EIDCrossSectorShare {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossSectorShareImpl.class.getName());
- /** The citizen country code. */
- private String eIDCrossSectorShare;
-
-
- /**
- * Instantiates a new eID cross sector share implementation.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected EIDCrossSectorShareImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
-
- /**
- * Gets the eID cross sector share.
- *
- * @return the eID cross sector share
- */
- public final String getEIDCrossSectorShare() {
- return eIDCrossSectorShare;
- }
-
-
- /**
- * Sets the eID cross sector share.
- *
- * @param newEIDCrossSectorShare the new eID cross sector share
- */
- public final void setEIDCrossSectorShare(String newEIDCrossSectorShare) {
- this.eIDCrossSectorShare = prepareForAssignment(this.eIDCrossSectorShare, newEIDCrossSectorShare);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The Class EIDCrossSectorShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareImpl extends AbstractSAMLObject implements
+ EIDCrossSectorShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDCrossSectorShareImpl.class.getName());
+ /** The citizen country code. */
+ private String eIDCrossSectorShare;
+
+
+ /**
+ * Instantiates a new eID cross sector share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDCrossSectorShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+
+ /**
+ * Gets the eID cross sector share.
+ *
+ * @return the eID cross sector share
+ */
+ public final String getEIDCrossSectorShare() {
+ return eIDCrossSectorShare;
+ }
+
+
+ /**
+ * Sets the eID cross sector share.
+ *
+ * @param newEIDCrossSectorShare the new eID cross sector share
+ */
+ public final void setEIDCrossSectorShare(String newEIDCrossSectorShare) {
+ this.eIDCrossSectorShare = prepareForAssignment(this.eIDCrossSectorShare, newEIDCrossSectorShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java
index dfd2b81dc..3ee9df698 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareMarshaller.java
@@ -1,46 +1,46 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
-
-
-/**
- * The Class EIDCrossSectorShareMarshaller.
- *
- * @author fjquevedo
- */
-public class EIDCrossSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
-
- /**
- * Marshall element content.
- *
- * @param samlObject the SAML object
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void marshallElementContent(final XMLObject samlObject,
- final Element domElement) throws MarshallingException {
- final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
- XMLHelper.appendTextContent(domElement, crossSectorShare.getEIDCrossSectorShare());
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+
+/**
+ * The Class EIDCrossSectorShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
+ XMLHelper.appendTextContent(domElement, crossSectorShare.getEIDCrossSectorShare());
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java
index 6a9711ca2..94c7689be 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDCrossSectorShareUnmarshaller.java
@@ -1,47 +1,47 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
-
-/**
- * The Class EIDCrossSectorShareUnmarshaller.
- *
- * @author fjquevedo
- */
-public class EIDCrossSectorShareUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process element content.
- *
- * @param samlObject the SAML object
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void processElementContent(final XMLObject samlObject,
- final String domElement) {
-
- final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
- crossSectorShare.setEIDCrossSectorShare(domElement);
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDCrossSectorShare;
+
+/**
+ * The Class EIDCrossSectorShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDCrossSectorShareUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String domElement) {
+
+ final EIDCrossSectorShare crossSectorShare = (EIDCrossSectorShare) samlObject;
+ crossSectorShare.setEIDCrossSectorShare(domElement);
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java
index 75062dc69..230ff3ca4 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareBuilder.java
@@ -1,51 +1,51 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.EIDSectorShare;
-
-/**
- * The Class EIDSectorShareBuilder.
- *
- * @author fjquevedo
- */
-public class EIDSectorShareBuilder extends
- AbstractSAMLObjectBuilder<EIDSectorShare> {
-
- /**
- * Builds the object.
- *
- * @return the eID sector share
- */
- public final EIDSectorShare buildObject() {
- return buildObject(EIDSectorShare.DEF_ELEMENT_NAME);
- }
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace uri
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- * @return the eID sector share
- */
- public final EIDSectorShare buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new EIDSectorShareImpl(namespaceURI, localName, namespacePrefix);
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+/**
+ * The Class EIDSectorShareBuilder.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareBuilder extends
+ AbstractSAMLObjectBuilder<EIDSectorShare> {
+
+ /**
+ * Builds the object.
+ *
+ * @return the eID sector share
+ */
+ public final EIDSectorShare buildObject() {
+ return buildObject(EIDSectorShare.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the eID sector share
+ */
+ public final EIDSectorShare buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new EIDSectorShareImpl(namespaceURI, localName, namespacePrefix);
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java
index c548841f7..9ed726a32 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareImpl.java
@@ -1,85 +1,85 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.EIDSectorShare;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class EIDSectorShareImpl.
- *
- * @author fjquevedo
- */
-public class EIDSectorShareImpl extends AbstractSAMLObject implements
- EIDSectorShare {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(EIDSectorShareImpl.class.getName());
-
- /** The e id sector share. */
- private String eIDSectorShare;
- /**
- * Instantiates a new eID sector share implementation.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected EIDSectorShareImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
- /**
- * Gets the eID sector share.
- *
- * @return the eID sector share
- */
- public final String getEIDSectorShare() {
- return eIDSectorShare;
- }
-
- /**
- * Sets the eID sector share.
- *
- * @param newEIDSectorShare the new eID sector share
- */
- public final void setEIDSectorShare(String newEIDSectorShare) {
- this.eIDSectorShare = prepareForAssignment(this.eIDSectorShare, newEIDSectorShare);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EIDSectorShareImpl.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareImpl extends AbstractSAMLObject implements
+ EIDSectorShare {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EIDSectorShareImpl.class.getName());
+
+ /** The e id sector share. */
+ private String eIDSectorShare;
+ /**
+ * Instantiates a new eID sector share implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected EIDSectorShareImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * Gets the eID sector share.
+ *
+ * @return the eID sector share
+ */
+ public final String getEIDSectorShare() {
+ return eIDSectorShare;
+ }
+
+ /**
+ * Sets the eID sector share.
+ *
+ * @param newEIDSectorShare the new eID sector share
+ */
+ public final void setEIDSectorShare(String newEIDSectorShare) {
+ this.eIDSectorShare = prepareForAssignment(this.eIDSectorShare, newEIDSectorShare);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java
index 87ab23660..0ce449cd1 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareMarshaller.java
@@ -1,46 +1,46 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-import org.opensaml.saml2.core.impl.AbstractNameIDTypeMarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.EIDSectorShare;
-
-/**
- * The Class EIDSectorShareMarshaller.
- *
- * @author fjquevedo
- */
-public class EIDSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
-
- /**
- * Marshall element content.
- *
- * @param samlObject the SAML object
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void marshallElementContent(final XMLObject samlObject,
- final Element domElement) throws MarshallingException {
- final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
- XMLHelper.appendTextContent(domElement, sectorShare.getEIDSectorShare());
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml2.core.impl.AbstractNameIDTypeMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+/**
+ * The Class EIDSectorShareMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallElementContent(final XMLObject samlObject,
+ final Element domElement) throws MarshallingException {
+ final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
+ XMLHelper.appendTextContent(domElement, sectorShare.getEIDSectorShare());
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java
index 9c661813f..f7f00adb9 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/EIDSectorShareUnmarshaller.java
@@ -1,47 +1,47 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.EIDSectorShare;
-
-
-/**
- * The Class EIDSectorShareUnmarshaller.
- *
- * @author fjquevedo
- */
-public class EIDSectorShareUnmarshaller extends AbstractSAMLObjectUnmarshaller {
-
-
- /**
- * Process element content.
- *
- * @param samlObject the SAML object
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void processElementContent(final XMLObject samlObject,
- final String domElement) {
- final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
- sectorShare.setEIDSectorShare(domElement);
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.EIDSectorShare;
+
+
+/**
+ * The Class EIDSectorShareUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class EIDSectorShareUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+
+ /**
+ * Process element content.
+ *
+ * @param samlObject the SAML object
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void processElementContent(final XMLObject samlObject,
+ final String domElement) {
+ final EIDSectorShare sectorShare = (EIDSectorShare) samlObject;
+ sectorShare.setEIDSectorShare(domElement);
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java
index c08986026..46f3bb402 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/QAAAttributeImpl.java
@@ -1,84 +1,84 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class QAAAttributeImpl.
- *
- * @author fjquevedo
- */
-public class QAAAttributeImpl extends AbstractSAMLObject implements
- QAAAttribute {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(QAAAttributeImpl.class.getName());
- /** The quality authentication assurance level. */
- private String qaaLevel;
-
- /**
- * 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 QAAAttributeImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the quality authentication assurance level.
- *
- * @return the quality authentication assurance level
- */
- public final String getQaaLevel() {
- return qaaLevel;
- }
-
- /**
- * Sets the quality authentication assurance level.
- *
- * @param newQaaLevel the new quality authentication assurance level
- */
- public final void setQaaLevel(final String newQaaLevel) {
- this.qaaLevel = prepareForAssignment(this.qaaLevel, newQaaLevel);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class QAAAttributeImpl.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeImpl extends AbstractSAMLObject implements
+ QAAAttribute {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(QAAAttributeImpl.class.getName());
+ /** The quality authentication assurance level. */
+ private String qaaLevel;
+
+ /**
+ * 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 QAAAttributeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the quality authentication assurance level.
+ *
+ * @return the quality authentication assurance level
+ */
+ public final String getQaaLevel() {
+ return qaaLevel;
+ }
+
+ /**
+ * Sets the quality authentication assurance level.
+ *
+ * @param newQaaLevel the new quality authentication assurance level
+ */
+ public final void setQaaLevel(final String newQaaLevel) {
+ this.qaaLevel = prepareForAssignment(this.qaaLevel, newQaaLevel);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java
index 70bd6ac1f..c9881c439 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeBuilder.java
@@ -1,54 +1,54 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-
-/**
- * The Class RequestedAttributeBuilder.
- *
- * @author fjquevedo
- */
-public class RequestedAttributeBuilder extends
- AbstractSAMLObjectBuilder<RequestedAttribute> {
-
-
- /**
- * Builds the object.
- *
- * @return the requested attribute
- */
- public final RequestedAttribute buildObject() {
- return buildObject(RequestedAttribute.DEF_ELEMENT_NAME);
- }
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace uri
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- * @return the requested attribute
- */
- public final RequestedAttribute buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new RequestedAttributeImpl(namespaceURI, localName,
- namespacePrefix);
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+
+/**
+ * The Class RequestedAttributeBuilder.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeBuilder extends
+ AbstractSAMLObjectBuilder<RequestedAttribute> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the requested attribute
+ */
+ public final RequestedAttribute buildObject() {
+ return buildObject(RequestedAttribute.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the requested attribute
+ */
+ public final RequestedAttribute buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new RequestedAttributeImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java
index ad759230a..ac2e8a3ee 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeImpl.java
@@ -1,220 +1,220 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.schema.XSBooleanValue;
-import org.opensaml.xml.util.AttributeMap;
-import org.opensaml.xml.util.XMLObjectChildrenList;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class RequestedAttributeImpl.
- *
- * @author fjquevedo
- */
-public class RequestedAttributeImpl extends AbstractSAMLObject implements
- RequestedAttribute {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(RequestedAttributeImpl.class.getName());
- /**
- * The attribute values.
- */
- private final XMLObjectChildrenList<XMLObject> attributeValues;
-
- /**
- * The friendly name.
- *
- */
- private String friendlyName;
-
- /**
- * The is required.
- */
- private String isRequired;
-
- /**
- * The name.
- *
- */
- private String name;
-
- /**
- * The name format.
- *
- */
- private String nameFormat;
-
- /**
- * The unknown attributes.
- *
- */
- private AttributeMap unknownAttributes;
-
- /**
- * Instantiates a new requested attribute impl.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected RequestedAttributeImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- unknownAttributes = new AttributeMap(this);
- attributeValues = new XMLObjectChildrenList<XMLObject>(this);
- }
-
-
- /**
- * Gets the attribute values.
- *
- * @return the attribute values
- */
- public final List<XMLObject> getAttributeValues() {
- return attributeValues;
- }
-
- /**
- * Gets the friendly name.
- *
- * @return the friendly name.
- */
- public final String getFriendlyName() {
- return friendlyName;
- }
-
-
- /**
- * Gets the checks if is required.
- *
- * @return the boolean if it's required.
- */
- public final String isRequired() {
- return isRequired;
- }
-
-
- /**
- * Gets the is required xs boolean.
- *
- * @return the XSBoolean if it's required.
- */
- public final String getIsRequiredXSBoolean() {
- return isRequired;
- }
-
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public final String getName() {
- return name;
- }
-
-
- /**
- * Gets the name format.
- *
- * @return the name format.
- */
- public final String getNameFormat() {
- return nameFormat;
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the list of XMLObject.
- */
- public final List<XMLObject> getOrderedChildren() {
- final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
- children.addAll(attributeValues);
- return Collections.unmodifiableList(children);
- }
-
- /**
- * Gets the unknown attributes.
- *
- * @return the attribute map
- */
- public final AttributeMap getUnknownAttributes() {
- return unknownAttributes;
- }
-
- /**
- * Sets the friendly name.
- *
- * @param newFriendlyName the new friendly name format
- */
- public final void setFriendlyName(final String newFriendlyName) {
- this.friendlyName = prepareForAssignment(this.friendlyName,
- newFriendlyName);
- }
-
- /**
- * Set new boolean value isRequired.
- * @param newIsRequired then new value
- */
- public final void setIsRequired(final String newIsRequired) {
- isRequired = prepareForAssignment(this.isRequired, newIsRequired);
-
- }
-
- /**
- * Sets the name.
- *
- * @param newName the new name
- */
- public final void setName(final String newName) {
- this.name = prepareForAssignment(this.name, newName);
- }
-
- /**
- * Sets the name format.
- *
- * @param newNameFormat the new name format
- */
- public final void setNameFormat(final String newNameFormat) {
- this.nameFormat = prepareForAssignment(this.nameFormat, newNameFormat);
- }
-
- /**
- * Sets the unknown attributes.
- *
- * @param newUnknownAttr the new unknown attributes
- */
- public final void setUnknownAttributes(final AttributeMap newUnknownAttr) {
- this.unknownAttributes = newUnknownAttr;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.AttributeMap;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RequestedAttributeImpl.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeImpl extends AbstractSAMLObject implements
+ RequestedAttribute {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(RequestedAttributeImpl.class.getName());
+ /**
+ * The attribute values.
+ */
+ private final XMLObjectChildrenList<XMLObject> attributeValues;
+
+ /**
+ * The friendly name.
+ *
+ */
+ private String friendlyName;
+
+ /**
+ * The is required.
+ */
+ private String isRequired;
+
+ /**
+ * The name.
+ *
+ */
+ private String name;
+
+ /**
+ * The name format.
+ *
+ */
+ private String nameFormat;
+
+ /**
+ * The unknown attributes.
+ *
+ */
+ private AttributeMap unknownAttributes;
+
+ /**
+ * Instantiates a new requested attribute impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected RequestedAttributeImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ unknownAttributes = new AttributeMap(this);
+ attributeValues = new XMLObjectChildrenList<XMLObject>(this);
+ }
+
+
+ /**
+ * Gets the attribute values.
+ *
+ * @return the attribute values
+ */
+ public final List<XMLObject> getAttributeValues() {
+ return attributeValues;
+ }
+
+ /**
+ * Gets the friendly name.
+ *
+ * @return the friendly name.
+ */
+ public final String getFriendlyName() {
+ return friendlyName;
+ }
+
+
+ /**
+ * Gets the checks if is required.
+ *
+ * @return the boolean if it's required.
+ */
+ public final String isRequired() {
+ return isRequired;
+ }
+
+
+ /**
+ * Gets the is required xs boolean.
+ *
+ * @return the XSBoolean if it's required.
+ */
+ public final String getIsRequiredXSBoolean() {
+ return isRequired;
+ }
+
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+
+ /**
+ * Gets the name format.
+ *
+ * @return the name format.
+ */
+ public final String getNameFormat() {
+ return nameFormat;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the list of XMLObject.
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+ children.addAll(attributeValues);
+ return Collections.unmodifiableList(children);
+ }
+
+ /**
+ * Gets the unknown attributes.
+ *
+ * @return the attribute map
+ */
+ public final AttributeMap getUnknownAttributes() {
+ return unknownAttributes;
+ }
+
+ /**
+ * Sets the friendly name.
+ *
+ * @param newFriendlyName the new friendly name format
+ */
+ public final void setFriendlyName(final String newFriendlyName) {
+ this.friendlyName = prepareForAssignment(this.friendlyName,
+ newFriendlyName);
+ }
+
+ /**
+ * Set new boolean value isRequired.
+ * @param newIsRequired then new value
+ */
+ public final void setIsRequired(final String newIsRequired) {
+ isRequired = prepareForAssignment(this.isRequired, newIsRequired);
+
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = prepareForAssignment(this.name, newName);
+ }
+
+ /**
+ * Sets the name format.
+ *
+ * @param newNameFormat the new name format
+ */
+ public final void setNameFormat(final String newNameFormat) {
+ this.nameFormat = prepareForAssignment(this.nameFormat, newNameFormat);
+ }
+
+ /**
+ * Sets the unknown attributes.
+ *
+ * @param newUnknownAttr the new unknown attributes
+ */
+ public final void setUnknownAttributes(final AttributeMap newUnknownAttr) {
+ this.unknownAttributes = newUnknownAttr;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java
index 6d0669241..1a14a118a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeMarshaller.java
@@ -1,89 +1,89 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.Map.Entry;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.Configuration;
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-
-/**
- * The Class RequestedAttributeMarshaller.
- *
- * @author fjquevedo
- */
-public class RequestedAttributeMarshaller extends AbstractSAMLObjectMarshaller {
-
- /**
- * Marshall attributes.
- *
- * @param samlElement the SAML element
- * @param domElement the DOM element
- * @throws MarshallingException the marshalling exception
- */
- protected final void marshallAttributes(final XMLObject samlElement,
- final Element domElement) throws MarshallingException {
- final RequestedAttribute requestedAttr = (RequestedAttribute) samlElement;
-
- if (requestedAttr.getName() != null) {
- domElement.setAttributeNS(null,
- RequestedAttribute.NAME_ATTRIB_NAME, requestedAttr
- .getName());
- }
-
- if (requestedAttr.getNameFormat() != null) {
- domElement.setAttributeNS(null,
- RequestedAttribute.NAME_FORMAT_ATTR, requestedAttr
- .getNameFormat());
- }
-
- if (requestedAttr.getFriendlyName() != null) {
- domElement.setAttributeNS(null,
- RequestedAttribute.FRIENDLY_NAME_ATT, requestedAttr
- .getFriendlyName());
- }
-
- if (requestedAttr.getIsRequiredXSBoolean() != null) {
- domElement.setAttributeNS(null,
- RequestedAttribute.IS_REQUIRED_ATTR, requestedAttr
- .getIsRequiredXSBoolean().toString());
- }
-
- Attr attr;
- for (Entry<QName, String> entry : requestedAttr.getUnknownAttributes()
- .entrySet()) {
- attr = XMLHelper.constructAttribute(domElement.getOwnerDocument(),
- entry.getKey());
- attr.setValue(entry.getValue());
- domElement.setAttributeNodeNS(attr);
- if (Configuration.isIDAttribute(entry.getKey())
- || requestedAttr.getUnknownAttributes().isIDAttribute(
- entry.getKey())) {
- attr.getOwnerElement().setIdAttributeNode(attr, true);
- }
- }
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.Configuration;
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+
+/**
+ * The Class RequestedAttributeMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Marshall attributes.
+ *
+ * @param samlElement the SAML element
+ * @param domElement the DOM element
+ * @throws MarshallingException the marshalling exception
+ */
+ protected final void marshallAttributes(final XMLObject samlElement,
+ final Element domElement) throws MarshallingException {
+ final RequestedAttribute requestedAttr = (RequestedAttribute) samlElement;
+
+ if (requestedAttr.getName() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.NAME_ATTRIB_NAME, requestedAttr
+ .getName());
+ }
+
+ if (requestedAttr.getNameFormat() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.NAME_FORMAT_ATTR, requestedAttr
+ .getNameFormat());
+ }
+
+ if (requestedAttr.getFriendlyName() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.FRIENDLY_NAME_ATT, requestedAttr
+ .getFriendlyName());
+ }
+
+ if (requestedAttr.getIsRequiredXSBoolean() != null) {
+ domElement.setAttributeNS(null,
+ RequestedAttribute.IS_REQUIRED_ATTR, requestedAttr
+ .getIsRequiredXSBoolean().toString());
+ }
+
+ Attr attr;
+ for (Entry<QName, String> entry : requestedAttr.getUnknownAttributes()
+ .entrySet()) {
+ attr = XMLHelper.constructAttribute(domElement.getOwnerDocument(),
+ entry.getKey());
+ attr.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attr);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || requestedAttr.getUnknownAttributes().isIDAttribute(
+ entry.getKey())) {
+ attr.getOwnerElement().setIdAttributeNode(attr, true);
+ }
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
index 551f4239d..c07f852d9 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
@@ -1,96 +1,96 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import javax.xml.namespace.QName;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.UnmarshallingException;
-import org.opensaml.xml.schema.XSBooleanValue;
-import org.opensaml.xml.util.XMLHelper;
-import org.w3c.dom.Attr;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import eu.stork.peps.auth.engine.core.SAMLCore;
-
-/**
- * The Class RequestedAttributeUnmarshaller.
- *
- * @author fjquevedo
- */
-public class RequestedAttributeUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process child element.
- *
- * @param parentSAMLObject parent SAMLObject
- * @param childSAMLObject child SAMLObject
- *
- * @throws UnmarshallingException error at unmarshall XML object
- */
- protected final void processChildElement(final XMLObject parentSAMLObject,
- final XMLObject childSAMLObject) throws UnmarshallingException {
-
- final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;
-
- final QName childQName = childSAMLObject.getElementQName();
- if (childQName.getLocalPart().equals("AttributeValue")
- && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
- requestedAttr.getAttributeValues().add(childSAMLObject);
- } else {
- super.processChildElement(parentSAMLObject, childSAMLObject);
- }
- }
-
- /**
- * Process attribute.
- *
- * @param samlObject the SAML object
- * @param attribute the attribute
- * @throws UnmarshallingException the unmarshalling exception
- */
- protected final void processAttribute(final XMLObject samlObject,
- final Attr attribute) throws UnmarshallingException {
-
- final RequestedAttribute requestedAttr = (RequestedAttribute) samlObject;
-
- if (attribute.getLocalName()
- .equals(RequestedAttribute.NAME_ATTRIB_NAME)) {
- requestedAttr.setName(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.NAME_FORMAT_ATTR)) {
- requestedAttr.setNameFormat(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.FRIENDLY_NAME_ATT)) {
- requestedAttr.setFriendlyName(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.IS_REQUIRED_ATTR)) {
- requestedAttr.setIsRequired(attribute
- .getValue());
-
- } else {
- final QName attribQName = XMLHelper.getNodeQName(attribute);
- if (attribute.isId()) {
- requestedAttr.getUnknownAttributes().registerID(attribQName);
- }
- requestedAttr.getUnknownAttributes().put(attribQName,
- attribute.getValue());
- }
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.SAMLCore;
+
+/**
+ * The Class RequestedAttributeUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributeUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentSAMLObject parent SAMLObject
+ * @param childSAMLObject child SAMLObject
+ *
+ * @throws UnmarshallingException error at unmarshall XML object
+ */
+ protected final void processChildElement(final XMLObject parentSAMLObject,
+ final XMLObject childSAMLObject) throws UnmarshallingException {
+
+ final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;
+
+ final QName childQName = childSAMLObject.getElementQName();
+ if (childQName.getLocalPart().equals("AttributeValue")
+ && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
+ requestedAttr.getAttributeValues().add(childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+ /**
+ * Process attribute.
+ *
+ * @param samlObject the SAML object
+ * @param attribute the attribute
+ * @throws UnmarshallingException the unmarshalling exception
+ */
+ protected final void processAttribute(final XMLObject samlObject,
+ final Attr attribute) throws UnmarshallingException {
+
+ final RequestedAttribute requestedAttr = (RequestedAttribute) samlObject;
+
+ if (attribute.getLocalName()
+ .equals(RequestedAttribute.NAME_ATTRIB_NAME)) {
+ requestedAttr.setName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.NAME_FORMAT_ATTR)) {
+ requestedAttr.setNameFormat(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.FRIENDLY_NAME_ATT)) {
+ requestedAttr.setFriendlyName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(
+ RequestedAttribute.IS_REQUIRED_ATTR)) {
+ requestedAttr.setIsRequired(attribute
+ .getValue());
+
+ } else {
+ final QName attribQName = XMLHelper.getNodeQName(attribute);
+ if (attribute.isId()) {
+ requestedAttr.getUnknownAttributes().registerID(attribQName);
+ }
+ requestedAttr.getUnknownAttributes().put(attribQName,
+ attribute.getValue());
+ }
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java
index 138177995..d421c53d2 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesBuilder.java
@@ -1,54 +1,54 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
-
-import eu.stork.peps.auth.engine.core.RequestedAttributes;
-
-/**
- * The Class RequestedAttributesBuilder.
- *
- * @author fjquevedo
- */
-public class RequestedAttributesBuilder extends
- AbstractSAMLObjectBuilder<RequestedAttributes> {
-
-
- /**
- * Builds the object.
- *
- * @return the requested attributes
- */
- public final RequestedAttributes buildObject() {
- return buildObject(RequestedAttributes.DEF_ELEMENT_NAME);
- }
-
- /**
- * Builds the object.
- *
- * @param namespaceURI the namespace uri
- * @param localName the local name
- * @param namespacePrefix the namespace prefix
- * @return the requested attributes
- */
- public final RequestedAttributes buildObject(final String namespaceURI,
- final String localName, final String namespacePrefix) {
- return new RequestedAttributesImpl(namespaceURI, localName,
- namespacePrefix);
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesBuilder.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesBuilder extends
+ AbstractSAMLObjectBuilder<RequestedAttributes> {
+
+
+ /**
+ * Builds the object.
+ *
+ * @return the requested attributes
+ */
+ public final RequestedAttributes buildObject() {
+ return buildObject(RequestedAttributes.DEF_ELEMENT_NAME);
+ }
+
+ /**
+ * Builds the object.
+ *
+ * @param namespaceURI the namespace uri
+ * @param localName the local name
+ * @param namespacePrefix the namespace prefix
+ * @return the requested attributes
+ */
+ public final RequestedAttributes buildObject(final String namespaceURI,
+ final String localName, final String namespacePrefix) {
+ return new RequestedAttributesImpl(namespaceURI, localName,
+ namespacePrefix);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java
index a58a08a05..0a5b37add 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesImpl.java
@@ -1,95 +1,95 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import eu.stork.peps.auth.engine.core.RequestedAttributes;
-
-/**
- * The Class RequestedAttributesImpl.
- *
- * @author fjquevedo
- */
-public class RequestedAttributesImpl extends AbstractSAMLObject implements
- RequestedAttributes {
-
- /**
- * Instantiates a new requested attributes implement.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected RequestedAttributesImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- indexedChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
- }
-
- /** The indexed children. */
- private final IndexedXMLObjectChildrenList<XMLObject> indexedChildren;
-
- /**
- * Gets the indexed children.
- *
- * @return the indexed children
- */
- public final IndexedXMLObjectChildrenList<XMLObject> getIndexedChildren() {
- return indexedChildren;
- }
-
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
-
- final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
-
- children.addAll(indexedChildren);
-
- return Collections.unmodifiableList(children);
-
- }
-
- /**
- * Gets the attributes.
- *
- * @return the attributes
- *
- * @see eu.stork.peps.auth.engine.core.RequestedAttributes#getAttributes()
- */
- @SuppressWarnings("unchecked")
- public final List<RequestedAttribute> getAttributes() {
- return (List<RequestedAttribute>) indexedChildren
- .subList(RequestedAttribute.DEF_ELEMENT_NAME);
- }
-
- @Override
- public int hashCode() {
- throw new UnsupportedOperationException("hashCode method not implemented");
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesImpl extends AbstractSAMLObject implements
+ RequestedAttributes {
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected RequestedAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ indexedChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
+ }
+
+ /** The indexed children. */
+ private final IndexedXMLObjectChildrenList<XMLObject> indexedChildren;
+
+ /**
+ * Gets the indexed children.
+ *
+ * @return the indexed children
+ */
+ public final IndexedXMLObjectChildrenList<XMLObject> getIndexedChildren() {
+ return indexedChildren;
+ }
+
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.addAll(indexedChildren);
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the attributes.
+ *
+ * @return the attributes
+ *
+ * @see eu.stork.peps.auth.engine.core.RequestedAttributes#getAttributes()
+ */
+ @SuppressWarnings("unchecked")
+ public final List<RequestedAttribute> getAttributes() {
+ return (List<RequestedAttribute>) indexedChildren
+ .subList(RequestedAttribute.DEF_ELEMENT_NAME);
+ }
+
+ @Override
+ public int hashCode() {
+ throw new UnsupportedOperationException("hashCode method not implemented");
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java
index 955fe0318..dfc42adf3 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesMarshaller.java
@@ -1,33 +1,33 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
-
-/**
- * The Class RequestedAttributesMarshaller.
- *
- * @author fjquevedo
- */
-public class RequestedAttributesMarshaller extends AbstractSAMLObjectMarshaller {
-
- /**
- * Instantiates a new requested attributes marshaller.
- */
- public RequestedAttributesMarshaller() {
- super();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * The Class RequestedAttributesMarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * Instantiates a new requested attributes marshaller.
+ */
+ public RequestedAttributesMarshaller() {
+ super();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java
index 132d6cc59..41b3afa40 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributesUnmarshaller.java
@@ -1,52 +1,52 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.UnmarshallingException;
-
-import eu.stork.peps.auth.engine.core.RequestedAttribute;
-import eu.stork.peps.auth.engine.core.RequestedAttributes;
-
-/**
- * The Class RequestedAttributesUnmarshaller.
- *
- * @author fjquevedo
- */
-public class RequestedAttributesUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process child element.
- *
- * @param parentObject the parent object
- * @param childObject the child object
- *
- * @throws UnmarshallingException error in unmarshall
- */
- protected final void processChildElement(final XMLObject parentObject,
- final XMLObject childObject) throws UnmarshallingException {
- final RequestedAttributes attrStatement = (RequestedAttributes) parentObject;
-
- if (childObject instanceof RequestedAttribute) {
- attrStatement.getAttributes().add((RequestedAttribute) childObject);
- } else {
- super.processChildElement(parentObject, childObject);
- }
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.RequestedAttribute;
+import eu.stork.peps.auth.engine.core.RequestedAttributes;
+
+/**
+ * The Class RequestedAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class RequestedAttributesUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException error in unmarshall
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final RequestedAttributes attrStatement = (RequestedAttributes) parentObject;
+
+ if (childObject instanceof RequestedAttribute) {
+ attrStatement.getAttributes().add((RequestedAttribute) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java
index 6bb631a74..0a428a521 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPApplicationImpl.java
@@ -1,84 +1,84 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class SPApplicationImpl.
- *
- * @author fjquevedo
- */
-public class SPApplicationImpl extends AbstractSAMLObject implements
- SPApplication {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SPApplicationImpl.class.getName());
- /** The service provider application. */
- private String spApplication;
-
- /**
- * Instantiates a new service provider application.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPApplicationImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the service provider application.
- *
- * @return the service provider application
- */
- public final String getSPApplication() {
- return spApplication;
- }
-
- /**
- * Sets the service provider application.
- *
- * @param newSpApplication the new service provider application
- */
- public final void setSPApplication(final String newSpApplication) {
- this.spApplication = prepareForAssignment(this.spApplication,
- newSpApplication);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPApplication;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPApplicationImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPApplicationImpl extends AbstractSAMLObject implements
+ SPApplication {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPApplicationImpl.class.getName());
+ /** The service provider application. */
+ private String spApplication;
+
+ /**
+ * Instantiates a new service provider application.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPApplicationImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider application.
+ *
+ * @return the service provider application
+ */
+ public final String getSPApplication() {
+ return spApplication;
+ }
+
+ /**
+ * Sets the service provider application.
+ *
+ * @param newSpApplication the new service provider application
+ */
+ public final void setSPApplication(final String newSpApplication) {
+ this.spApplication = prepareForAssignment(this.spApplication,
+ newSpApplication);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java
index db58fb8be..40a1ac86a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPCountryImpl.java
@@ -1,82 +1,82 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPCountry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class SPCountryImpl.
- *
- * @author fjquevedo
- */
-public class SPCountryImpl extends AbstractSAMLObject implements SPCountry {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SPCountryImpl.class.getName());
- /** The service provider country. */
- private String spCountry;
-
- /**
- * Instantiates a new service provider country.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPCountryImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the service provider country.
- *
- * @return the service provider country
- */
- public final String getSPCountry() {
- return spCountry;
- }
-
- /**
- * Sets the service provider country.
- *
- * @param newSpCountry the new service provider country
- */
- public final void setSPCountry(final String newSpCountry) {
- this.spCountry = prepareForAssignment(this.spCountry, newSpCountry);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPCountry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPCountryImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPCountryImpl extends AbstractSAMLObject implements SPCountry {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPCountryImpl.class.getName());
+ /** The service provider country. */
+ private String spCountry;
+
+ /**
+ * Instantiates a new service provider country.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPCountryImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider country.
+ *
+ * @return the service provider country
+ */
+ public final String getSPCountry() {
+ return spCountry;
+ }
+
+ /**
+ * Sets the service provider country.
+ *
+ * @param newSpCountry the new service provider country
+ */
+ public final void setSPCountry(final String newSpCountry) {
+ this.spCountry = prepareForAssignment(this.spCountry, newSpCountry);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java
index 0c7127273..68611997b 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPIDImpl.java
@@ -1,82 +1,82 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPID;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class SPIDImpl.
- *
- * @author iinigo
- */
-public class SPIDImpl extends AbstractSAMLObject implements SPID {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SPIDImpl.class.getName());
- /** The citizen country code. */
- private String spId;
-
- /**
- * Instantiates a new sP country impl.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPIDImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the SP ID.
- *
- * @return the SP ID
- */
- public final String getSPID() {
- return spId;
- }
-
- /**
- * Sets the SP ID.
- *
- * @param newSPID the new SP ID
- */
- public final void setSPID(final String newSPID) {
- this.spId = prepareForAssignment(this.spId, newSPID);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPIDImpl.
+ *
+ * @author iinigo
+ */
+public class SPIDImpl extends AbstractSAMLObject implements SPID {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPIDImpl.class.getName());
+ /** The citizen country code. */
+ private String spId;
+
+ /**
+ * Instantiates a new sP country impl.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPIDImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the SP ID.
+ *
+ * @return the SP ID
+ */
+ public final String getSPID() {
+ return spId;
+ }
+
+ /**
+ * Sets the SP ID.
+ *
+ * @param newSPID the new SP ID
+ */
+ public final void setSPID(final String newSPID) {
+ this.spId = prepareForAssignment(this.spId, newSPID);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java
index b5609600d..ff6e90999 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationImpl.java
@@ -1,110 +1,110 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSignableSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPID;
-import eu.stork.peps.auth.engine.core.SPInformation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * The Class SPInformationImpl.
- *
- * @author iinigo
- */
-public final class SPInformationImpl extends AbstractSignableSAMLObject implements
-SPInformation {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SPInformationImpl.class.getName());
- /** The citizen country code. */
- private SPID spId;
-
-
- /**
- * Instantiates a new requested attributes implement.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPInformationImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
- /**
- * getSPId.
- *
- * @return the SP ID
- */
- public SPID getSPID() {
- return spId;
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- *
- */
- public List<XMLObject> getOrderedChildren() {
- final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
-
- children.add(spId);
-
- if (getSignature() != null) {
- children.add(getSignature());
- }
-
- return Collections.unmodifiableList(children);
-
- }
-
- /**
- * Gets the signature reference id.
- *
- * @return the signature reference id
- *
- */
- public String getSignatureReferenceID() {
- return null;
- }
-
- /**
- * Sets the SP Id.
- *
- * @param newSPId the new SP Id
- *
- */
- public void setSPID(SPID newSPId) {
- this.spId = prepareForAssignment(this.spId, newSPId);
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The Class SPInformationImpl.
+ *
+ * @author iinigo
+ */
+public final class SPInformationImpl extends AbstractSignableSAMLObject implements
+SPInformation {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPInformationImpl.class.getName());
+ /** The citizen country code. */
+ private SPID spId;
+
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPInformationImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * getSPId.
+ *
+ * @return the SP ID
+ */
+ public SPID getSPID() {
+ return spId;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(spId);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Sets the SP Id.
+ *
+ * @param newSPId the new SP Id
+ *
+ */
+ public void setSPID(SPID newSPId) {
+ this.spId = prepareForAssignment(this.spId, newSPId);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java
index 79b0b0f35..414b93386 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInformationUnmarshaller.java
@@ -1,52 +1,52 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.UnmarshallingException;
-
-import eu.stork.peps.auth.engine.core.SPID;
-import eu.stork.peps.auth.engine.core.SPInformation;
-
-/**
- * The Class SPInformationUnmarshaller.
- *
- * @author iinigo
- */
-public class SPInformationUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process child element.
- *
- * @param parentObject the parent object
- * @param childObject the child object
- *
- * @throws UnmarshallingException the unmarshalling exception
- *
- */
- protected final void processChildElement(final XMLObject parentObject,
- final XMLObject childObject) throws UnmarshallingException {
- final SPInformation spInformation = (SPInformation) parentObject;
-
- if (childObject instanceof SPID) {
- spInformation.setSPID((SPID) childObject);
- } else {
- super.processChildElement(parentObject, childObject);
- }
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.SPID;
+import eu.stork.peps.auth.engine.core.SPInformation;
+
+/**
+ * The Class SPInformationUnmarshaller.
+ *
+ * @author iinigo
+ */
+public class SPInformationUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final SPInformation spInformation = (SPInformation) parentObject;
+
+ if (childObject instanceof SPID) {
+ spInformation.setSPID((SPID) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java
index cf1760446..38438613a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPInstitutionImpl.java
@@ -1,84 +1,84 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPInstitution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class SPInstitutionImpl.
- *
- * @author fjquevedo
- */
-public class SPInstitutionImpl extends AbstractSAMLObject implements
- SPInstitution {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SPInstitutionImpl.class.getName());
- /** The service provider institution. */
- private String spInstitution;
-
- /**
- * Instantiates a new service provider institution.
- *
- * @param namespaceURI the namespace uri
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPInstitutionImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
- /**
- * Gets the service provider institution.
- *
- * @return the service provider institution
- */
- public final String getSPInstitution() {
- return spInstitution;
- }
-
- /**
- * Sets the service provider institution.
- *
- * @param newSpInstitution the new service provider institution
- */
- public final void setSPInstitution(final String newSpInstitution) {
- this.spInstitution = prepareForAssignment(this.spInstitution,
- newSpInstitution);
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPInstitution;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SPInstitutionImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPInstitutionImpl extends AbstractSAMLObject implements
+ SPInstitution {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(SPInstitutionImpl.class.getName());
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /**
+ * Instantiates a new service provider institution.
+ *
+ * @param namespaceURI the namespace uri
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPInstitutionImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /**
+ * Gets the service provider institution.
+ *
+ * @return the service provider institution
+ */
+ public final String getSPInstitution() {
+ return spInstitution;
+ }
+
+ /**
+ * Sets the service provider institution.
+ *
+ * @param newSpInstitution the new service provider institution
+ */
+ public final void setSPInstitution(final String newSpInstitution) {
+ this.spInstitution = prepareForAssignment(this.spInstitution,
+ newSpInstitution);
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+ }
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java
index a29810dd4..4ac822876 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SPSectorImpl.java
@@ -1,84 +1,84 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.SPSector;
-
-
-/**
- * The Class SPSectorImpl.
- *
- * @author fjquevedo
- */
-public class SPSectorImpl extends AbstractSAMLObject implements SPSector {
-
- /** The service provider sector. */
- private String spSector;
-
- /**
- * Instantiates a new Service provider sector implementation.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected SPSectorImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
- /**
- * Gets the service provider sector.
- *
- * @return the SP sector
- *
- * @see eu.stork.peps.auth.engine.core.SPSector#getSPSector()
- */
- public final String getSPSector() {
- return spSector;
- }
-
-
- /**
- * Sets the service provider sector.
- *
- * @param newSpSector the new service provider sector
- */
- public final void setSPSector(final String newSpSector) {
- this.spSector = prepareForAssignment(this.spSector, newSpSector);
- }
-
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- */
- public final List<XMLObject> getOrderedChildren() {
- return null;
- }
-
- @Override
- public int hashCode() {
- throw new UnsupportedOperationException("hashCode method not implemented");
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.SPSector;
+
+
+/**
+ * The Class SPSectorImpl.
+ *
+ * @author fjquevedo
+ */
+public class SPSectorImpl extends AbstractSAMLObject implements SPSector {
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /**
+ * Instantiates a new Service provider sector implementation.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected SPSectorImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * Gets the service provider sector.
+ *
+ * @return the SP sector
+ *
+ * @see eu.stork.peps.auth.engine.core.SPSector#getSPSector()
+ */
+ public final String getSPSector() {
+ return spSector;
+ }
+
+
+ /**
+ * Sets the service provider sector.
+ *
+ * @param newSpSector the new service provider sector
+ */
+ public final void setSPSector(final String newSpSector) {
+ this.spSector = prepareForAssignment(this.spSector, newSpSector);
+ }
+
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ */
+ public final List<XMLObject> getOrderedChildren() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ throw new UnsupportedOperationException("hashCode method not implemented");
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java
index 5e9c753ae..80796ea86 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignHW.java
@@ -1,468 +1,468 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.Provider;
-import java.security.Security;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.InvalidPropertiesFormatException;
-import java.util.List;
-import java.util.Properties;
-
-import eu.stork.peps.auth.engine.X509PrincipalUtil;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.NotImplementedException;
-import org.bouncycastle.jce.X509Principal;
-import org.opensaml.Configuration;
-import org.opensaml.common.SAMLObject;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.saml2.core.Assertion;
-import org.opensaml.saml2.core.LogoutResponse;
-import org.opensaml.saml2.core.Response;
-import org.opensaml.security.SAMLSignatureProfileValidator;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.security.SecurityConfiguration;
-import org.opensaml.xml.security.SecurityException;
-import org.opensaml.xml.security.credential.Credential;
-import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
-import org.opensaml.xml.security.keyinfo.KeyInfoHelper;
-import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
-import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
-import org.opensaml.xml.security.x509.BasicX509Credential;
-import org.opensaml.xml.signature.KeyInfo;
-import org.opensaml.xml.signature.Signature;
-import org.opensaml.xml.signature.SignatureConstants;
-import org.opensaml.xml.signature.SignatureException;
-import org.opensaml.xml.signature.SignatureValidator;
-import org.opensaml.xml.signature.Signer;
-import org.opensaml.xml.validation.ValidationException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
-import eu.stork.peps.exceptions.SAMLEngineException;
-
-/**
- * The Class HWSign. Module of sign.
- *
- * @author fjquevedo
- */
-public final class SignHW implements SAMLEngineSignI {
-
- /** The Constant CONFIGURATION_FILE. */
- private static final String CONF_FILE = "configurationFile";
-
- /** The Constant KEYSTORE_TYPE.
- private static final String KEYSTORE_TYPE = "keystoreType" */
-
- /** The logger. */
- private static final Logger LOG = LoggerFactory.getLogger(SignHW.class
- .getName());
-
- /** The stork own key store. */
- private KeyStore storkOwnKeyStore = null;
-
- /**
- * Gets the stork own key store.
- *
- * @return the stork own key store
- */
- public KeyStore getStorkOwnKeyStore() {
- return storkOwnKeyStore;
- }
-
- /**
- * Gets the stork trustStore.
- *
- * @return the stork own key store
- */
- public KeyStore getTrustStore() {
- return storkOwnKeyStore;
- }
-
- /**
- * Sets the stork own key store.
- *
- * @param newkOwnKeyStore the new stork own key store
- */
- public void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
- this.storkOwnKeyStore = newkOwnKeyStore;
- }
-
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public Properties getProperties() {
- return properties;
- }
-
- /**
- * Sets the properties.
- *
- * @param newProperties the new properties
- */
- public void setProperties(final Properties newProperties) {
- this.properties = newProperties;
- }
-
- /** The HW sign prop. */
- private Properties properties = null;
-
- /**
- * @see
- * eu.stork.peps.auth.engine.core.SAMLEngineSignI#init(java.lang.String)
- * @param fileConf file of configuration
- * @throws SAMLEngineException error in read file
- */
- public void init(final String fileConf)
- throws SAMLEngineException {
- InputStream inputStr = null;
- try {
- inputStr = SignHW.class.getResourceAsStream("/"
- + fileConf);
- properties = new Properties();
-
- properties.loadFromXML(inputStr);
- } catch (final InvalidPropertiesFormatException e) {
- LOG.info("Exception: invalid properties format.");
- throw new SAMLEngineException(e);
- } catch (IOException e) {
- LOG.info("Exception: invalid file: " + fileConf);
- throw new SAMLEngineException(e);
- } finally {
- IOUtils.closeQuietly(inputStr);
- }
- }
-
-
- /**
- * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
- * @return the X509Certificate.
- */
- public X509Certificate getCertificate() {
- throw new NotImplementedException();
- }
-
- /**
- * @see
- * eu.stork.peps.auth.engine.core.SAMLEngineSignI#sign(SignableSAMLObject tokenSaml)
- * @param tokenSaml signable SAML Object
- * @return the SAMLObject signed.
- * @throws SAMLEngineException error in sign token saml
- */
- public SAMLObject sign(final SignableSAMLObject tokenSaml) throws SAMLEngineException {
-
- try {
- LOG.info("Star procces of sign");
- final char[] pin = properties.getProperty("keyPassword")
- .toCharArray();
-
- storkOwnKeyStore.load(null, pin);
-
- final String serialNumber = properties.getProperty("serialNumber");
- final String issuer = properties.getProperty("issuer");
-
- String alias = null;
- String aliasCert;
- X509Certificate certificate;
-
- boolean find = false;
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
- .hasMoreElements() && !find;) {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) storkOwnKeyStore
- .getCertificate(aliasCert);
- // Verified serial number, issuer
-
- final String serialNum = certificate.getSerialNumber()
- .toString(16);
- X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
- X509Principal issuerDNConf = new X509Principal(issuer);
-
- if(serialNum.equalsIgnoreCase(serialNumber)
- && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
- alias = aliasCert;
- find = true;
- }
-
- }
-
- if (!find) {
- throw new SAMLEngineException("Certificate cannot be found in keystore ");
- }
- certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
- final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
- alias, pin);
-
- LOG.info("Recover BasicX509Credential.");
- final BasicX509Credential credential = new BasicX509Credential();
-
- LOG.debug("Load certificate");
- credential.setEntityCertificate(certificate);
-
- LOG.debug("Load privateKey");
- credential.setPrivateKey(privateKey);
-
- LOG.info("Star procces of sign");
- final Signature signature = (Signature) org.opensaml.xml.Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
-
- LOG.debug("Begin signature with openSaml");
- signature.setSigningCredential(credential);
-
- /*signature.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
- signature.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
-
-
-
- final SecurityConfiguration securityConf =
- org.opensaml.xml.Configuration.getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager = securityConf
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
- .newInstance();
-
- final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
-
- signature.setKeyInfo(keyInfo);
-
- LOG.debug("Set Canonicalization Algorithm");
- signature.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
- //Create a second signature which will be used when signing assertion and response
- final Signature signature2 = (Signature) Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
- final SecurityConfiguration secConfiguration2 = Configuration
- .getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
- .newInstance();
-
- KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
- signature2.setSigningCredential(credential);
- signature2.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
- signature2.setKeyInfo(keyInfo2);
- signature2.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
-
- LOG.info("Marshall samlToken.");
- String qn = tokenSaml.getElementQName().toString();
-
- if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- tokenSaml.setSignature(signature);
- CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
- mars.marshall(tokenSaml);
- Signer.signObject(signature);
- }
- else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- Response res = (Response)tokenSaml;
- List<Assertion> asserts = res.getAssertions();
- //If multiple assertions we just sign the response and not the assertion
- if (asserts.size() > 1)
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
- //If single assertion we sign the assertion and response
- else
- {
- Assertion assertion = (Assertion)asserts.get(0);
- assertion.setSignature(signature);
- tokenSaml.setSignature(signature2);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- Signer.signObject(signature2);
- }
- }
- //Normally we just sign the total saml response
- else
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
-
- } catch (final MarshallingException e) {
- LOG.error("MarshallingException");
- throw new SAMLEngineException(e);
- } catch (final NoSuchAlgorithmException e) {
- LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
- throw new SAMLEngineException(e);
- } catch (final KeyStoreException e) {
- LOG.error("Generic KeyStore exception.");
- throw new SAMLEngineException(e);
- } catch (final SignatureException e) {
- LOG.error("Signature exception.");
- throw new SAMLEngineException(e);
- } catch (final SecurityException e) {
- LOG.error("Security exception.");
- throw new SAMLEngineException(e);
- } catch (final CertificateException e) {
- LOG.error("Certificate exception.");
- throw new SAMLEngineException(e);
- } catch (final IOException e) {
- LOG.error("IO exception.");
- throw new SAMLEngineException(e);
- } catch (final UnrecoverableKeyException e) {
- LOG.error("UnrecoverableKeyException exception.");
- throw new SAMLEngineException(e);
- }
-
- return tokenSaml;
- }
-
- /**
- * @see
- * eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(SignableSAMLObject)
- * @param tokenSaml the token saml
- * @return the SAMLObject validated.
- * @throws SAMLEngineException exception in validate signature
- */
- public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.info("Start signature validation.");
- try {
-
- // Validate structure signature
- final SAMLSignatureProfileValidator signProfValidator =
- new SAMLSignatureProfileValidator();
-
- // Indicates signature id conform to SAML Signature profile
- signProfValidator.validate(tokenSaml.getSignature());
-
- String aliasCert;
- X509Certificate certificate;
-
- final List<Credential> trustedCred = new ArrayList<Credential>();
-
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
- .hasMoreElements();) {
- aliasCert = e.nextElement();
- final BasicX509Credential credential = new BasicX509Credential();
- certificate = (X509Certificate) storkOwnKeyStore
- .getCertificate(aliasCert);
- credential.setEntityCertificate(certificate);
- trustedCred.add(credential);
- }
-
- final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
- final List<X509Certificate> listCertificates = KeyInfoHelper
- .getCertificates(keyInfo);
-
- if (listCertificates.size() != 1) {
- throw new SAMLEngineException("Only must be one certificate");
- }
-
- // Exist only one certificate
- final BasicX509Credential entityX509Cred = new BasicX509Credential();
- entityX509Cred.setEntityCertificate(listCertificates.get(0));
-
- final ExplicitKeyTrustEvaluator keyTrustEvaluator =
- new ExplicitKeyTrustEvaluator();
- if (!keyTrustEvaluator.validate(entityX509Cred, trustedCred)) {
- throw new SAMLEngineException("Certificate it is not trusted.");
- }
-
- final SignatureValidator sigValidator = new SignatureValidator(
- entityX509Cred);
-
- sigValidator.validate(tokenSaml.getSignature());
-
- } catch (final ValidationException e) {
- LOG.error("ValidationException.", e);
- throw new SAMLEngineException(e);
- } catch (final KeyStoreException e) {
- LOG.error("ValidationException.", e);
- throw new SAMLEngineException(e);
- } catch (final CertificateException e) {
- LOG.error("CertificateException.", e);
- throw new SAMLEngineException(e);
- }
- return tokenSaml;
- }
-
- /**
- * load cryptographic service provider.
- *
- * @throws SAMLEngineException the SAML engine exception
- * Note this class was using pkcs11Provider
- * final Provider pkcs11Provider = new sun.security.pkcs11.SunPKCS11(inputStream)
- * if (Security.getProperty(pkcs11Provider.getName()) == null) {
- * Security.insertProviderAt(pkcs11Provider, Security .getProviders().length)
- * }
- * storkOwnKeyStore = KeyStore.getInstance(properties.getProperty(KEYSTORE_TYPE))
- */
- public void loadCryptServiceProvider() throws SAMLEngineException {
- LOG.info("Load Cryptographic Service Provider");
- InputStream inputStream = null;
-
- try {
- inputStream = SignHW.class.getResourceAsStream("/"
- + properties.getProperty(CONF_FILE));
-
- } catch (final Exception e) {
- throw new SAMLEngineException(
- "Error loading CryptographicServiceProvider", e);
- } finally {
- IOUtils.closeQuietly(inputStream);
- }
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.InvalidPropertiesFormatException;
+import java.util.List;
+import java.util.Properties;
+
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.KeyInfoHelper;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.SignatureValidator;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Class HWSign. Module of sign.
+ *
+ * @author fjquevedo
+ */
+public final class SignHW implements SAMLEngineSignI {
+
+ /** The Constant CONFIGURATION_FILE. */
+ private static final String CONF_FILE = "configurationFile";
+
+ /** The Constant KEYSTORE_TYPE.
+ private static final String KEYSTORE_TYPE = "keystoreType" */
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SignHW.class
+ .getName());
+
+ /** The stork own key store. */
+ private KeyStore storkOwnKeyStore = null;
+
+ /**
+ * Gets the stork own key store.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getStorkOwnKeyStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Gets the stork trustStore.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getTrustStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Sets the stork own key store.
+ *
+ * @param newkOwnKeyStore the new stork own key store
+ */
+ public void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
+ this.storkOwnKeyStore = newkOwnKeyStore;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /** The HW sign prop. */
+ private Properties properties = null;
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#init(java.lang.String)
+ * @param fileConf file of configuration
+ * @throws SAMLEngineException error in read file
+ */
+ public void init(final String fileConf)
+ throws SAMLEngineException {
+ InputStream inputStr = null;
+ try {
+ inputStr = SignHW.class.getResourceAsStream("/"
+ + fileConf);
+ properties = new Properties();
+
+ properties.loadFromXML(inputStr);
+ } catch (final InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(inputStr);
+ }
+ }
+
+
+ /**
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
+ * @return the X509Certificate.
+ */
+ public X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#sign(SignableSAMLObject tokenSaml)
+ * @param tokenSaml signable SAML Object
+ * @return the SAMLObject signed.
+ * @throws SAMLEngineException error in sign token saml
+ */
+ public SAMLObject sign(final SignableSAMLObject tokenSaml) throws SAMLEngineException {
+
+ try {
+ LOG.info("Star procces of sign");
+ final char[] pin = properties.getProperty("keyPassword")
+ .toCharArray();
+
+ storkOwnKeyStore.load(null, pin);
+
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+
+ boolean find = false;
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements() && !find;) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ // Verified serial number, issuer
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if(serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ if (!find) {
+ throw new SAMLEngineException("Certificate cannot be found in keystore ");
+ }
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
+ alias, pin);
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.info("Star procces of sign");
+ final Signature signature = (Signature) org.opensaml.xml.Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ LOG.debug("Begin signature with openSaml");
+ signature.setSigningCredential(credential);
+
+ /*signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+
+
+
+ final SecurityConfiguration securityConf =
+ org.opensaml.xml.Configuration.getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = securityConf
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+
+ LOG.debug("Set Canonicalization Algorithm");
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ }
+ else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ Response res = (Response)tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1)
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else
+ {
+ Assertion assertion = (Assertion)asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else
+ {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+ } catch (final MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (final NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (final KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (final SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (final SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (final CertificateException e) {
+ LOG.error("Certificate exception.");
+ throw new SAMLEngineException(e);
+ } catch (final IOException e) {
+ LOG.error("IO exception.");
+ throw new SAMLEngineException(e);
+ } catch (final UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKeyException exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * @see
+ * eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(SignableSAMLObject)
+ * @param tokenSaml the token saml
+ * @return the SAMLObject validated.
+ * @throws SAMLEngineException exception in validate signature
+ */
+ public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator signProfValidator =
+ new SAMLSignatureProfileValidator();
+
+ // Indicates signature id conform to SAML Signature profile
+ signProfValidator.validate(tokenSaml.getSignature());
+
+ String aliasCert;
+ X509Certificate certificate;
+
+ final List<Credential> trustedCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements();) {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustedCred.add(credential);
+ }
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+ final List<X509Certificate> listCertificates = KeyInfoHelper
+ .getCertificates(keyInfo);
+
+ if (listCertificates.size() != 1) {
+ throw new SAMLEngineException("Only must be one certificate");
+ }
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(listCertificates.get(0));
+
+ final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustedCred)) {
+ throw new SAMLEngineException("Certificate it is not trusted.");
+ }
+
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (final ValidationException e) {
+ LOG.error("ValidationException.", e);
+ throw new SAMLEngineException(e);
+ } catch (final KeyStoreException e) {
+ LOG.error("ValidationException.", e);
+ throw new SAMLEngineException(e);
+ } catch (final CertificateException e) {
+ LOG.error("CertificateException.", e);
+ throw new SAMLEngineException(e);
+ }
+ return tokenSaml;
+ }
+
+ /**
+ * load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ * Note this class was using pkcs11Provider
+ * final Provider pkcs11Provider = new sun.security.pkcs11.SunPKCS11(inputStream)
+ * if (Security.getProperty(pkcs11Provider.getName()) == null) {
+ * Security.insertProviderAt(pkcs11Provider, Security .getProviders().length)
+ * }
+ * storkOwnKeyStore = KeyStore.getInstance(properties.getProperty(KEYSTORE_TYPE))
+ */
+ public void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+ InputStream inputStream = null;
+
+ try {
+ inputStream = SignHW.class.getResourceAsStream("/"
+ + properties.getProperty(CONF_FILE));
+
+ } catch (final Exception e) {
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java
index 2adefddbd..c37074eab 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignModuleFactory.java
@@ -1,64 +1,64 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-
-/**
- * The Class ModuleSignFactory.
- *
- * @author fjquevedo
- *
- */
-
-public final class SignModuleFactory {
-
- /** The Constant LOG. */
- private static final Logger LOG = LoggerFactory
- .getLogger(SignModuleFactory.class.getName());
-
- /**
- * Instantiates a new module sign factory.
- */
- private SignModuleFactory() {
-
- }
-
- /**
- * Gets the single instance of SignModuleFactory.
- *
- * @param className the class name
- *
- * @return single instance of SignModuleFactory
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static SAMLEngineSignI getInstance(final String className)
- throws STORKSAMLEngineException {
- LOG.info("[START]SignModuleFactory static");
- try {
- final Class cls = Class.forName(className);
- return (SAMLEngineSignI) cls.newInstance();
- } catch (Exception e) {
- throw new STORKSAMLEngineException(e);
- }
-
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class ModuleSignFactory.
+ *
+ * @author fjquevedo
+ *
+ */
+
+public final class SignModuleFactory {
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(SignModuleFactory.class.getName());
+
+ /**
+ * Instantiates a new module sign factory.
+ */
+ private SignModuleFactory() {
+
+ }
+
+ /**
+ * Gets the single instance of SignModuleFactory.
+ *
+ * @param className the class name
+ *
+ * @return single instance of SignModuleFactory
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static SAMLEngineSignI getInstance(final String className)
+ throws STORKSAMLEngineException {
+ LOG.info("[START]SignModuleFactory static");
+ try {
+ final Class cls = Class.forName(className);
+ return (SAMLEngineSignI) cls.newInstance();
+ } catch (Exception e) {
+ throw new STORKSAMLEngineException(e);
+ }
+
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
index 50ad9936d..6d9ac9ce3 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
@@ -1,556 +1,565 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.Provider;
-import java.security.Security;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.InvalidPropertiesFormatException;
-import java.util.List;
-import java.util.Properties;
-
-import eu.stork.peps.auth.engine.X509PrincipalUtil;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.NotImplementedException;
-import org.bouncycastle.jce.X509Principal;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.opensaml.Configuration;
-import org.opensaml.common.SAMLObject;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.saml2.core.Assertion;
-import org.opensaml.saml2.core.LogoutResponse;
-import org.opensaml.saml2.core.Response;
-import org.opensaml.security.SAMLSignatureProfileValidator;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.security.SecurityConfiguration;
-import org.opensaml.xml.security.SecurityException;
-import org.opensaml.xml.security.credential.Credential;
-import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
-import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
-import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
-import org.opensaml.xml.security.x509.BasicX509Credential;
-import org.opensaml.xml.signature.KeyInfo;
-import org.opensaml.xml.signature.Signature;
-import org.opensaml.xml.signature.SignatureConstants;
-import org.opensaml.xml.signature.SignatureException;
-import org.opensaml.xml.signature.SignatureValidator;
-import org.opensaml.xml.signature.Signer;
-import org.opensaml.xml.util.Base64;
-import org.opensaml.xml.validation.ValidationException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
-import eu.stork.peps.exceptions.SAMLEngineException;
-
-/**
- * The Class SWSign. Class responsible for signing and validating of messages
- * SAML with a certificate store software.
- *
- * @author fjquevedo
- */
-public final class SignP12 implements SAMLEngineSignI {
-
- /** The logger. */
- private static final Logger LOG = LoggerFactory.getLogger(SignP12.class
- .getName());
-
-
- /** The p12 store. */
- private KeyStore p12Store = null;
-
-
- /** The trust store. */
- private KeyStore trustStore = null;
-
-
- /**
- * Gets the trust store.
- *
- * @return the trust store
- */
- public KeyStore getTrustStore() {
- return trustStore;
- }
-
- /**
- * Sets the trust store.
- *
- * @param newTrustStore the new trust store
- */
- public void setTrustStore(final KeyStore newTrustStore) {
- this.trustStore = newTrustStore;
- }
-
- /**
- * The instance.
- *
- * @return the properties
- */
-
- public Properties getProperties() {
- return properties;
- }
-
-
-
- /**
- * Gets the p12 store.
- *
- * @return the p12 store
- */
- public KeyStore getP12Store() {
- return p12Store;
- }
-
-
-
- /**
- * Sets the p12 store.
- *
- * @param newP12Store the new p12 store
- */
- public void setP12Store(final KeyStore newP12Store) {
- this.p12Store = newP12Store;
- }
-
-
-
- /**
- * Sets the properties.
- *
- * @param newProperties the new properties
- */
- public void setProperties(final Properties newProperties) {
- this.properties = newProperties;
- }
-
- /** The SW sign prop. */
- private Properties properties = null;
-
-
- /**
- * Initialize the file configuration.
- *
- * @param fileConf name of the file configuration
- *
- * @throws SAMLEngineException error at the load from file configuration
- */
- public void init(final String fileConf) throws SAMLEngineException {
- InputStream fileProperties = null;
- properties = new Properties();
- try {
- try {
- LOG.debug("Fichero a cargar " + fileConf);
- fileProperties = new FileInputStream(fileConf);
- properties.loadFromXML(fileProperties);
- } catch (Exception e) {
- LOG.error("Fallo al cargar el recurso externo. Se reintenta como fichero interno.");
- fileProperties = SignP12.class.getResourceAsStream("/" + fileConf);
- if (fileProperties == null) {
- fileProperties = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileConf);
- if (fileProperties == null) {
- Enumeration<URL> files = ClassLoader.getSystemClassLoader().getResources(fileConf);
- if (files != null && files.hasMoreElements()) {
- LOG.info("Se han encontrado recurso/s. Se toma el primero.");
- fileProperties = ClassLoader.getSystemClassLoader().getResourceAsStream(files.nextElement().getFile());
- } else {
- throw new IOException("No se pudo recuperar el fichero: " + fileConf, e);
- }
- }
- }
- LOG.debug("Recuperados " + fileProperties.available() + " bytes");
- properties.loadFromXML(fileProperties);
- }
- } catch (InvalidPropertiesFormatException e) {
- LOG.info("Exception: invalid properties format.");
- throw new SAMLEngineException(e);
- } catch (IOException e) {
- LOG.info("Exception: invalid file: " + fileConf);
- throw new SAMLEngineException(e);
- } finally {
- IOUtils.closeQuietly(fileProperties);
- }
- }
-
- /**
- * Gets the certificate.
- *
- * @return the X509Certificate
- *
- */
- public X509Certificate getCertificate() {
- throw new NotImplementedException();
- }
-
- /**
- * Sign the token SAML.
- *
- * @param tokenSaml token SAML
- *
- * @return the X509Certificate signed.
- *
- * @throws SAMLEngineException error at sign SAML token
- *
- */
- public SAMLObject sign(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.info("Start Sign process");
- try {
-
- final String serialNumber = properties.getProperty("serialNumber");
- final String issuer = properties.getProperty("issuer");
-
- String alias = null;
- String aliasCert;
- X509Certificate certificate;
-
- boolean find = false;
- for (final Enumeration<String> e = p12Store.aliases(); e
- .hasMoreElements() && !find;) {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) p12Store
- .getCertificate(aliasCert);
-
- final String serialNum = certificate.getSerialNumber()
- .toString(16);
-
- X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
- X509Principal issuerDNConf = new X509Principal(issuer);
-
- if(serialNum.equalsIgnoreCase(serialNumber)
- && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
- alias = aliasCert;
- find = true;
- }
-
- }
-
- certificate = (X509Certificate) p12Store
- .getCertificate(alias);
- final PrivateKey privateKey = (PrivateKey) p12Store.getKey(
- alias, properties.getProperty("keyPassword").toCharArray());
-
- LOG.info("Recover BasicX509Credential.");
- final BasicX509Credential credential = new BasicX509Credential();
-
- LOG.debug("Load certificate");
- credential.setEntityCertificate(certificate);
-
- LOG.debug("Load privateKey");
- credential.setPrivateKey(privateKey);
-
- LOG.debug("Begin signature with openSaml");
- final Signature signature = (Signature) Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
-
- signature.setSigningCredential(credential);
-
- /*signature.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
- signature.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
-
- final SecurityConfiguration secConfiguration = Configuration
- .getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
- .newInstance();
-
- final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
-
- signature.setKeyInfo(keyInfo);
- signature.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
- //Create a second signature which will be used when signing assertion and response
- final Signature signature2 = (Signature) Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
- final SecurityConfiguration secConfiguration2 = Configuration
- .getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
- .newInstance();
-
- KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
- signature2.setSigningCredential(credential);
- signature2.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
- signature2.setKeyInfo(keyInfo2);
- signature2.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
-
- LOG.info("Marshall samlToken.");
- String qn = tokenSaml.getElementQName().toString();
-
- if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- tokenSaml.setSignature(signature);
- CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
- mars.marshall(tokenSaml);
- Signer.signObject(signature);
- }
- else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- Response res = (Response)tokenSaml;
- List<Assertion> asserts = res.getAssertions();
- //If multiple assertions we just sign the response and not the assertion
- if (asserts.size() > 1)
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
- //If single assertion we sign the assertion and response
- else
- {
- Assertion assertion = (Assertion)asserts.get(0);
- assertion.setSignature(signature);
- tokenSaml.setSignature(signature2);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- Signer.signObject(signature2);
- }
- }
- //Normally we just sign the total saml response
- else
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
-
- } catch (MarshallingException e) {
- LOG.error("MarshallingException");
- throw new SAMLEngineException(e);
- } catch (NoSuchAlgorithmException e) {
- LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
- throw new SAMLEngineException(e);
- } catch (KeyStoreException e) {
- LOG.error("Generic KeyStore exception.");
- throw new SAMLEngineException(e);
- } catch (SignatureException e) {
- LOG.error("Signature exception.");
- throw new SAMLEngineException(e);
- } catch (SecurityException e) {
- LOG.error("Security exception.");
- throw new SAMLEngineException(e);
- } catch (UnrecoverableKeyException e) {
- LOG.error("UnrecoverableKey exception.");
- throw new SAMLEngineException(e);
- }
-
- return tokenSaml;
- }
-
- /**
- * Validate signature.
- *
- * @param tokenSaml token SAML
- *
- * @return the SAMLObject validated.
- *
- * @throws SAMLEngineException error validate signature
- *
- */
- public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.info("Start signature validation.");
- try {
-
- // Validate structure signature
- final SAMLSignatureProfileValidator sigProfValidator =
- new SAMLSignatureProfileValidator();
- try {
- // Indicates signature id conform to SAML Signature profile
- sigProfValidator.validate(tokenSaml.getSignature());
- } catch (ValidationException e) {
- LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
- throw new SAMLEngineException(e);
- }
-
- String aliasCert = null;
- X509Certificate certificate;
-
- /*final List<Credential> trustCred = new ArrayList<Credential>();
-
- for (final Enumeration<String> e = trustStore.aliases(); e
- .hasMoreElements();) {
- aliasCert = e.nextElement();
- final BasicX509Credential credential = new BasicX509Credential();
- certificate = (X509Certificate) trustStore
- .getCertificate(aliasCert);
- credential.setEntityCertificate(certificate);
- trustCred.add(credential);
- }*/
-
- final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
-
- final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
- .getX509Datas().get(0).getX509Certificates().get(0);
-
- final CertificateFactory certFact = CertificateFactory
- .getInstance("X.509");
- final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
- .decode(xmlCert.getValue()));
- final X509Certificate cert = (X509Certificate) certFact
- .generateCertificate(bis);
-
- // Exist only one certificate
- final BasicX509Credential entityX509Cred = new BasicX509Credential();
- entityX509Cred.setEntityCertificate(cert);
-
- boolean trusted = false;
-
- for (final Enumeration<String> e = trustStore.aliases(); e.hasMoreElements();)
- {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) trustStore.getCertificate(aliasCert);
- try {
- cert.verify(certificate.getPublicKey());
- trusted = true;
- break;
- }
- catch (Exception ex) {
- //Do nothing - cert not trusted yet
- }
- }
-
- if (!trusted)
- throw new SAMLEngineException("Certificate is not trusted.");
-
- /*
- // Validate trust certificates
- final ExplicitKeyTrustEvaluator keyTrustEvaluator =
- new ExplicitKeyTrustEvaluator();
- if (!keyTrustEvaluator.validate(entityX509Cred, trustCred)) {
- throw new SAMLEngineException("Certificate it is not trusted.");
- }*/
-
- // Validate signature
- final SignatureValidator sigValidator = new SignatureValidator(
- entityX509Cred);
- sigValidator.validate(tokenSaml.getSignature());
-
- } catch (ValidationException e) {
- LOG.error("ValidationException.");
- throw new SAMLEngineException(e);
- } catch (KeyStoreException e) {
- LOG.error("KeyStoreException.", e);
- throw new SAMLEngineException(e);
- } catch (GeneralSecurityException e) {
- LOG.error("GeneralSecurityException.", e);
- throw new SAMLEngineException(e);
- }
- return tokenSaml;
- }
-
-
- /**
- * Load cryptographic service provider.
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- public void loadCryptServiceProvider() throws SAMLEngineException {
- LOG.info("Load Cryptographic Service Provider");
-
- FileInputStream fis = null;
- FileInputStream fisTrustStore = null;
-
- try {
- // Dynamically register Bouncy Castle provider.
- boolean found = false;
- // Check if BouncyCastle is already registered as a provider
- final Provider[] providers = Security.getProviders();
- for (int i = 0; i < providers.length; i++) {
- if (providers[i].getName().equals(
- BouncyCastleProvider.PROVIDER_NAME)) {
- found = true;
- }
- }
-
- // Register only if the provider has not been previously registered
- if (!found) {
- LOG.debug("SAMLCore: Register Bouncy Castle provider.");
- Security.insertProviderAt(new BouncyCastleProvider(), Security
- .getProviders().length);
- }
-
- p12Store = KeyStore.getInstance(properties
- .getProperty("keystoreType"));
-
- fis = new FileInputStream(properties
- .getProperty("keystorePath"));
-
- p12Store.load(fis, properties.getProperty(
- "keyStorePassword").toCharArray());
-
-
- trustStore = KeyStore.getInstance(properties
- .getProperty("trustStoreType"));
-
- fisTrustStore = new FileInputStream(properties
- .getProperty("trustStorePath"));
- trustStore.load(fisTrustStore, properties.getProperty(
- "trustStorePassword").toCharArray());
-
- } catch (Exception e) {
- throw new SAMLEngineException(
- "Error loading CryptographicServiceProvider", e);
- } finally {
- IOUtils.closeQuietly(fis);
- IOUtils.closeQuietly(fisTrustStore);
- }
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.InvalidPropertiesFormatException;
+import java.util.List;
+import java.util.Properties;
+
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.SignatureValidator;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.SAMLEngineException;
+
+/**
+ * The Class SWSign. Class responsible for signing and validating of messages
+ * SAML with a certificate store software.
+ *
+ * @author fjquevedo
+ */
+public final class SignP12 implements SAMLEngineSignI {
+
+ /** The logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(SignP12.class
+ .getName());
+
+
+ /** The p12 store. */
+ private KeyStore p12Store = null;
+
+
+ /** The trust store. */
+ private KeyStore trustStore = null;
+
+
+ /**
+ * Gets the trust store.
+ *
+ * @return the trust store
+ */
+ @Override
+ public KeyStore getTrustStore() {
+ return trustStore;
+ }
+
+ /**
+ * Sets the trust store.
+ *
+ * @param newTrustStore the new trust store
+ */
+ public void setTrustStore(final KeyStore newTrustStore) {
+ this.trustStore = newTrustStore;
+ }
+
+ /**
+ * The instance.
+ *
+ * @return the properties
+ */
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+
+
+ /**
+ * Gets the p12 store.
+ *
+ * @return the p12 store
+ */
+ public KeyStore getP12Store() {
+ return p12Store;
+ }
+
+
+
+ /**
+ * Sets the p12 store.
+ *
+ * @param newP12Store the new p12 store
+ */
+ public void setP12Store(final KeyStore newP12Store) {
+ this.p12Store = newP12Store;
+ }
+
+
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /** The SW sign prop. */
+ private Properties properties = null;
+
+
+ /**
+ * Initialize the file configuration.
+ *
+ * @param fileConf name of the file configuration
+ *
+ * @throws SAMLEngineException error at the load from file configuration
+ */
+ @Override
+ public void init(final String fileConf) throws SAMLEngineException {
+ InputStream fileProperties = null;
+ properties = new Properties();
+ try {
+ try {
+ LOG.debug("Fichero a cargar " + fileConf);
+ fileProperties = new FileInputStream(fileConf);
+ properties.loadFromXML(fileProperties);
+ } catch (Exception e) {
+ LOG.error("Fallo al cargar el recurso externo. Se reintenta como fichero interno.");
+ fileProperties = SignP12.class.getResourceAsStream("/" + fileConf);
+ if (fileProperties == null) {
+ fileProperties = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileConf);
+ if (fileProperties == null) {
+ Enumeration<URL> files = ClassLoader.getSystemClassLoader().getResources(fileConf);
+ if (files != null && files.hasMoreElements()) {
+ LOG.info("Se han encontrado recurso/s. Se toma el primero.");
+ fileProperties = ClassLoader.getSystemClassLoader().getResourceAsStream(files.nextElement().getFile());
+ } else {
+ throw new IOException("No se pudo recuperar el fichero: " + fileConf, e);
+ }
+ }
+ }
+ LOG.debug("Recuperados " + fileProperties.available() + " bytes");
+ properties.loadFromXML(fileProperties);
+ }
+ } catch (InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileProperties);
+ }
+ }
+
+ /**
+ * Gets the certificate.
+ *
+ * @return the X509Certificate
+ *
+ */
+ @Override
+ public X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Sign the token SAML.
+ *
+ * @param tokenSaml token SAML
+ *
+ * @return the X509Certificate signed.
+ *
+ * @throws SAMLEngineException error at sign SAML token
+ *
+ */
+ @Override
+ public SAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start Sign process");
+ try {
+
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+
+ boolean find = false;
+ for (final Enumeration<String> e = p12Store.aliases(); e
+ .hasMoreElements() && !find;) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) p12Store
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if(serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
+ alias = aliasCert;
+ find = true;
+ }
+
+ }
+
+ certificate = (X509Certificate) p12Store
+ .getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) p12Store.getKey(
+ alias, properties.getProperty("keyPassword").toCharArray());
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.debug("Begin signature with openSaml");
+ final Signature signature = (Signature) org.opensaml.xml.Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ signature.setSigningCredential(credential);
+
+ /*signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);*/
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+
+ final SecurityConfiguration secConfiguration = org.opensaml.xml.Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ final KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) org.opensaml.xml.Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = org.opensaml.xml.Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ }
+ else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
+ {
+ Response res = (Response)tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1)
+ {
+ tokenSaml.setSignature(signature);
+ org.opensaml.xml.Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else
+ {
+ Assertion assertion = asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ org.opensaml.xml.Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else
+ {
+ tokenSaml.setSignature(signature);
+ org.opensaml.xml.Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKey exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * Validate signature.
+ *
+ * @param tokenSaml token SAML
+ *
+ * @return the SAMLObject validated.
+ *
+ * @throws SAMLEngineException error validate signature
+ *
+ */
+ @Override
+ public SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator sigProfValidator =
+ new SAMLSignatureProfileValidator();
+ try {
+ // Indicates signature id conform to SAML Signature profile
+ sigProfValidator.validate(tokenSaml.getSignature());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
+ throw new SAMLEngineException(e);
+ }
+
+ String aliasCert = null;
+ X509Certificate certificate;
+
+ final List<Credential> trustCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = trustStore.aliases(); e
+ .hasMoreElements();)
+ {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) trustStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustCred.add(credential);
+ }
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ final CertificateFactory certFact = CertificateFactory
+ .getInstance("X.509");
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(cert);
+
+ /* A better use of PKI based validation but not wanted for STORK...
+ boolean trusted = false;
+
+ for (final Enumeration<String> e = trustStore.aliases(); e.hasMoreElements();)
+ {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) trustStore.getCertificate(aliasCert);
+ try {
+ cert.verify(certificate.getPublicKey());
+ trusted = true;
+ break;
+ }
+ catch (Exception ex) {
+ //Do nothing - cert not trusted yet
+ }
+ }
+
+ if (!trusted)
+ throw new SAMLEngineException("Certificate is not trusted.");*/
+
+ // Validate trust certificates
+ final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustCred))
+ {
+ throw new SAMLEngineException("Certificate it is not trusted.");
+ }
+
+ // Validate signature
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("KeyStoreException.", e);
+ throw new SAMLEngineException(e);
+ } catch (GeneralSecurityException e) {
+ LOG.error("GeneralSecurityException.", e);
+ throw new SAMLEngineException(e);
+ }
+ return tokenSaml;
+ }
+
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ @Override
+ public void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+
+ FileInputStream fis = null;
+ FileInputStream fisTrustStore = null;
+
+ try {
+ // Dynamically register Bouncy Castle provider.
+ boolean found = false;
+ // Check if BouncyCastle is already registered as a provider
+ final Provider[] providers = Security.getProviders();
+ for (int i = 0; i < providers.length; i++) {
+ if (providers[i].getName().equals(
+ BouncyCastleProvider.PROVIDER_NAME)) {
+ found = true;
+ }
+ }
+
+ // Register only if the provider has not been previously registered
+ if (!found) {
+ LOG.debug("SAMLCore: Register Bouncy Castle provider.");
+ Security.insertProviderAt(new BouncyCastleProvider(), Security
+ .getProviders().length);
+ }
+
+ p12Store = KeyStore.getInstance(properties
+ .getProperty("keystoreType"));
+
+ fis = new FileInputStream(properties
+ .getProperty("keystorePath"));
+
+ p12Store.load(fis, properties.getProperty(
+ "keyStorePassword").toCharArray());
+
+
+ trustStore = KeyStore.getInstance(properties
+ .getProperty("trustStoreType"));
+
+ fisTrustStore = new FileInputStream(properties
+ .getProperty("trustStorePath"));
+ trustStore.load(fisTrustStore, properties.getProperty(
+ "trustStorePassword").toCharArray());
+
+ } catch (Exception e) {
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ IOUtils.closeQuietly(fisTrustStore);
+ }
+ }
+}
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 4554a9586..e31688069 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
@@ -1,538 +1,527 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.Provider;
-import java.security.Security;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.InvalidPropertiesFormatException;
-import java.util.List;
-import java.util.Properties;
-
-import eu.stork.peps.auth.engine.SAMLEngineUtils;
-import eu.stork.peps.auth.engine.X509PrincipalUtil;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.NotImplementedException;
-import org.bouncycastle.jce.X509Principal;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.opensaml.Configuration;
-import org.opensaml.common.SAMLObject;
-import org.opensaml.common.SignableSAMLObject;
-import org.opensaml.saml2.core.Assertion;
-import org.opensaml.saml2.core.LogoutResponse;
-import org.opensaml.saml2.core.Response;
-import org.opensaml.security.SAMLSignatureProfileValidator;
-import org.opensaml.xml.io.MarshallingException;
-import org.opensaml.xml.security.SecurityConfiguration;
-import org.opensaml.xml.security.SecurityException;
-import org.opensaml.xml.security.credential.Credential;
-import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
-import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
-import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
-import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
-import org.opensaml.xml.security.trust.ExplicitX509CertificateTrustEvaluator;
-import org.opensaml.xml.security.x509.BasicX509Credential;
-import org.opensaml.xml.signature.KeyInfo;
-import org.opensaml.xml.signature.Signature;
-import org.opensaml.xml.signature.SignatureConstants;
-import org.opensaml.xml.signature.SignatureException;
-import org.opensaml.xml.signature.SignatureValidator;
-import org.opensaml.xml.signature.Signer;
-import org.opensaml.xml.util.Base64;
-import org.opensaml.xml.validation.ValidationException;
-import org.slf4j.Logger;
-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;
-
-
-/**
- * The Class SWSign. Class responsible for signing and validating of messages
- * SAML with a certificate store software.
- *
- * @author fjquevedo
- */
-public class SignSW implements SAMLEngineSignI {
-
- /** The Constant KEYSTORE_TYPE. */
- private static final String KEYSTORE_TYPE = "keystoreType";
-
- /** The Constant KEY_STORE_PASSWORD. */
- private static final String KEY_STORE_PASS = "keyStorePassword";
-
- /** The logger. */
- private static final Logger LOG = LoggerFactory.getLogger(SignSW.class
- .getName());
-
- /** The stork own key store. */
- private KeyStore storkOwnKeyStore = null;
-
- /**
- * The instance.
- *
- * @return the properties
- */
-
- public final Properties getProperties() {
- return properties;
- }
-
- /**
- * Gets the stork own key store.
- *
- * @return the stork own key store
- */
- public final KeyStore getStorkOwnKeyStore() {
- return storkOwnKeyStore;
- }
-
- /**
- * Gets the stork trustStore.
- *
- * @return the stork own key store
- */
- public KeyStore getTrustStore() {
- return storkOwnKeyStore;
- }
-
- /**
- * Sets the stork own key store.
- *
- * @param newkOwnKeyStore the new stork own key store
- */
- public final void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
- this.storkOwnKeyStore = newkOwnKeyStore;
- }
-
- /**
- * Sets the properties.
- *
- * @param newProperties the new properties
- */
- public final void setProperties(final Properties newProperties) {
- this.properties = newProperties;
- }
-
- /** The SW sign prop. */
- private Properties properties = null;
-
-
- /**
- * Inits the file configuration.
- *
- * @param fileConf name of the file configuration
- *
- * @throws SAMLEngineException error at the load from file configuration
- */
- public final void init(final String fileConf)
- throws SAMLEngineException {
- InputStream fileProperties = null;
- try {
- // 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);
- fileProperties.close();
- } catch (InvalidPropertiesFormatException e) {
- LOG.info("Exception: invalid properties format.");
- throw new SAMLEngineException(e);
- } catch (IOException e) {
- LOG.info("Exception: invalid file: " + fileConf);
- throw new SAMLEngineException(e);
- } finally {
- IOUtils.closeQuietly(fileProperties);
- }
- }
-
- /**
- * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
- * @return the X509Certificate
- */
- public final X509Certificate getCertificate() {
- throw new NotImplementedException();
- }
-
-
- /**
- * Sign the token SAML.
- *
- * @param tokenSaml the token SAML.
- *
- * @return the SAML object
- *
- * @throws SAMLEngineException the SAML engine exception
- *
- */
- public final SAMLObject sign(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.info("Start Sign process.");
- try {
- final String serialNumber = properties.getProperty("serialNumber");
- final String issuer = properties.getProperty("issuer");
-
- String alias = null;
- String aliasCert;
- X509Certificate certificate;
- boolean find = false;
-
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
- .hasMoreElements() && !find; ) {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) storkOwnKeyStore
- .getCertificate(aliasCert);
-
- final String serialNum = certificate.getSerialNumber()
- .toString(16);
-
- X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
- X509Principal issuerDNConf = new X509Principal(issuer);
-
- if(serialNum.equalsIgnoreCase(serialNumber)
- && X509PrincipalUtil.equals(issuerDN, issuerDNConf)){
- alias = aliasCert;
- find = true;
- }
- }
- if (!find) {
- throw new SAMLEngineException("Certificate cannot be found in keystore ");
- }
- certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
- final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
- alias, properties.getProperty("keyPassword").toCharArray());
-
- LOG.info("Recover BasicX509Credential.");
- final BasicX509Credential credential = new BasicX509Credential();
-
- LOG.debug("Load certificate");
- credential.setEntityCertificate(certificate);
-
- LOG.debug("Load privateKey");
- credential.setPrivateKey(privateKey);
-
- LOG.debug("Begin signature with openSaml");
- final Signature signature = (Signature) Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
-
- signature.setSigningCredential(credential);
- signature.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
-
-
- final SecurityConfiguration secConfiguration = Configuration
- .getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
- .newInstance();
-
- KeyInfo keyInfo = keyInfoGenerator.generate(credential);
-
- signature.setKeyInfo(keyInfo);
- signature.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
- //Create a second signature which will be used when signing assertion and response
- final Signature signature2 = (Signature) Configuration
- .getBuilderFactory().getBuilder(
- Signature.DEFAULT_ELEMENT_NAME).buildObject(
- Signature.DEFAULT_ELEMENT_NAME);
- final SecurityConfiguration secConfiguration2 = Configuration
- .getGlobalSecurityConfiguration();
- final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
- .getKeyInfoGeneratorManager();
- final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
- .getDefaultManager();
- final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
- .getFactory(credential);
- final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
- .newInstance();
-
- KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
- signature2.setSigningCredential(credential);
- signature2.setSignatureAlgorithm(
- SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
- signature2.setKeyInfo(keyInfo2);
- signature2.setCanonicalizationAlgorithm(
- SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
-
- LOG.info("Marshall samlToken.");
- String qn = tokenSaml.getElementQName().toString();
-
- if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- tokenSaml.setSignature(signature);
- CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
- mars.marshall(tokenSaml);
- Signer.signObject(signature);
- }
- else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME))
- {
- Response res = (Response)tokenSaml;
- List<Assertion> asserts = res.getAssertions();
- //If multiple assertions we just sign the response and not the assertion
- if (asserts.size() > 1)
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
- //If single assertion we sign the assertion and response
- else
- {
- Assertion assertion = (Assertion)asserts.get(0);
- assertion.setSignature(signature);
- tokenSaml.setSignature(signature2);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- Signer.signObject(signature2);
- }
- }
- //Normally we just sign the total saml response
- else
- {
- tokenSaml.setSignature(signature);
- Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
- .marshall(tokenSaml);
- LOG.info("Sign samlToken.");
- Signer.signObject(signature);
- }
-
-
- } catch (MarshallingException e) {
- LOG.error("MarshallingException");
- throw new SAMLEngineException(e);
- } catch (NoSuchAlgorithmException e) {
- LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
- throw new SAMLEngineException(e);
- } catch (KeyStoreException e) {
- LOG.error("Generic KeyStore exception.");
- throw new SAMLEngineException(e);
- } catch (SignatureException e) {
- LOG.error("Signature exception.");
- throw new SAMLEngineException(e);
- } catch (SecurityException e) {
- LOG.error("Security exception.");
- throw new SAMLEngineException(e);
- } catch (UnrecoverableKeyException e) {
- LOG.error("UnrecoverableKey exception.");
- throw new SAMLEngineException(e);
- }
-
- return tokenSaml;
- }
-
- /**
- * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(org.opensaml.common.SignableSAMLObject)
- * @param tokenSaml token SAML
- * @return the SAMLObject validated.
- * @throws SAMLEngineException error validate signature
- */
- public final SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
- throws SAMLEngineException {
- LOG.info("Start signature validation.");
- try {
-
- // Validate structure signature
- final SAMLSignatureProfileValidator sigProfValidator =
- new SAMLSignatureProfileValidator();
- try {
- // Indicates signature id conform to SAML Signature profile
- sigProfValidator.validate(tokenSaml.getSignature());
- } catch (ValidationException e) {
- LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
- throw new SAMLEngineException(e);
- }
-
- String aliasCert = null;
- X509Certificate certificate;
-
- /*final List<Credential> trustCred = new ArrayList<Credential>();
-
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
- .hasMoreElements();) {
- aliasCert = e.nextElement();
- final BasicX509Credential credential = new BasicX509Credential();
- certificate = (X509Certificate) storkOwnKeyStore
- .getCertificate(aliasCert);
- credential.setEntityCertificate(certificate);
- trustCred.add(credential);
- }*/
-
- final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
-
- final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
- .getX509Datas().get(0).getX509Certificates().get(0);
-
- final CertificateFactory certFact = CertificateFactory
- .getInstance("X.509");
- final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
- .decode(xmlCert.getValue()));
- final X509Certificate cert = (X509Certificate) certFact
- .generateCertificate(bis);
-
- // Exist only one certificate
- final BasicX509Credential entityX509Cred = new BasicX509Credential();
- entityX509Cred.setEntityCertificate(cert);
-
- try {
- cert.checkValidity();
- }
- catch (CertificateExpiredException exp) {
- throw new SAMLEngineException("Certificate expired.");
- }
- catch (CertificateNotYetValidException exp) {
- throw new SAMLEngineException("Certificate not yet valid.");
- }
-
- boolean trusted = false;
-
- for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e.hasMoreElements();)
- {
- aliasCert = e.nextElement();
- certificate = (X509Certificate) storkOwnKeyStore.getCertificate(aliasCert);
- try {
- cert.verify(certificate.getPublicKey());
- trusted = true;
- break;
- }
- catch (Exception ex) {
- //Do nothing - cert not trusted yet
- }
- }
-
- if (!trusted)
- throw new SAMLEngineException("Certificate is not trusted.");
-
- /*
- // Validate trust certificates
- final ExplicitX509CertificateTrustEvaluator chainTrustEvaluator = new ExplicitX509CertificateTrustEvaluator();
-
- if (!chainTrustEvaluator.validate(entityX509Cred, trustCred)) {
- throw new SAMLEngineException("Certificate is not trusted.");
- }
- /*final ExplicitKeyTrustEvaluator keyTrustEvaluator =
- new ExplicitKeyTrustEvaluator();
-
- if (!keyTrustEvaluator.validate(entityX509Cred, trustCred)) {
- throw new SAMLEngineException("Certificate is not trusted.");
- }*/
-
- // Validate signature
- final SignatureValidator sigValidator = new SignatureValidator(
- entityX509Cred);
- sigValidator.validate(tokenSaml.getSignature());
-
- } catch (ValidationException e) {
- LOG.error("ValidationException.");
- throw new SAMLEngineException(e);
- } catch (KeyStoreException e) {
- LOG.error("KeyStoreException.", e);
- throw new SAMLEngineException(e);
- } catch (GeneralSecurityException e) {
- LOG.error("GeneralSecurityException.", e);
- throw new SAMLEngineException(e);
- }
- LOG.info(tokenSaml.getSignatureReferenceID());
- LOG.info("Start signature validation - END." );
- return tokenSaml;
- }
-
-
- /**
- * Load cryptographic service provider.
- *
- * @throws SAMLEngineException the SAML engine exception
- */
- public final void loadCryptServiceProvider() throws SAMLEngineException {
- LOG.info("Load Cryptographic Service Provider");
- FileInputStream fis = null;
- try {
- // Dynamically register Bouncy Castle provider.
- boolean found = false;
- // Check if BouncyCastle is already registered as a provider
- final Provider[] providers = Security.getProviders();
- for (int i = 0; i < providers.length; i++) {
- if (providers[i].getName().equals(
- BouncyCastleProvider.PROVIDER_NAME)) {
- found = true;
- }
- }
-
- // Register only if the provider has not been previously registered
- if (!found) {
- LOG.info("SAMLCore: Register Bouncy Castle provider.");
- Security.insertProviderAt(new BouncyCastleProvider(), Security
- .getProviders().length);
- }
-
- storkOwnKeyStore = KeyStore.getInstance(properties
- .getProperty(KEYSTORE_TYPE));
-
- LOG.info("Loading KeyInfo from keystore file " + properties.getProperty("keystorePath"));
- fis = new FileInputStream(properties
- .getProperty("keystorePath"));
-
- storkOwnKeyStore.load(fis, properties.getProperty(
- KEY_STORE_PASS).toCharArray());
-
- } catch (Exception e) {
- LOG.error("Error loading CryptographicServiceProvider", e);
- throw new SAMLEngineException(
- "Error loading CryptographicServiceProvider", e);
- } finally {
- IOUtils.closeQuietly(fis);
- }
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import eu.stork.peps.auth.engine.X509PrincipalUtil;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.exceptions.SAMLEngineException;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.NotImplementedException;
+import org.bouncycastle.jce.X509Principal;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.SignableSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.LogoutResponse;
+import org.opensaml.saml2.core.Response;
+import org.opensaml.security.SAMLSignatureProfileValidator;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.security.SecurityConfiguration;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.keyinfo.KeyInfoGenerator;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory;
+import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorManager;
+import org.opensaml.xml.security.keyinfo.NamedKeyInfoGeneratorManager;
+import org.opensaml.xml.security.trust.ExplicitKeyTrustEvaluator;
+import org.opensaml.xml.security.trust.ExplicitX509CertificateTrustEvaluator;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.signature.*;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureException;
+import org.opensaml.xml.signature.Signer;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.validation.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.*;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+import java.util.*;
+
+
+/**
+ * The Class SWSign. Class responsible for signing and validating of messages
+ * SAML with a certificate store software.
+ *
+ * @author fjquevedo
+ */
+public class SignSW implements SAMLEngineSignI {
+
+ /**
+ * The Constant KEYSTORE_TYPE.
+ */
+ private static final String KEYSTORE_TYPE = "keystoreType";
+
+ /**
+ * The Constant KEY_STORE_PASSWORD.
+ */
+ private static final String KEY_STORE_PASS = "keyStorePassword";
+
+ /**
+ * The logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(SignSW.class
+ .getName());
+
+ /**
+ * The stork own key store.
+ */
+ private KeyStore storkOwnKeyStore = null;
+
+ /**
+ * The instance.
+ *
+ * @return the properties
+ */
+
+ public final Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Gets the stork own key store.
+ *
+ * @return the stork own key store
+ */
+ public final KeyStore getStorkOwnKeyStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Gets the stork trustStore.
+ *
+ * @return the stork own key store
+ */
+ public KeyStore getTrustStore() {
+ return storkOwnKeyStore;
+ }
+
+ /**
+ * Sets the stork own key store.
+ *
+ * @param newkOwnKeyStore the new stork own key store
+ */
+ public final void setStorkOwnKeyStore(final KeyStore newkOwnKeyStore) {
+ this.storkOwnKeyStore = newkOwnKeyStore;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param newProperties the new properties
+ */
+ public final void setProperties(final Properties newProperties) {
+ this.properties = newProperties;
+ }
+
+ /**
+ * The SW sign prop.
+ */
+ private Properties properties = null;
+
+
+ /**
+ * Inits the file configuration.
+ *
+ * @param fileConf name of the file configuration
+ * @throws SAMLEngineException error at the load from file configuration
+ */
+ public final void init(final String fileConf)
+ throws SAMLEngineException {
+ InputStream fileProperties = null;
+ // 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 += "/";
+ }
+ } else {
+ base = "/";
+ }
+
+ try {
+ if (null != base)
+ fileProperties = new FileInputStream(base + fileConf);
+ else
+ fileProperties = SignSW.class.getResourceAsStream("/"
+ + fileConf);
+ properties = new Properties();
+
+ properties.loadFromXML(fileProperties);
+ fileProperties.close();
+ } catch (InvalidPropertiesFormatException e) {
+ LOG.info("Exception: invalid properties format.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOG.info("Exception: invalid file: " + fileConf);
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileProperties);
+ }
+ }
+
+ /**
+ * @return the X509Certificate
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#getCertificate()
+ */
+ public final X509Certificate getCertificate() {
+ throw new NotImplementedException();
+ }
+
+
+ /**
+ * Sign the token SAML.
+ *
+ * @param tokenSaml the token SAML.
+ * @return the SAML object
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ public final SAMLObject sign(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start Sign process.");
+ try {
+ final String serialNumber = properties.getProperty("serialNumber");
+ final String issuer = properties.getProperty("issuer");
+
+ String alias = null;
+ String aliasCert;
+ X509Certificate certificate;
+ boolean find = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements() && !find; ) {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+
+ final String serialNum = certificate.getSerialNumber()
+ .toString(16);
+
+ X509Principal issuerDN = new X509Principal(certificate.getIssuerDN().getName());
+ X509Principal issuerDNConf = new X509Principal(issuer);
+
+ if (serialNum.equalsIgnoreCase(serialNumber)
+ && X509PrincipalUtil.equals(issuerDN, issuerDNConf)) {
+ alias = aliasCert;
+ find = true;
+ }
+ }
+ if (!find) {
+ throw new SAMLEngineException("Certificate cannot be found in keystore ");
+ }
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(alias);
+ final PrivateKey privateKey = (PrivateKey) storkOwnKeyStore.getKey(
+ alias, properties.getProperty("keyPassword").toCharArray());
+
+ LOG.info("Recover BasicX509Credential.");
+ final BasicX509Credential credential = new BasicX509Credential();
+
+ LOG.debug("Load certificate");
+ credential.setEntityCertificate(certificate);
+
+ LOG.debug("Load privateKey");
+ credential.setPrivateKey(privateKey);
+
+ LOG.debug("Begin signature with openSaml");
+ final Signature signature = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+
+ signature.setSigningCredential(credential);
+ signature.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ //signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);
+
+
+ final SecurityConfiguration secConfiguration = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager = secConfiguration
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager = keyInfoManager
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac = keyInfoGenManager
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator = keyInfoGenFac
+ .newInstance();
+
+ KeyInfo keyInfo = keyInfoGenerator.generate(credential);
+
+ signature.setKeyInfo(keyInfo);
+ signature.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+ //Create a second signature which will be used when signing assertion and response
+ final Signature signature2 = (Signature) Configuration
+ .getBuilderFactory().getBuilder(
+ Signature.DEFAULT_ELEMENT_NAME).buildObject(
+ Signature.DEFAULT_ELEMENT_NAME);
+ final SecurityConfiguration secConfiguration2 = Configuration
+ .getGlobalSecurityConfiguration();
+ final NamedKeyInfoGeneratorManager keyInfoManager2 = secConfiguration2
+ .getKeyInfoGeneratorManager();
+ final KeyInfoGeneratorManager keyInfoGenManager2 = keyInfoManager2
+ .getDefaultManager();
+ final KeyInfoGeneratorFactory keyInfoGenFac2 = keyInfoGenManager2
+ .getFactory(credential);
+ final KeyInfoGenerator keyInfoGenerator2 = keyInfoGenFac2
+ .newInstance();
+
+ KeyInfo keyInfo2 = keyInfoGenerator2.generate(credential);
+ signature2.setSigningCredential(credential);
+ signature2.setSignatureAlgorithm(
+ SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
+ //signature2.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1);
+ signature2.setKeyInfo(keyInfo2);
+ signature2.setCanonicalizationAlgorithm(
+ SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+
+
+ LOG.info("Marshall samlToken.");
+ String qn = tokenSaml.getElementQName().toString();
+
+ if (qn.endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME)) {
+ tokenSaml.setSignature(signature);
+ CustomAttributeQueryMarshaller mars = new CustomAttributeQueryMarshaller();
+ mars.marshall(tokenSaml);
+ Signer.signObject(signature);
+ } else if (qn.endsWith(Response.DEFAULT_ELEMENT_LOCAL_NAME) && !qn.contains(LogoutResponse.DEFAULT_ELEMENT_LOCAL_NAME)) {
+ Response res = (Response) tokenSaml;
+ List<Assertion> asserts = res.getAssertions();
+ //If multiple assertions we just sign the response and not the assertion
+ if (asserts.size() > 1) {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+ //If single assertion we sign the assertion and response
+ else {
+ Assertion assertion = (Assertion) asserts.get(0);
+ assertion.setSignature(signature);
+ tokenSaml.setSignature(signature2);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ Signer.signObject(signature2);
+ }
+ }
+ //Normally we just sign the total saml response
+ else {
+ tokenSaml.setSignature(signature);
+ Configuration.getMarshallerFactory().getMarshaller(tokenSaml)
+ .marshall(tokenSaml);
+ LOG.info("Sign samlToken.");
+ Signer.signObject(signature);
+ }
+
+
+ } catch (MarshallingException e) {
+ LOG.error("MarshallingException");
+ throw new SAMLEngineException(e);
+ } catch (NoSuchAlgorithmException e) {
+ LOG.error("A 'xmldsig#rsa-sha1' cryptographic algorithm is requested but is not available in the environment.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("Generic KeyStore exception.");
+ throw new SAMLEngineException(e);
+ } catch (SignatureException e) {
+ LOG.error("Signature exception.");
+ throw new SAMLEngineException(e);
+ } catch (SecurityException e) {
+ LOG.error("Security exception.");
+ throw new SAMLEngineException(e);
+ } catch (UnrecoverableKeyException e) {
+ LOG.error("UnrecoverableKey exception.");
+ throw new SAMLEngineException(e);
+ }
+
+ return tokenSaml;
+ }
+
+ /**
+ * @param tokenSaml token SAML
+ * @return the SAMLObject validated.
+ * @throws SAMLEngineException error validate signature
+ * @see eu.stork.peps.auth.engine.core.SAMLEngineSignI#validateSignature(org.opensaml.common.SignableSAMLObject)
+ */
+ public final SAMLObject validateSignature(final SignableSAMLObject tokenSaml)
+ throws SAMLEngineException {
+ LOG.info("Start signature validation.");
+ try {
+
+ // Validate structure signature
+ final SAMLSignatureProfileValidator sigProfValidator =
+ new SAMLSignatureProfileValidator();
+ try {
+ // Indicates signature id conform to SAML Signature profile
+ sigProfValidator.validate(tokenSaml.getSignature());
+ } catch (ValidationException e) {
+ LOG.error("ValidationException: signature isn't conform to SAML Signature profile.");
+ throw new SAMLEngineException(e);
+ }
+
+ String aliasCert = null;
+ X509Certificate certificate;
+
+ final List<Credential> trustCred = new ArrayList<Credential>();
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e
+ .hasMoreElements(); ) {
+ aliasCert = e.nextElement();
+ final BasicX509Credential credential = new BasicX509Credential();
+ certificate = (X509Certificate) storkOwnKeyStore
+ .getCertificate(aliasCert);
+ credential.setEntityCertificate(certificate);
+ trustCred.add(credential);
+ }
+
+ final KeyInfo keyInfo = tokenSaml.getSignature().getKeyInfo();
+
+ final org.opensaml.xml.signature.X509Certificate xmlCert = keyInfo
+ .getX509Datas().get(0).getX509Certificates().get(0);
+
+ final CertificateFactory certFact = CertificateFactory
+ .getInstance("X.509");
+ final ByteArrayInputStream bis = new ByteArrayInputStream(Base64
+ .decode(xmlCert.getValue()));
+ final X509Certificate cert = (X509Certificate) certFact
+ .generateCertificate(bis);
+
+ // Exist only one certificate
+ final BasicX509Credential entityX509Cred = new BasicX509Credential();
+ entityX509Cred.setEntityCertificate(cert);
+
+ try {
+ cert.checkValidity();
+ } catch (CertificateExpiredException exp) {
+ throw new SAMLEngineException("Certificate expired.");
+ } catch (CertificateNotYetValidException exp) {
+ throw new SAMLEngineException("Certificate not yet valid.");
+ }
+
+ /* A better use of PKI based validation but not wanted for STORK...
+ boolean trusted = false;
+
+ for (final Enumeration<String> e = storkOwnKeyStore.aliases(); e.hasMoreElements();)
+ {
+ aliasCert = e.nextElement();
+ certificate = (X509Certificate) storkOwnKeyStore.getCertificate(aliasCert);
+ try {
+ cert.verify(certificate.getPublicKey());
+ trusted = true;
+ break;
+ }
+ catch (Exception ex) {
+ //Do nothing - cert not trusted yet
+ }
+ }
+
+ if (!trusted)
+ throw new SAMLEngineException("Certificate is not trusted.");*/
+
+ // Validate trust certificates
+ final ExplicitX509CertificateTrustEvaluator chainTrustEvaluator = new ExplicitX509CertificateTrustEvaluator();
+
+ if (!chainTrustEvaluator.validate(entityX509Cred, trustCred)) {
+ throw new SAMLEngineException("Certificate is not trusted.");
+ }
+ final ExplicitKeyTrustEvaluator keyTrustEvaluator =
+ new ExplicitKeyTrustEvaluator();
+
+ if (!keyTrustEvaluator.validate(entityX509Cred, trustCred)) {
+ throw new SAMLEngineException("Certificate is not trusted.");
+ }
+
+ // Validate signature
+ final SignatureValidator sigValidator = new SignatureValidator(
+ entityX509Cred);
+ sigValidator.validate(tokenSaml.getSignature());
+
+ } catch (ValidationException e) {
+ LOG.error("ValidationException.");
+ throw new SAMLEngineException(e);
+ } catch (KeyStoreException e) {
+ LOG.error("KeyStoreException.", e);
+ throw new SAMLEngineException(e);
+ } catch (GeneralSecurityException e) {
+ LOG.error("GeneralSecurityException.", e);
+ throw new SAMLEngineException(e);
+ }
+ LOG.info(tokenSaml.getSignatureReferenceID());
+ LOG.info("Start signature validation - END.");
+ return tokenSaml;
+ }
+
+
+ /**
+ * Load cryptographic service provider.
+ *
+ * @throws SAMLEngineException the SAML engine exception
+ */
+ public final void loadCryptServiceProvider() throws SAMLEngineException {
+ LOG.info("Load Cryptographic Service Provider");
+ FileInputStream fis = null;
+ try {
+ // Dynamically register Bouncy Castle provider.
+ boolean found = false;
+ // Check if BouncyCastle is already registered as a provider
+ final Provider[] providers = Security.getProviders();
+ for (int i = 0; i < providers.length; i++) {
+ if (providers[i].getName().equals(
+ BouncyCastleProvider.PROVIDER_NAME)) {
+ found = true;
+ }
+ }
+
+ // Register only if the provider has not been previously registered
+ if (!found) {
+ LOG.info("SAMLCore: Register Bouncy Castle provider.");
+ Security.insertProviderAt(new BouncyCastleProvider(), Security
+ .getProviders().length);
+ }
+
+ storkOwnKeyStore = KeyStore.getInstance(properties
+ .getProperty(KEYSTORE_TYPE));
+
+ LOG.info("Loading KeyInfo from keystore file " + properties.getProperty("keystorePath"));
+ fis = new FileInputStream(properties
+ .getProperty("keystorePath"));
+
+ storkOwnKeyStore.load(fis, properties.getProperty(
+ KEY_STORE_PASS).toCharArray());
+
+ } catch (Exception e) {
+ LOG.error("Error loading CryptographicServiceProvider", e);
+ throw new SAMLEngineException(
+ "Error loading CryptographicServiceProvider", e);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ }
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java
index a6e7e7f60..25737e307 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesImpl.java
@@ -1,132 +1,132 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opensaml.common.impl.AbstractSignableSAMLObject;
-import org.opensaml.xml.XMLObject;
-
-import eu.stork.peps.auth.engine.core.CitizenCountryCode;
-import eu.stork.peps.auth.engine.core.SPInformation;
-import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The Class VIDPAuthenticationAttributesImpl.
- *
- * @author fjquevedo
- */
-public final class VIDPAuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
-VIDPAuthenticationAttributes {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(VIDPAuthenticationAttributesImpl.class.getName());
- /** The citizen country code. */
- private CitizenCountryCode citizenCountryCode;
-
- /** The SP information. */
- private SPInformation spInformation;
-
- /**
- * Instantiates a new requested attributes implement.
- *
- * @param namespaceURI the namespace URI
- * @param elementLocalName the element local name
- * @param namespacePrefix the namespace prefix
- */
- protected VIDPAuthenticationAttributesImpl(final String namespaceURI,
- final String elementLocalName, final String namespacePrefix) {
- super(namespaceURI, elementLocalName, namespacePrefix);
- }
-
-
- /**
- * getCitizenCountryCode.
- *
- * @return the citizen country code
- */
- public CitizenCountryCode getCitizenCountryCode() {
- return citizenCountryCode;
- }
-
- /**
- * getSPInformation
- *
- * @return the SP information
- */
- public SPInformation getSPInformation() {
- return spInformation;
- }
-
- /**
- * Gets the ordered children.
- *
- * @return the ordered children
- *
- */
- public List<XMLObject> getOrderedChildren() {
- final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
-
- children.add(citizenCountryCode);
- children.add(spInformation);
-
- if (getSignature() != null) {
- children.add(getSignature());
- }
-
- return Collections.unmodifiableList(children);
-
- }
-
- /**
- * Gets the signature reference id.
- *
- * @return the signature reference id
- *
- */
- public String getSignatureReferenceID() {
- return null;
- }
-
- /**
- * Sets the citizen country code.
- *
- * @param newCitizenCountryCode the new citizen country code
- *
- */
- public void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode) {
- this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
- }
-
- /**
- * Sets the SP information.
- *
- * @param newSPInformation the new SP information
- *
- */
- public void setSPInformation(SPInformation newSPInformation) {
- this.spInformation = prepareForAssignment(this.spInformation, newSPInformation);
- }
-
- @Override
- public int hashCode() {
- LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
- return super.hashCode();
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSignableSAMLObject;
+import org.opensaml.xml.XMLObject;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class VIDPAuthenticationAttributesImpl.
+ *
+ * @author fjquevedo
+ */
+public final class VIDPAuthenticationAttributesImpl extends AbstractSignableSAMLObject implements
+VIDPAuthenticationAttributes {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(VIDPAuthenticationAttributesImpl.class.getName());
+ /** The citizen country code. */
+ private CitizenCountryCode citizenCountryCode;
+
+ /** The SP information. */
+ private SPInformation spInformation;
+
+ /**
+ * Instantiates a new requested attributes implement.
+ *
+ * @param namespaceURI the namespace URI
+ * @param elementLocalName the element local name
+ * @param namespacePrefix the namespace prefix
+ */
+ protected VIDPAuthenticationAttributesImpl(final String namespaceURI,
+ final String elementLocalName, final String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /**
+ * getCitizenCountryCode.
+ *
+ * @return the citizen country code
+ */
+ public CitizenCountryCode getCitizenCountryCode() {
+ return citizenCountryCode;
+ }
+
+ /**
+ * getSPInformation
+ *
+ * @return the SP information
+ */
+ public SPInformation getSPInformation() {
+ return spInformation;
+ }
+
+ /**
+ * Gets the ordered children.
+ *
+ * @return the ordered children
+ *
+ */
+ public List<XMLObject> getOrderedChildren() {
+ final ArrayList<XMLObject> children = new ArrayList<XMLObject>();
+
+ children.add(citizenCountryCode);
+ children.add(spInformation);
+
+ if (getSignature() != null) {
+ children.add(getSignature());
+ }
+
+ return Collections.unmodifiableList(children);
+
+ }
+
+ /**
+ * Gets the signature reference id.
+ *
+ * @return the signature reference id
+ *
+ */
+ public String getSignatureReferenceID() {
+ return null;
+ }
+
+ /**
+ * Sets the citizen country code.
+ *
+ * @param newCitizenCountryCode the new citizen country code
+ *
+ */
+ public void setCitizenCountryCode(CitizenCountryCode newCitizenCountryCode) {
+ this.citizenCountryCode = prepareForAssignment(this.citizenCountryCode, newCitizenCountryCode);
+ }
+
+ /**
+ * Sets the SP information.
+ *
+ * @param newSPInformation the new SP information
+ *
+ */
+ public void setSPInformation(SPInformation newSPInformation) {
+ this.spInformation = prepareForAssignment(this.spInformation, newSPInformation);
+ }
+
+ @Override
+ public int hashCode() {
+ LOGGER.warn("Hashcode has been called, passed to super. Nothing foreseen here");
+ return super.hashCode();
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java
index 1de300c03..ba4a4fe3a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/VIDPAuthenticationAttributesUnmarshaller.java
@@ -1,55 +1,55 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.impl;
-
-import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.io.UnmarshallingException;
-
-import eu.stork.peps.auth.engine.core.CitizenCountryCode;
-import eu.stork.peps.auth.engine.core.SPInformation;
-import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
-
-/**
- * The Class VIDPAuthenticationAttributesUnmarshaller.
- *
- * @author fjquevedo
- */
-public class VIDPAuthenticationAttributesUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
-
- /**
- * Process child element.
- *
- * @param parentObject the parent object
- * @param childObject the child object
- *
- * @throws UnmarshallingException the unmarshalling exception
- *
- */
- protected final void processChildElement(final XMLObject parentObject,
- final XMLObject childObject) throws UnmarshallingException {
- final VIDPAuthenticationAttributes vIDPAuthenticationAttr = (VIDPAuthenticationAttributes) parentObject;
-
- if (childObject instanceof CitizenCountryCode) {
- vIDPAuthenticationAttr.setCitizenCountryCode((CitizenCountryCode) childObject);
- } else if (childObject instanceof SPInformation) {
- vIDPAuthenticationAttr.setSPInformation((SPInformation) childObject);
- } else {
- super.processChildElement(parentObject, childObject);
- }
- }
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+import eu.stork.peps.auth.engine.core.CitizenCountryCode;
+import eu.stork.peps.auth.engine.core.SPInformation;
+import eu.stork.peps.auth.engine.core.VIDPAuthenticationAttributes;
+
+/**
+ * The Class VIDPAuthenticationAttributesUnmarshaller.
+ *
+ * @author fjquevedo
+ */
+public class VIDPAuthenticationAttributesUnmarshaller extends
+ AbstractSAMLObjectUnmarshaller {
+
+ /**
+ * Process child element.
+ *
+ * @param parentObject the parent object
+ * @param childObject the child object
+ *
+ * @throws UnmarshallingException the unmarshalling exception
+ *
+ */
+ protected final void processChildElement(final XMLObject parentObject,
+ final XMLObject childObject) throws UnmarshallingException {
+ final VIDPAuthenticationAttributes vIDPAuthenticationAttr = (VIDPAuthenticationAttributes) parentObject;
+
+ if (childObject instanceof CitizenCountryCode) {
+ vIDPAuthenticationAttr.setCitizenCountryCode((CitizenCountryCode) childObject);
+ } else if (childObject instanceof SPInformation) {
+ vIDPAuthenticationAttr.setSPInformation((SPInformation) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java
index e26da6d04..07db9c9db 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Implementations of STORK 1.0 core specification types and elements.
- */
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Implementations of STORK 1.0 core specification types and elements.
+ */
package eu.stork.peps.auth.engine.core.impl; \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java
index 3393dcf78..51745d796 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Interfaces for STORK 1.0 core specification types and elements.
- */
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Interfaces for STORK 1.0 core specification types and elements.
+ */
package eu.stork.peps.auth.engine.core; \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java
index beceac57f..c602ad38a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/CustomAttributeQueryValidator.java
@@ -1,57 +1,69 @@
-package eu.stork.peps.auth.engine.core.validator;
-
-import java.util.List;
-
-import org.opensaml.saml2.common.Extensions;
-import org.opensaml.saml2.core.SubjectQuery;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.util.DatatypeHelper;
-import org.opensaml.xml.validation.ValidationException;
-import org.opensaml.xml.validation.Validator;
-
-import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-
-public class CustomAttributeQueryValidator implements Validator<CustomAttributeQuery> {
-
- /*
- * Validate action.
- *
- * @param qaa the quality authentication assurance level attribute
- *
- * @throws ValidationException the validation exception
- */
- public final void validate(final CustomAttributeQuery attrQuery) throws ValidationException {
- validateAssertion(attrQuery);
- validateSubject(attrQuery);
- validateDestination(attrQuery);
- }
-
-
- /**
- * Validate assertion.
- *
- * @param attrQuery the attribute query
- *
- * @throws ValidationException the validation exception
- */
- protected final void validateAssertion(final CustomAttributeQuery attrQuery)
- throws ValidationException {
- if (DatatypeHelper.isEmpty(attrQuery.getAssertionConsumerServiceURL())) {
- throw new ValidationException("Consumer Service URL must be specified.");
- }
- }
-
- //Validate subject
- protected void validateSubject(CustomAttributeQuery query) throws ValidationException {
- if (query.getSubject() == null)
- throw new ValidationException("Subject is required");
- }
-
- //Validate destination
- protected void validateDestination(CustomAttributeQuery query) throws ValidationException {
- if (query.getDestination() == null)
- throw new ValidationException("Destination is required");
- }
-
-}
+package eu.stork.peps.auth.engine.core.validator;
+
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
+
+public class CustomAttributeQueryValidator implements Validator<CustomAttributeQuery> {
+
+ /**
+ * Validate action.
+ *
+ * @param attrQuery the attribute query to validate
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final CustomAttributeQuery attrQuery) throws ValidationException {
+ validateAssertion(attrQuery);
+ validateSubject(attrQuery);
+ validateDestination(attrQuery);
+ }
+
+
+ /**
+ * Validate assertion.
+ *
+ * @param attrQuery the attribute query
+ *
+ * @throws ValidationException the validation exception
+ */
+ protected final void validateAssertion(final CustomAttributeQuery attrQuery)
+ throws ValidationException {
+ if (DatatypeHelper.isEmpty(attrQuery.getAssertionConsumerServiceURL())) {
+ throw new ValidationException("Consumer Service URL must be specified.");
+ }
+ }
+
+ /**
+ * Validate subject
+ * @param query the attribute query to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateSubject(CustomAttributeQuery query) throws ValidationException {
+ if (query.getSubject() == null)
+ throw new ValidationException("Subject is required");
+ }
+
+ /**
+ * Validate the destination
+ * @param query the query to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateDestination(CustomAttributeQuery query) throws ValidationException {
+ if (query.getDestination() == null)
+ throw new ValidationException("Destination is required");
+ }
+
+ /**
+ * Validate the destination
+ * @param query the query to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateTime(CustomAttributeQuery query) throws ValidationException {
+ if (query.getIssueInstant().isAfterNow())
+ throw new ValidationException("Issue time is in the futue");
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java
index 760d9c188..491549aac 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/ExtensionsSchemaValidator.java
@@ -1,61 +1,61 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.validator;
-
-import java.util.List;
-
-import org.opensaml.saml2.common.Extensions;
-import org.opensaml.xml.XMLObject;
-import org.opensaml.xml.validation.ValidationException;
-import org.opensaml.xml.validation.Validator;
-
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-
-/**
- * The Class ExtensionsSchemaValidator.
- *
- * @author fjquevedo
- */
-public class ExtensionsSchemaValidator implements Validator<Extensions> {
-
-
- /**
- * validate the extensions.
- *
- * @param extensions the extensions
- *
- * @throws ValidationException the validation exception
- */
- public final void validate(final Extensions extensions)
- throws ValidationException {
- if (extensions.getUnknownXMLObjects() == null
- || extensions.getUnknownXMLObjects().size() <= 0) {
- throw new ValidationException("Extension element is empty or not exist.");
- }
-
- List<XMLObject> qaa = extensions.getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME);
-
- if (qaa.size() == 1) {
- final Validator<QAAAttribute> validatorQaa = new QAAAttributeSchemaValidator();
- validatorQaa.validate((QAAAttribute) qaa.get(0));
- } else {
- throw new ValidationException(
- "Extensions must contain only one element QAALevel.");
- }
-
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.validator;
+
+import java.util.List;
+
+import org.opensaml.saml2.common.Extensions;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class ExtensionsSchemaValidator.
+ *
+ * @author fjquevedo
+ */
+public class ExtensionsSchemaValidator implements Validator<Extensions> {
+
+
+ /**
+ * validate the extensions.
+ *
+ * @param extensions the extensions
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final Extensions extensions)
+ throws ValidationException {
+ if (extensions.getUnknownXMLObjects() == null
+ || extensions.getUnknownXMLObjects().size() <= 0) {
+ throw new ValidationException("Extension element is empty or not exist.");
+ }
+
+ List<XMLObject> qaa = extensions.getUnknownXMLObjects(QAAAttribute.DEF_ELEMENT_NAME);
+
+ if (qaa.size() == 1) {
+ final Validator<QAAAttribute> validatorQaa = new QAAAttributeSchemaValidator();
+ validatorQaa.validate((QAAAttribute) qaa.get(0));
+ } else {
+ throw new ValidationException(
+ "Extensions must contain only one element QAALevel.");
+ }
+
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/MultipleAssertionResponseValidator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/MultipleAssertionResponseValidator.java
new file mode 100644
index 000000000..72639c8ee
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/MultipleAssertionResponseValidator.java
@@ -0,0 +1,80 @@
+package eu.stork.peps.auth.engine.core.validator;
+
+import org.opensaml.saml2.core.Response;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+
+public class MultipleAssertionResponseValidator implements Validator<Response> {
+
+ /**
+ * Validate action.
+ *
+ * @param response the response to validate
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final Response response) throws ValidationException {
+ validateAssertion(response);
+ validateConsent(response);
+ validateDestination(response);
+ validateTime(response);
+ validateId(response);
+ }
+
+
+ /**
+ * Validate assertion.
+ *
+ * @param response the attribute query
+ *
+ * @throws ValidationException the validation exception
+ */
+ protected final void validateAssertion(final Response response)
+ throws ValidationException {
+ if (response.getAssertions() == null || response.getAssertions().size() < 2) {
+ throw new ValidationException("Multiple assertions must be specified.");
+ }
+ }
+
+ /**
+ * Validate the Consent
+ * @param response the response to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateConsent(Response response) throws ValidationException {
+ if (response.getConsent() == null)
+ throw new ValidationException("Consent is required");
+ }
+
+ /**
+ * Validate the destination
+ * @param response the response to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateDestination(Response response) throws ValidationException {
+ if (response.getDestination() == null)
+ throw new ValidationException("Destination is required");
+ }
+
+ /**
+ * Validate issue times
+ * @param response the response to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateTime(Response response) throws ValidationException {
+ if (response.getIssueInstant().isAfterNow())
+ throw new ValidationException("Issue time is in the futue");
+ }
+
+ /**
+ * Validate ids
+ * @param response the response to validate
+ * @throws ValidationException the validation exception
+ */
+ protected void validateId(Response response) throws ValidationException {
+ if (response.getID() == null || response.getInResponseTo() == null)
+ throw new ValidationException("Id and response id is required");
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java
index be5dc8c34..44c9db380 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/QAAAttributeSchemaValidator.java
@@ -1,65 +1,65 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.auth.engine.core.validator;
-
-import org.opensaml.xml.util.DatatypeHelper;
-import org.opensaml.xml.validation.ValidationException;
-import org.opensaml.xml.validation.Validator;
-
-import eu.stork.peps.auth.engine.core.QAAAttribute;
-
-/**
- * The Class QAAAttributeSchemaValidator.
- *
- * @author fjquevedo
- */
-public class QAAAttributeSchemaValidator implements Validator<QAAAttribute> {
-
-
- /**
- * Validate action.
- *
- * @param qaa the quality authentication assurance level attribute
- *
- * @throws ValidationException the validation exception
- */
- public final void validate(final QAAAttribute qaa) throws ValidationException {
- validateAction(qaa);
- }
-
-
- /**
- * Validate action.
- *
- * @param qaaAttribute the quality authentication assurance level attribute.
- *
- * @throws ValidationException the validation exception
- */
- protected final void validateAction(final QAAAttribute qaaAttribute)
- throws ValidationException {
- if (DatatypeHelper.isEmpty(qaaAttribute.getQaaLevel())) {
- throw new ValidationException("QAALevel label must be specified.");
- }
-
- final int qaa = Integer.valueOf(qaaAttribute.getQaaLevel());
-
- if (qaa < QAAAttribute.MIN_VALUE || qaa > QAAAttribute.MAX_VALUE) {
- throw new ValidationException(
- "QAALevel label must be greater than 0.");
- }
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.auth.engine.core.validator;
+
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.validation.ValidationException;
+import org.opensaml.xml.validation.Validator;
+
+import eu.stork.peps.auth.engine.core.QAAAttribute;
+
+/**
+ * The Class QAAAttributeSchemaValidator.
+ *
+ * @author fjquevedo
+ */
+public class QAAAttributeSchemaValidator implements Validator<QAAAttribute> {
+
+
+ /**
+ * Validate action.
+ *
+ * @param qaa the quality authentication assurance level attribute
+ *
+ * @throws ValidationException the validation exception
+ */
+ public final void validate(final QAAAttribute qaa) throws ValidationException {
+ validateAction(qaa);
+ }
+
+
+ /**
+ * Validate action.
+ *
+ * @param qaaAttribute the quality authentication assurance level attribute.
+ *
+ * @throws ValidationException the validation exception
+ */
+ protected final void validateAction(final QAAAttribute qaaAttribute)
+ throws ValidationException {
+ if (DatatypeHelper.isEmpty(qaaAttribute.getQaaLevel())) {
+ throw new ValidationException("QAALevel label must be specified.");
+ }
+
+ final int qaa = Integer.valueOf(qaaAttribute.getQaaLevel());
+
+ if (qaa < QAAAttribute.MIN_VALUE || qaa > QAAAttribute.MAX_VALUE) {
+ throw new ValidationException(
+ "QAALevel label must be greater than 0.");
+ }
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java
index b98cf7157..07b632773 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/validator/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Validation rules for STORK 1.0 core types and elements.
- */
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Validation rules for STORK 1.0 core types and elements.
+ */
package eu.stork.peps.auth.engine.core.validator; \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java
index d3e353e51..30130b7f6 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Provides the classes necessary to create a SAML message.
- */
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message.
+ */
package eu.stork.peps.auth.engine; \ No newline at end of file
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 b40e3f7dd..c53e18662 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
@@ -1,136 +1,142 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.configuration;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.InvalidPropertiesFormatException;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-
-/**
- * The Class InstanceCreator.
- *
- * @author fjquevedo
- */
-public final class ConfigurationCreator {
-
- /** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ConfigurationCreator.class.getName());
-
- /**
- * Creates the configuration.
- *
- * @param instanceConfs the instance configuration
- *
- * @return the map< string, map< string, object>>
- *
- * @throws STORKSAMLEngineException the STORKSAML engine exception
- */
- public static Map<String, Map<String, Object>> createConfiguration(
- final Map<String, InstanceEngine> instanceConfs) throws STORKSAMLEngineException {
-
- final HashMap<String, Map<String, Object>> instances =
- new HashMap<String, Map<String, Object>>();
-
- LOGGER.info("Create configuration.");
- try {
- // Only create instances for SAMLEngine configuration.
- // INSTANCE
- for (Map.Entry<String, InstanceEngine> entry : instanceConfs
- .entrySet()) {
- final InstanceEngine iEngine = entry.getValue();
-
- final Map<String, Object> intance = new HashMap<String, Object>();
-
- // CONFIGURATION
- for (ConfigurationEngine configuration : iEngine
- .getConfiguration()) {
- // Properties only for configuration SamlEngine.
- if (configuration.getName().equalsIgnoreCase(
- "SamlEngineConf")) {
- intance.put(configuration.getName(),
- getNewInstance(configuration.getParameters()
- .get("fileConfiguration")));
- } else {
- intance.put(configuration.getName(), configuration
- .getParameters());
- }
- }
- instances.put(entry.getKey(), intance);
- }
- } catch (STORKSAMLEngineException ex) {
- LOGGER.error("Can not create instance from file configuration.");
- throw new STORKSAMLEngineException(ex);
- }
- return instances;
- }
-
-
- /**
- * Gets the new instance.
- *
- * @param fileName the file name
- *
- * @return the properties from the new instance
- *
- * @throws STORKSAMLEngineException the STORKSAML engine
- * runtime exception
- */
- private static Properties getNewInstance(final String fileName)
- throws STORKSAMLEngineException {
- LOGGER.info("Create file configuration properties to Stork Saml Engine.");
- InputStream fileEngineProp = null;
- try {
- // 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;
- } catch (InvalidPropertiesFormatException e) {
- LOGGER.error("Invalid properties format.");
- throw new STORKSAMLEngineException(e);
- } catch (IOException e) {
- LOGGER.error("Error read file: " + fileName);
- throw new STORKSAMLEngineException(e);
- } finally {
- IOUtils.closeQuietly(fileEngineProp);
- }
- }
-
- /**
- * Instantiates a new instance creator.
- */
- private ConfigurationCreator() {
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.InvalidPropertiesFormatException;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationCreator {
+
+ /**
+ * The Constant LOGGER.
+ */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationCreator.class.getName());
+
+ /**
+ * Creates the configuration.
+ *
+ * @param instanceConfs the instance configuration
+ * @return the map< string, map< string, object>>
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public static Map<String, Map<String, Object>> createConfiguration(
+ final Map<String, InstanceEngine> instanceConfs) throws STORKSAMLEngineException {
+
+ final HashMap<String, Map<String, Object>> instances =
+ new HashMap<String, Map<String, Object>>();
+
+ LOGGER.info("Create configuration.");
+ try {
+ // Only create instances for SAMLEngine configuration.
+ // INSTANCE
+ for (Map.Entry<String, InstanceEngine> entry : instanceConfs
+ .entrySet()) {
+ final InstanceEngine iEngine = entry.getValue();
+
+ final Map<String, Object> intance = new HashMap<String, Object>();
+
+ // CONFIGURATION
+ for (ConfigurationEngine configuration : iEngine
+ .getConfiguration()) {
+ // Properties only for configuration SamlEngine.
+ if (configuration.getName().equalsIgnoreCase(
+ "SamlEngineConf")) {
+ intance.put(configuration.getName(),
+ getNewInstance(configuration.getParameters()
+ .get("fileConfiguration")));
+ } else {
+ intance.put(configuration.getName(), configuration
+ .getParameters());
+ }
+ }
+ instances.put(entry.getKey(), intance);
+ }
+ } catch (STORKSAMLEngineException ex) {
+ LOGGER.error("Can not create instance from file configuration.");
+ throw new STORKSAMLEngineException(ex);
+ }
+ return instances;
+ }
+
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ * @return the properties from the new instance
+ * @throws STORKSAMLEngineException the STORKSAML engine
+ * runtime exception
+ */
+ private static Properties getNewInstance(final String fileName)
+ throws STORKSAMLEngineException {
+ InputStream fileEngineProp = null;
+
+ // 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 += "/";
+ }
+ } else {
+ base = "/";
+ }
+
+ LOGGER.info("Create file configuration properties to Stork Saml Engine: " + base + fileName);
+
+ try {
+
+ if (null != base)
+ fileEngineProp = new FileInputStream(base + fileName);
+ else
+ fileEngineProp = ConfigurationCreator.class
+ .getResourceAsStream(base + fileName);
+
+ final Properties configuration = new Properties();
+ configuration.loadFromXML(fileEngineProp);
+ return configuration;
+ } catch (InvalidPropertiesFormatException e) {
+ LOGGER.error("Invalid properties format.");
+ throw new STORKSAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error read file: " + base + fileName);
+ throw new STORKSAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(fileEngineProp);
+ }
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationCreator() {
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
index 910f4398e..d9e7e467a 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationEngine.java
@@ -1,69 +1,69 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.configuration;
-
-import java.util.Map;
-
-/**
- * The Class ConfigurationEngine.
- *
- * @author fjquevedo
- */
-public class ConfigurationEngine {
-
- /** The name of the configuration file. */
- private String name;
-
- /** The parameters. */
- private Map<String, String> parameters;
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public final String getName() {
- return name;
- }
-
- /**
- * Gets the parameters.
- *
- * @return the parameters
- */
- public final Map<String, String> getParameters() {
- return parameters;
- }
-
- /**
- * Sets the name.
- *
- * @param newName the new name
- */
- public final void setName(final String newName) {
- this.name = newName;
- }
-
- /**
- * Sets the parameters.
- *
- * @param newParameters the parameters
- */
- public final void setParameters(final Map<String, String> newParameters) {
- this.parameters = newParameters;
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+/**
+ * The Class ConfigurationEngine.
+ *
+ * @author fjquevedo
+ */
+public class ConfigurationEngine {
+
+ /** The name of the configuration file. */
+ private String name;
+
+ /** The parameters. */
+ private Map<String, String> parameters;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newParameters the parameters
+ */
+ public final void setParameters(final Map<String, String> newParameters) {
+ this.parameters = newParameters;
+ }
+
+}
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 e9b067e76..7968c77ff 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
@@ -1,233 +1,234 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.configuration;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import eu.stork.peps.exceptions.SAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * The Class ConfigurationReader.
- *
- * @author fjquevedo
- */
-public final class ConfigurationReader {
-
- /** The Constant SAML_ENGINE_CONFIGURATION_FILE. */
- private static final String ENGINE_CONF_FILE = "SamlEngine.xml";
-
- /** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ConfigurationReader.class.getName());
-
- /** The Constant NODE_CONFIGURATION. */
- private static final String NODE_CONF = "configuration";
-
- /** The Constant NODE_CONFIGURATION_NAME. */
- private static final String NODE_CONF_NAME = "name";
-
- /** The Constant NODE_INSTANCE_NAME. */
- private static final String NODE_INST_NAME = "name";
-
- /** The Constant NODE_INSTANCE. */
- private static final String NODE_INSTANCE = "instance";
-
- /** The Constant NODE_CONFIGURATION_NAME. */
- private static final String NODE_PARAM_NAME = "name";
-
- /** The Constant NODE_CONFIGURATION_NAME. */
- private static final String NODE_PARAM_VALUE = "value";
-
- /** The Constant NODE_CONFIGURATION_NAME. */
- private static final String NODE_PARAMETER = "parameter";
-
- /**
- * Generate parameters.
- *
- * @param configurationNode the configuration node
- *
- * @return the map< string, string>
- */
- private static Map<String, String> generateParam(
- final Element configurationNode) {
-
- final HashMap<String, String> parameters = new HashMap<String, String>();
-
- final NodeList parameterNodes = configurationNode
- .getElementsByTagName(NODE_PARAMETER);
-
- String parameterName;
- String parameterValue;
-
- for (int k = 0; k < parameterNodes.getLength(); ++k) {
- // for every parameter find, process.
- final Element parameterNode = (Element) parameterNodes.item(k);
- parameterName = parameterNode.getAttribute(NODE_PARAM_NAME);
- parameterValue = parameterNode.getAttribute(NODE_PARAM_VALUE);
-
- // verified the content.
- if (StringUtils.isBlank(parameterName)
- || StringUtils.isBlank(parameterValue)) {
- throw new STORKSAMLEngineRuntimeException(
- "Error reader parameters (name - value).");
- } else {
- parameters.put(parameterName.trim(), parameterValue.trim());
- }
- }
- return parameters;
- }
-
- /**
- * Read configuration.
- *
- * @return the map< string, instance engine>
- *
- * @throws SAMLEngineException the STORKSAML engine runtime
- * exception
- */
- public static Map<String, InstanceEngine> readConfiguration()
- throws SAMLEngineException {
-
- // 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<String, InstanceEngine> instanceConfs =
- new HashMap<String, InstanceEngine>();
-
- Document document = null;
- // Load configuration file
- final DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder builder;
-
- InputStream engineConf = null;
- try {
-
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
-
- builder = factory.newDocumentBuilder();
-
- if(null != base)
- engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
- else
- engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
-
- document = builder.parse(engineConf);
-
- // Read instance
- final NodeList list = document.getElementsByTagName(NODE_INSTANCE);
-
- for (int indexElem = 0; indexElem < list.getLength(); ++indexElem) {
- final Element element = (Element) list.item(indexElem);
-
- final InstanceEngine instanceConf = new InstanceEngine();
-
- // read every configuration.
- final String instanceName = element
- .getAttribute(NODE_INST_NAME);
-
- if (StringUtils.isBlank(instanceName)) {
- throw new STORKSAMLEngineRuntimeException(
- "Error reader instance name.");
- }
- instanceConf.setName(instanceName.trim());
-
- final NodeList confNodes = element
- .getElementsByTagName(NODE_CONF);
-
- for (int indexNode = 0; indexNode < confNodes.getLength(); ++indexNode) {
-
- final Element configurationNode = (Element) confNodes
- .item(indexNode);
-
- final String configurationName = configurationNode
- .getAttribute(NODE_CONF_NAME);
-
- if (StringUtils.isBlank(configurationName)) {
- throw new STORKSAMLEngineRuntimeException(
- "Error reader configuration name.");
- }
-
- final ConfigurationEngine confSamlEngine =
- new ConfigurationEngine();
-
- // Set configuration name.
- confSamlEngine.setName(configurationName.trim());
-
- // Read every parameter for this configuration.
- final Map<String, String> parameters =
- generateParam(configurationNode);
-
- // Set parameters
- confSamlEngine.setParameters(parameters);
-
- // Add parameters to the configuration.
- instanceConf.getConfiguration().add(confSamlEngine);
- }
-
- // Add to the list of configurations.
- instanceConfs.put(element.getAttribute(NODE_INST_NAME),
- instanceConf);
- }
-
- } catch (SAXException e) {
- LOGGER.error("Error: init library parser.");
- throw new SAMLEngineException(e);
- } catch (ParserConfigurationException e) {
- LOGGER.error("Error: parser configuration file xml.");
- throw new SAMLEngineException(e);
- } catch (IOException e) {
- LOGGER.error("Error: read configuration file.");
- throw new SAMLEngineException(e);
- } finally {
- IOUtils.closeQuietly(engineConf);
- }
-
- return instanceConfs;
- }
-
- /**
- * Instantiates a new configuration reader.
- */
- private ConfigurationReader() {
-
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class ConfigurationReader.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationReader {
+
+ /** The Constant SAML_ENGINE_CONFIGURATION_FILE. */
+ private static final String ENGINE_CONF_FILE = "SamlEngine.xml";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationReader.class.getName());
+
+ /** The Constant NODE_CONFIGURATION. */
+ private static final String NODE_CONF = "configuration";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_CONF_NAME = "name";
+
+ /** The Constant NODE_INSTANCE_NAME. */
+ private static final String NODE_INST_NAME = "name";
+
+ /** The Constant NODE_INSTANCE. */
+ private static final String NODE_INSTANCE = "instance";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_NAME = "name";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAM_VALUE = "value";
+
+ /** The Constant NODE_CONFIGURATION_NAME. */
+ private static final String NODE_PARAMETER = "parameter";
+
+ /**
+ * Generate parameters.
+ *
+ * @param configurationNode the configuration node
+ *
+ * @return the map< string, string>
+ */
+ private static Map<String, String> generateParam(
+ final Element configurationNode) {
+
+ final HashMap<String, String> parameters = new HashMap<String, String>();
+
+ final NodeList parameterNodes = configurationNode
+ .getElementsByTagName(NODE_PARAMETER);
+
+ String parameterName;
+ String parameterValue;
+
+ for (int k = 0; k < parameterNodes.getLength(); ++k) {
+ // for every parameter find, process.
+ final Element parameterNode = (Element) parameterNodes.item(k);
+ parameterName = parameterNode.getAttribute(NODE_PARAM_NAME);
+ parameterValue = parameterNode.getAttribute(NODE_PARAM_VALUE);
+
+ // verified the content.
+ if (StringUtils.isBlank(parameterName)
+ || StringUtils.isBlank(parameterValue)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader parameters (name - value).");
+ } else {
+ parameters.put(parameterName.trim(), parameterValue.trim());
+ }
+ }
+ return parameters;
+ }
+
+ /**
+ * Read configuration.
+ *
+ * @return the map< string, instance engine>
+ *
+ * @throws SAMLEngineException the STORKSAML engine runtime
+ * exception
+ */
+ public static Map<String, InstanceEngine> readConfiguration()
+ throws SAMLEngineException {
+
+ // 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<String, InstanceEngine> instanceConfs =
+ new HashMap<String, InstanceEngine>();
+
+ Document document = null;
+ // Load configuration file
+ final DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ DocumentBuilder builder;
+
+ InputStream engineConf = null;
+ try {
+
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ builder = factory.newDocumentBuilder();
+
+ if (null != base)
+ engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
+ else
+ engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
+
+ document = builder.parse(engineConf);
+
+ // Read instance
+ final NodeList list = document.getElementsByTagName(NODE_INSTANCE);
+
+ for (int indexElem = 0; indexElem < list.getLength(); ++indexElem) {
+ final Element element = (Element) list.item(indexElem);
+
+ final InstanceEngine instanceConf = new InstanceEngine();
+
+ // read every configuration.
+ final String instanceName = element
+ .getAttribute(NODE_INST_NAME);
+
+ if (StringUtils.isBlank(instanceName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader instance name.");
+ }
+ instanceConf.setName(instanceName.trim());
+
+ final NodeList confNodes = element
+ .getElementsByTagName(NODE_CONF);
+
+ for (int indexNode = 0; indexNode < confNodes.getLength(); ++indexNode) {
+
+ final Element configurationNode = (Element) confNodes
+ .item(indexNode);
+
+ final String configurationName = configurationNode
+ .getAttribute(NODE_CONF_NAME);
+
+ if (StringUtils.isBlank(configurationName)) {
+ throw new STORKSAMLEngineRuntimeException(
+ "Error reader configuration name.");
+ }
+
+ final ConfigurationEngine confSamlEngine =
+ new ConfigurationEngine();
+
+ // Set configuration name.
+ confSamlEngine.setName(configurationName.trim());
+
+ // Read every parameter for this configuration.
+ final Map<String, String> parameters =
+ generateParam(configurationNode);
+
+ // Set parameters
+ confSamlEngine.setParameters(parameters);
+
+ // Add parameters to the configuration.
+ instanceConf.getConfiguration().add(confSamlEngine);
+ }
+
+ // Add to the list of configurations.
+ instanceConfs.put(element.getAttribute(NODE_INST_NAME),
+ instanceConf);
+ }
+
+ } catch (SAXException e) {
+ LOGGER.error("Error: init library parser.");
+ throw new SAMLEngineException(e);
+ } catch (ParserConfigurationException e) {
+ LOGGER.error("Error: parser configuration file xml.");
+ throw new SAMLEngineException(e);
+ } catch (IOException e) {
+ LOGGER.error("Error: read configuration file.");
+ throw new SAMLEngineException(e);
+ } finally {
+ IOUtils.closeQuietly(engineConf);
+ }
+
+ return instanceConfs;
+ }
+
+ /**
+ * Instantiates a new configuration reader.
+ */
+ private ConfigurationReader() {
+
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
index 53cea621d..d00607853 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationSingleton.java
@@ -1,74 +1,74 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.configuration;
-
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import eu.stork.peps.exceptions.SAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
-import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
-
-/**
- * The Class InstanceCreator.
- *
- * @author fjquevedo
- */
-public final class ConfigurationSingleton {
-
- /** The instance of every engine SAML. */
- private static Map<String, InstanceEngine> instanceConfigs;
-
- /** The instances of SAML engine. */
- private static Map<String, Map<String, Object>> instances;
-
- /** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ConfigurationSingleton.class.getName());
-
- static {
- LOGGER.debug("Read all file configurations. (instances of SAMLEngine)");
- try {
- instanceConfigs = ConfigurationReader.readConfiguration();
- } catch (SAMLEngineException e) {
- LOGGER.error("Error read configuration file.");
- throw new STORKSAMLEngineRuntimeException(e);
- }
- }
-
- /**
- * Gets the new instance.
- *
- * @param fileName the file name
- *
- * @return the properties from the new instance
- *
- * @throws STORKSAMLEngineException the STORKSAML engine runtime exception
- */
- private static Map<String, Map<String, Object>> getInstance(
- final String fileName) throws STORKSAMLEngineException {
- return ConfigurationCreator.createConfiguration(instanceConfigs);
- }
-
- /**
- * Instantiates a new instance creator.
- */
- private ConfigurationSingleton() {
- }
-
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.exceptions.SAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.stork.peps.exceptions.STORKSAMLEngineRuntimeException;
+
+/**
+ * The Class InstanceCreator.
+ *
+ * @author fjquevedo
+ */
+public final class ConfigurationSingleton {
+
+ /** The instance of every engine SAML. */
+ private static Map<String, InstanceEngine> instanceConfigs;
+
+ /** The instances of SAML engine. */
+ private static Map<String, Map<String, Object>> instances;
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ConfigurationSingleton.class.getName());
+
+ static {
+ LOGGER.debug("Read all file configurations. (instances of SAMLEngine)");
+ try {
+ instanceConfigs = ConfigurationReader.readConfiguration();
+ } catch (SAMLEngineException e) {
+ LOGGER.error("Error read configuration file.");
+ throw new STORKSAMLEngineRuntimeException(e);
+ }
+ }
+
+ /**
+ * Gets the new instance.
+ *
+ * @param fileName the file name
+ *
+ * @return the properties from the new instance
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine runtime exception
+ */
+ private static Map<String, Map<String, Object>> getInstance(
+ final String fileName) throws STORKSAMLEngineException {
+ return ConfigurationCreator.createConfiguration(instanceConfigs);
+ }
+
+ /**
+ * Instantiates a new instance creator.
+ */
+ private ConfigurationSingleton() {
+ }
+
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
index e0e2d1965..4d9bba8e7 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/InstanceEngine.java
@@ -1,70 +1,70 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * The Class InstanceConfiguration.
- *
- * @author fjquevedo
- */
-public class InstanceEngine {
-
- /** The configuration. */
- private List<ConfigurationEngine> configuration = new ArrayList<ConfigurationEngine>();
-
- /** The name. */
- private String name;
-
- /**
- * Gets the parameters.
- *
- * @return the parameters
- */
- public final List<ConfigurationEngine> getConfiguration() {
- return this.configuration;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public final String getName() {
- return name;
- }
-
- /**
- * Sets the parameters.
- *
- * @param newConfiguration the new parameters
- */
- public final void setConfiguration(final List<ConfigurationEngine> newConfiguration) {
- this.configuration = newConfiguration;
- }
-
- /**
- * Sets the name.
- *
- * @param newName the new name
- */
- public final void setName(final String newName) {
- this.name = newName;
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The Class InstanceConfiguration.
+ *
+ * @author fjquevedo
+ */
+public class InstanceEngine {
+
+ /** The configuration. */
+ private List<ConfigurationEngine> configuration = new ArrayList<ConfigurationEngine>();
+
+ /** The name. */
+ private String name;
+
+ /**
+ * Gets the parameters.
+ *
+ * @return the parameters
+ */
+ public final List<ConfigurationEngine> getConfiguration() {
+ return this.configuration;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the parameters.
+ *
+ * @param newConfiguration the new parameters
+ */
+ public final void setConfiguration(final List<ConfigurationEngine> newConfiguration) {
+ this.configuration = newConfiguration;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param newName the new name
+ */
+ public final void setName(final String newName) {
+ this.name = newName;
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
index 6d0b54297..344368e03 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Provides the classes necessary to create a SAML message instance.
- */
-package eu.stork.peps.configuration;
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message instance.
+ */
+package eu.stork.peps.configuration;
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java
index 366379ad0..ac46f73e4 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/SAMLEngineException.java
@@ -1,57 +1,57 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.exceptions;
-
-/**
- * The Class SAMLEngineException.
- *
- * @author fjquevedo
- */
-public class SAMLEngineException extends Exception {
-
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 2611361164977849837L;
-
- /**
- * Instantiates a new SAMLEngine exception.
- *
- * @param wrappedException the wrapped exception
- */
- public SAMLEngineException(final Exception wrappedException) {
- super(wrappedException);
- }
-
- /**
- * Instantiates a new SAMLEngine exception.
- *
- * @param message the message
- */
- public SAMLEngineException(final String message) {
- super(message);
- }
-
- /**
- * Instantiates a new SAMLEngine exception.
- *
- * @param message the message
- * @param wrappedException the wrapped exception
- */
- public SAMLEngineException(final String message,
- final Exception wrappedException) {
- super(message, wrappedException);
- }
-
-}
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.exceptions;
+
+/**
+ * The Class SAMLEngineException.
+ *
+ * @author fjquevedo
+ */
+public class SAMLEngineException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 2611361164977849837L;
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param wrappedException the wrapped exception
+ */
+ public SAMLEngineException(final Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param message the message
+ */
+ public SAMLEngineException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Instantiates a new SAMLEngine exception.
+ *
+ * @param message the message
+ * @param wrappedException the wrapped exception
+ */
+ public SAMLEngineException(final String message,
+ final Exception wrappedException) {
+ super(message, wrappedException);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java
index 30b9b49b4..fb01fd5aa 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/STORKSAMLEngineRuntimeException.java
@@ -1,56 +1,56 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-package eu.stork.peps.exceptions;
-
-/**
- * The Class STORKSAMLEngineRuntimeException.
- *
- * @author fjquevedo
- */
-public class STORKSAMLEngineRuntimeException extends RuntimeException {
-
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 5829810358581493517L;
-
- /**
- * Instantiates a new sTORKSAML engine runtime exception.
- *
- * @param wrappedException the wrapped exception
- */
- public STORKSAMLEngineRuntimeException(final Exception wrappedException) {
- super(wrappedException);
- }
-
- /**
- * Creates a new instance of application exception.
- *
- * @param cause the exception cause.
- */
- public STORKSAMLEngineRuntimeException(final String cause) {
- super(cause);
- }
-
- /**
- * Instantiates a new sTORKSAML engine runtime exception.
- *
- * @param message the message
- * @param wrappedException the wrapped exception
- */
- public STORKSAMLEngineRuntimeException(final String message,
- final Exception wrappedException) {
- super(message, wrappedException);
- }
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.exceptions;
+
+/**
+ * The Class STORKSAMLEngineRuntimeException.
+ *
+ * @author fjquevedo
+ */
+public class STORKSAMLEngineRuntimeException extends RuntimeException {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 5829810358581493517L;
+
+ /**
+ * Instantiates a new sTORKSAML engine runtime exception.
+ *
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineRuntimeException(final Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Creates a new instance of application exception.
+ *
+ * @param cause the exception cause.
+ */
+ public STORKSAMLEngineRuntimeException(final String cause) {
+ super(cause);
+ }
+
+ /**
+ * Instantiates a new sTORKSAML engine runtime exception.
+ *
+ * @param message the message
+ * @param wrappedException the wrapped exception
+ */
+ public STORKSAMLEngineRuntimeException(final String message,
+ final Exception wrappedException) {
+ super(message, wrappedException);
+ }
} \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java
index 0c34528fc..0c7341995 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/exceptions/package-info.java
@@ -1,19 +1,19 @@
-/*
- * 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/european-union-public-licence-eupl-v.1.1
- *
- * 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.
- */
-
-/**
- * Provides the classes for STORK exceptions management.
- */
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes for STORK exceptions management.
+ */
package eu.stork.peps.exceptions; \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SSETestUtils.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SSETestUtils.java
new file mode 100644
index 000000000..eb885eea9
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SSETestUtils.java
@@ -0,0 +1,173 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.test.simple;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+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.apache.commons.io.IOUtils;
+import org.bouncycastle.util.encoders.Base64;
+import org.opensaml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallerFactory;
+import org.opensaml.xml.io.MarshallingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * The Class SSETestUtils.
+ */
+public final class SSETestUtils {
+
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(SSETestUtils.class.getName());
+
+ /**
+ * Instantiates a new sSE test utils.
+ */
+ private SSETestUtils() {
+ }
+
+ /**
+ * Prints the tree DOM.
+ *
+ * @param samlToken the SAML token
+ * @param isIndent the is indent
+ *
+ * @return the string
+ * @throws TransformerException the exception
+ */
+ public static String printTreeDOM(final Element samlToken, final boolean isIndent) throws TransformerException {
+ // set up a transformer
+ final TransformerFactory transfac = TransformerFactory.newInstance();
+ final Transformer trans = transfac.newTransformer();
+ trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ trans.setOutputProperty(OutputKeys.INDENT, String.valueOf(isIndent));
+
+ // create string from XML tree
+ final StringWriter stringWriter = new StringWriter();
+ final StreamResult result = new StreamResult(stringWriter);
+ final DOMSource source = new DOMSource(samlToken);
+ trans.transform(source, result);
+ final String xmlString = stringWriter.toString();
+
+ return xmlString;
+ }
+
+ /**
+ * Marshall.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the byte[]
+ *
+ * @throws MarshallingException the marshalling exception
+ * @throws ParserConfigurationException the parser configuration exception
+ * @throws TransformerException the transformer exception
+ */
+ public static byte[] marshall(final XMLObject samlToken)
+ throws MarshallingException, ParserConfigurationException,
+ TransformerException {
+
+ final javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory
+ .newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ dbf.setNamespaceAware(true);
+ dbf.setIgnoringComments(true);
+ final javax.xml.parsers.DocumentBuilder docBuild = dbf
+ .newDocumentBuilder();
+
+ // Get the marshaller factory
+ final MarshallerFactory marshallerFactory = Configuration
+ .getMarshallerFactory();
+
+ // Get the Subject marshaller
+ final Marshaller marshaller = marshallerFactory
+ .getMarshaller(samlToken);
+
+ final Document doc = docBuild.newDocument();
+
+ // Marshall the SAML token
+ marshaller.marshall(samlToken, doc);
+
+ // Obtain a byte array representation of the marshalled SAML object
+ final DOMSource domSource = new DOMSource(doc);
+ final StringWriter writer = new StringWriter();
+ final StreamResult result = new StreamResult(writer);
+ final TransformerFactory transFact = TransformerFactory.newInstance();
+ final Transformer transformer = transFact.newTransformer();
+ transformer.transform(domSource, result);
+
+ return writer.toString().getBytes();
+ }
+
+ /**
+ * Encode SAML token.
+ *
+ * @param samlToken the SAML token
+ *
+ * @return the string
+ */
+ public static String encodeSAMLToken(final byte[] samlToken) {
+ return new String(Base64.encode(samlToken));
+ }
+
+ /**
+ * Read stork SAML from file.
+ *
+ * @param resource the resource
+ *
+ * @return the byte[]
+ * @throws IOException the exception
+ *
+ */
+ public static byte[] readStorkSamlFromFile(final String resource)
+ throws IOException {
+ InputStream inputStream = null;
+ byte[] bytes;
+
+ try {
+ inputStream = StorkAuthRequestTest.class
+ .getResourceAsStream(resource);
+
+ // Create the byte array to hold the data
+ bytes = new byte[(int) inputStream.available()];
+ inputStream.read(bytes);
+ } catch (IOException e) {
+ LOG.error("Error read from file: " + resource);
+ throw e;
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ return bytes;
+
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SimpleBaseTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SimpleBaseTest.java
new file mode 100644
index 000000000..c52b8a779
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/SimpleBaseTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.test.simple;
+
+import org.junit.Test;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+
+/**
+ * The Class SimpleBaseTest. Defines a set of test the initialization of the
+ * SAML engine.
+ */
+@SuppressWarnings("deprecation")
+public class SimpleBaseTest extends TestCase {
+
+ /**
+ * Test SAML engine correct configuration name.
+ */
+
+ @Test
+ public final void testSamlEngineCorrectInit() {
+ Assert.assertNotNull(STORKSAMLEngine.getInstance("CONF1"));
+ }
+
+ /**
+ * Test SAML engine error configuration name.
+ */
+ @Test
+ public final void testSamlEngineErrorNameConf() {
+ Assert.assertNull(STORKSAMLEngine.getInstance("CONF_ERROR"));
+ }
+
+ /**
+ * Test SAML engine error name null.
+ */
+ @Test
+ public final void testSamlEngineErrorNameNull() {
+ Assert.assertNull(STORKSAMLEngine.getInstance(null));
+ }
+
+ /**
+ * Test SAML engine correct name configuration with spaces.
+ */
+ @Test
+ public final void testSamlEngineErrorNameSpaces() {
+ Assert.assertNotNull(STORKSAMLEngine.getInstance(" CONF1 "));
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryRequestTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryRequestTest.java
new file mode 100644
index 000000000..0eda1bfbf
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryRequestTest.java
@@ -0,0 +1,864 @@
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.*;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+public class StorkAttrQueryRequestTest {
+
+ /** The engines. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+ private static STORKSAMLEngine engine0 = STORKSAMLEngine.getInstance("CONF0");
+ private static STORKSAMLEngine engine2 = STORKSAMLEngine.getInstance("CONF2");
+ private static STORKSAMLEngine engine3 = STORKSAMLEngine.getInstance("CONF3");
+
+
+ /**
+ * Instantiates a new stork authentication request test.
+ */
+ public StorkAttrQueryRequestTest() {
+ pal = new PersonalAttributeList();
+
+ final PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ final ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ pal.add(isAgeOver);
+
+ final PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ pal.add(dateOfBirth);
+
+ final PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ eIDNumber.setValue(Arrays.asList("ES/IS/1234567890"));
+ pal.add(eIDNumber);
+
+ final PersonalAttribute givenName = new PersonalAttribute();
+ givenName.setName("givenName");
+ givenName.setIsRequired(true);
+ givenName.setValue(Arrays.asList("Sveinbjorn"));
+ pal.add(givenName);
+
+ destination = "http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest";
+ assertConsumerUrl = "http://S-PEPS.gov.xx/PEPS/ColleagueResponse";
+ //spName = "University of Oxford";
+ spSector = "EDU001";
+ spInstitution = "OXF001";
+ spApplication = "APP001";
+ spCountry = "IS";
+
+ spId = "EDU001-OXF001-APP001";
+
+ }
+
+ /** The destination. */
+ private String destination;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The service provider id. */
+ private String spId;
+
+ /** The assertion consumer URL. */
+ private String assertConsumerUrl;
+
+ /** The quality authentication assurance level. */
+ private static final int QAAL = 3;
+
+ /** The List of Personal Attributes. */
+ private IPersonalAttributeList pal;
+
+ /** The attribute query request. */
+ private static byte[] attrRequest;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkAttrQueryRequestTest.class.getName());
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+ }
+
+ /**
+ * Test generate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAttrQueryRequest() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ // new parameters
+ request.setEIDSectorShare(false);
+ request.setEIDCrossSectorShare(false);
+ request.setEIDCrossBorderShare(false);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+ request.setSpCountry(spCountry);
+
+ STORKAttrQueryRequest req1 = engine0.generateSTORKAttrQueryRequest(request);
+ byte[] reqByte = req1.getTokenSaml();
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(reqByte);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ LOG.info("STORKAttrQueryRequest 1: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAttrQueryRequest(request).getTokenSaml()));
+
+ request.setCitizenCountryCode("IS");
+ LOG.info("STORKAttrQueryRequest 2: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAttrQueryRequest(request).getTokenSaml()));
+ }
+
+ /**
+ * Test generate authentication request error personal attribute name error.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestPALsErr1() {
+
+ final IPersonalAttributeList palWrong = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("attrNotValid");
+ worngAttr.setIsRequired(true);
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(palWrong);
+
+ // news parameters
+ request.setEIDSectorShare(false);
+ request.setEIDCrossSectorShare(false);
+ request.setEIDCrossBorderShare(false);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+ /**
+ * Test generate authentication request error personal attribute value error.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestPALsErr2() {
+
+ final IPersonalAttributeList palWrong = new PersonalAttributeList();
+
+ final PersonalAttribute attrNotValid = new PersonalAttribute();
+ attrNotValid.setName("attrNotValid");
+ attrNotValid.setIsRequired(true);
+ palWrong.add(attrNotValid);
+
+
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(palWrong);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request authentication assurance level
+ * negative value.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestQaalErr1() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(-1);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider sector null.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestSectorErr() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(null);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider institution null.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestDestinationErr() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(null);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(null);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAttrQueryRequest(...) should've thrown an STORKSAMLEngineException!");
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider application null.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestApplicationErr() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(null);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider country null.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestCountryErr() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(null);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request error with quality authentication
+ * assurance level wrong.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestQaalErr2() {
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(0);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request personal attribute list null value.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestPALErr1() {
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(null);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ engine.generateSTORKAttrQueryRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request null parameter.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequestNullParam()
+ throws STORKSAMLEngineException {
+ try {
+ engine.validateSTORKAttrQueryRequest(null);
+ fail("validateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request error bytes encode.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequestErrorEncode()
+ throws STORKSAMLEngineException {
+ try {
+ engine.validateSTORKAttrQueryRequest("messageError".getBytes());
+ fail("validateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequest() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ attrRequest = engine.generateSTORKAttrQueryRequest(request).getTokenSaml();
+
+ final STORKAttrQueryRequest validatedRequest = engine.validateSTORKAttrQueryRequest(attrRequest);
+
+ assertEquals("CrossBorderShare incorrect: ", validatedRequest.isEIDCrossBorderShare(), false);
+ assertEquals("CrossSectorShare incorrect: ", validatedRequest.isEIDCrossSectorShare(), false);
+ assertEquals("SectorShare incorrect: ", validatedRequest.isEIDSectorShare(), false);
+
+ }
+
+ /**
+ * Test validate data authenticate request. Verified parameters after
+ * validation.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateDataAttrQueryRequest() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = engine.validateSTORKAttrQueryRequest(attrRequest);
+
+ assertEquals("Sestination incorrect: ", request.getDestination(), destination);
+
+ assertEquals("CrossBorderShare incorrect: ", request.isEIDCrossBorderShare(), false);
+ assertEquals("CrossSectorShare incorrect: ", request.isEIDCrossSectorShare(), false);
+ assertEquals("SectorShare incorrect: ", request.isEIDSectorShare(), false);
+
+ assertEquals("QAAL incorrect: ", request.getQaa(), QAAL);
+ assertEquals("SPSector incorrect: ", request.getSpSector(), spSector);
+ assertEquals("SPInstitution incorrect: ", request.getSpInstitution(), null);
+ assertEquals("SPApplication incorrect: ", request.getSpApplication(), spApplication);
+ assertEquals("CitizenCountryCode incorrect: ", request.getCitizenCountryCode(), null);
+
+ }
+
+ /**
+ * Test validate file attribute query request. Validate from XML file.
+ *
+ * @throws Exception the exception
+ */
+ @Test
+ public final void testValidateFileAttrQueryRequest() throws Exception {
+
+ final byte[] bytes = SSETestUtils.readStorkSamlFromFile("/data/eu/stork/STORKSAMLEngine/AttrQueryRequest1.xml");
+
+ try {
+ engine.validateSTORKAttrQueryRequest(bytes);
+ fail("testValidateFileAttrQueryRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error(e.getMessage());
+ }
+ }
+
+ /**
+ * Test validate file authentication request tag delete.
+ *
+ * @throws Exception the exception
+ */
+ @Test
+ public final void testValidateFileAttrRequestTagDelete() throws Exception {
+
+ final byte[] bytes = SSETestUtils.readStorkSamlFromFile("/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml");
+
+ try {
+ engine.validateSTORKAttrQueryRequest(bytes);
+ fail("validateSTORKAttrQueryRequest(...) should have thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error(e.getMessage());
+
+ }
+ }
+
+ /**
+ * Test validate authentication request not trusted token.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequestNotTrustedErr1()
+ throws STORKSAMLEngineException {
+
+ try {
+ final STORKSAMLEngine engineNotTrusted = STORKSAMLEngine
+ .getInstance("CONF2");
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+
+ final byte[] authReqNotTrust = engineNotTrusted
+ .generateSTORKAttrQueryRequest(request).getTokenSaml();
+
+ engine.validateSTORKAttrQueryRequest(authReqNotTrust);
+ fail("validateSTORKAttrQueryRequestNotTrusted(...) should have thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request trusted.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequestTrusted()
+ throws STORKSAMLEngineException {
+
+ final STORKSAMLEngine engineTrusted = STORKSAMLEngine
+ .getInstance("CONF3");
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ final byte[] authReqNotTrust = engineTrusted.generateSTORKAttrQueryRequest(
+ request).getTokenSaml();
+
+ // engine ("CONF1") no have trust certificate from "CONF2"
+ engine.validateSTORKAttrQueryRequest(authReqNotTrust);
+
+ }
+
+
+
+
+ /**
+ * Test generate authentication request service provider application null.
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestNADA() {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ // news parameters
+ request.setSpSector(null);
+ request.setSpInstitution(null);
+ request.setSpApplication(null);
+ request.setSpCountry(null);
+
+ try {
+
+ engine.validateSTORKAttrQueryRequest(attrRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test validate authentication request with unknown elements.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryRequestWithUnknownElements() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute unknown = new PersonalAttribute();
+ unknown.setName("unknown");
+ unknown.setIsRequired(true);
+ pAttList.add(unknown);
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ STORKAttrQueryRequest req = new STORKAttrQueryRequest();
+
+ req = engine3.generateSTORKAttrQueryRequest(request);
+
+ req = engine.validateSTORKAttrQueryRequest(req.getTokenSaml());
+
+ assertNull("The value shouldn't exist", req.getPersonalAttributeList().get("unknown"));
+ assertNotNull("The value should exist", req.getPersonalAttributeList().get("eIdentifier"));
+
+ }
+
+ /**
+ * Test generate Request with required elements by default
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAttrQueryRequestWithIsRequiredElementsByDefault() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ STORKAttrQueryRequest req = new STORKAttrQueryRequest();
+ STORKAttrQueryRequest reqTrue = new STORKAttrQueryRequest();
+ STORKAttrQueryRequest reqFalse = new STORKAttrQueryRequest();
+
+ reqTrue = engine.generateSTORKAttrQueryRequest(request);
+ reqFalse = engine2.generateSTORKAttrQueryRequest(request);
+ req = engine3.generateSTORKAttrQueryRequest(request);
+
+
+ String token = new String(req.getTokenSaml());
+ String reqTrueToken = new String(reqTrue.getTokenSaml());
+ String reqFalseToken = new String(reqFalse.getTokenSaml());
+
+ assertTrue("The token must contain the chain 'isRequired'", token.contains("isRequired"));
+ assertTrue("The token must contain the chain 'isRequired'", reqTrueToken.contains("isRequired"));
+ assertFalse("The token must contain the chain 'isRequired'", reqFalseToken.contains("isRequired"));
+
+ }
+
+ /**
+ * Test validating attribute query and getting alias used to save
+ * the saml trusted certificate into trustore
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ /*@Test
+ public final void testValidateAtrrQueryRequestGettingItsAlias() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ STORKAttrQueryRequest req = new STORKAttrQueryRequest();
+
+ req = engine3.generateSTORKAttrQueryRequest(request);
+ req = engine.validateSTORKAttrQueryRequest(req.getTokenSaml());
+ String prufa = req.getAlias();
+ assertTrue("The alias should match this value", req.getAlias().equals("local-demo"));
+
+ req = engine2.generateSTORKAttrQueryRequest(request);
+ req = engine2.validateSTORKAttrQueryRequest(req.getTokenSaml());
+ assertTrue("The alias should match this value", req.getAlias().equals("local-demo2"));
+ }*/
+
+ @Test
+ public final void testGenerateAttrQueryRequestSignDoc() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+
+ request.setDestination(destination);
+ request.setQaa(QAAL);
+ PersonalAttributeList pal0 = new PersonalAttributeList();
+
+ final PersonalAttribute signDoc = new PersonalAttribute();
+ signDoc.setName("docRequest");
+ signDoc.setIsRequired(true);
+ signDoc.setValue(Arrays.asList("IS/IS/fbea6e68-0393-401b-b616-f767fff9418c"));
+ pal0.add(signDoc);
+
+ request.setPersonalAttributeList(pal0);
+
+ // new parameters
+ /*request.setEIDSectorShare(false);
+ request.setEIDCrossSectorShare(false);
+ request.setEIDCrossBorderShare(false);*/
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+ request.setSpCountry(spCountry);
+
+ STORKAttrQueryRequest req1 = engine0.generateSTORKAttrQueryRequest(request);
+ byte[] reqByte = req1.getTokenSaml();
+ FileOutputStream output = null;
+
+ STORKAttrQueryRequest req2 = engine0.validateSTORKAttrQueryRequest(reqByte);
+ //reqByte = req2.getTokenSaml();
+
+ try {
+ //output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestSdoc.xml"));
+ FileOutputStream fos;
+ File outputDir = new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine");
+ File saveFile = new File(outputDir, "AttrQueryRequestSdoc.xml");
+ fos = new FileOutputStream(saveFile);
+ fos.write(reqByte);
+ fos.flush();
+ fos.close();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(reqByte);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ LOG.info("STORKAttrQueryRequest 1: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAttrQueryRequest(request).getTokenSaml()));
+
+ request.setCitizenCountryCode("IS");
+ LOG.info("STORKAttrQueryRequest 2: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAttrQueryRequest(request).getTokenSaml()));
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryResponseTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryResponseTest.java
new file mode 100644
index 000000000..a98d5b7c3
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAttrQueryResponseTest.java
@@ -0,0 +1,1085 @@
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+import eu.stork.peps.auth.commons.STORKSubStatusCode;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+public class StorkAttrQueryResponseTest {
+
+ /** The engine. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+
+ /**
+ * Gets the engine.
+ *
+ * @return the engine
+ */
+ public static STORKSAMLEngine getEngine() {
+ return engine;
+ }
+
+ /**
+ * Sets the engine.
+ *
+ * @param newEngine the new engine
+ */
+ public static void setEngine(final STORKSAMLEngine newEngine) {
+ StorkAttrQueryResponseTest.engine = newEngine;
+ }
+
+ /** The destination. */
+ private static String destination;
+
+ /** The service provider sector. */
+ private static String spSector;
+
+ /** The service provider institution. */
+ private static String spInstitution;
+
+ /** The service provider application. */
+ private static String spApplication;
+
+ /** The service provider country. */
+ private static String spCountry;
+
+ /** The service provider id. */
+ private static String spId;
+
+ /** The quality authentication assurance level. */
+ private static final int QAAL = 3;
+
+ /** The state. */
+ private static String state = "IS";
+
+ /** The town. */
+ private static String town = "Reykjavik";
+
+ /** The postal code. */
+ private static String postalCode = "105";
+
+ /** The street name. */
+ private static String streetName = "Gudrunartun";
+
+ /** The street number. */
+ private static String streetNumber = "10";
+
+ /** The List of Personal Attributes. */
+ private static IPersonalAttributeList pal;
+
+ /** The assertion consumer URL. */
+ private static String assertConsumerUrl;
+
+ /** The attribute query request. */
+ private static byte[] attrQueryRequest;
+
+ /** The attribute query response. */
+ private static byte[] attrQueryResponse;
+
+ /** The attribute query request. */
+ private static STORKAttrQueryRequest attrQueryenRequest;
+
+ /** The attribute query response. */
+ private static STORKAttrQueryResponse attrQeuryenResponse;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkAttrQueryResponseTest.class.getName());
+
+ /**
+ * Instantiates a new stork response test.
+ */
+ public StorkAttrQueryResponseTest() {
+ super();
+ }
+
+ /** The IP address. */
+ private static String ipAddress;
+
+ /** The destination URL. */
+ private static String destinationUrl;
+
+ /** The is hashing. */
+ private final boolean isHashing = Boolean.TRUE;
+
+ /** The is not hashing. */
+ private final boolean isNotHashing = Boolean.FALSE;
+
+ /** The ERROR text. */
+ private static final String ERROR_TXT = "generateAttrQueryResponse(...) should've thrown an STORKSAMLEngineException!";
+
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+
+ pal = new PersonalAttributeList();
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(false);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ pal.add(isAgeOver);
+
+ PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ pal.add(dateOfBirth);
+
+ PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ List<String> eid = Arrays.asList("IS/IS/1234567890");
+ eIDNumber.setValue(eid);
+ eIDNumber.setIsRequired(true);
+ pal.add(eIDNumber);
+
+ final PersonalAttribute givenName = new PersonalAttribute();
+ givenName.setName("givenName");
+ givenName.setIsRequired(true);
+ pal.add(givenName);
+
+ PersonalAttribute canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ pal.add(canRessAddress);
+
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ pal.add(newAttribute);
+
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ assertConsumerUrl = "http://S-PEPS.gov.xx/PEPS/ColleagueResponse";
+ spSector = "EDU001";
+ spInstitution = "OXF001";
+ spApplication = "APP001";
+ spCountry = "EN";
+
+ spId = "EDU001-APP001-APP001";
+
+ final STORKAttrQueryRequest request = new STORKAttrQueryRequest();
+ request.setDestination(destination);
+ //request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("IS");
+
+ try {
+ attrQueryRequest = getEngine().generateSTORKAttrQueryRequest(request)
+ .getTokenSaml();
+
+ attrQueryenRequest = getEngine().validateSTORKAttrQueryRequest(attrQueryRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ fail("Error create STORKAuthnRequest");
+ }
+
+ ipAddress = "111.222.333.444";
+
+ destinationUrl = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+
+ pal = new PersonalAttributeList();
+
+ isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ ages = new ArrayList<String>();
+
+ ages.add("16");
+ ages.add("18");
+
+ isAgeOver.setValue(ages);
+ isAgeOver.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(isAgeOver);
+
+ dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ final ArrayList<String> date = new ArrayList<String>();
+ date.add("16/12/2008");
+ dateOfBirth.setValue(date);
+ dateOfBirth.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(dateOfBirth);
+
+ eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ final ArrayList<String> idNumber = new ArrayList<String>();
+ idNumber.add("123456789IS");
+ eIDNumber.setValue(idNumber);
+ eIDNumber.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(eIDNumber);
+
+ canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ canRessAddress.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> address = new HashMap<String, String>();
+
+ address.put("state", state);
+ address.put("town", town);
+ address.put("postalCode", postalCode);
+ address.put("streetName", streetName);
+ address.put("streetNumber", streetNumber);
+
+ canRessAddress.setComplexValue(address);
+ pal.add(canRessAddress);
+
+ newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ newAttribute.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> values = new HashMap<String, String>();
+
+ values.put("value1", "value1");
+ values.put("value2", "value2");
+ values.put("value3", "value3");
+ values.put("value4", "value4");
+
+ newAttribute.setComplexValue(values);
+ pal.add(newAttribute);
+
+ }
+
+ /**
+ * Test generate attribute query request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAttrQueryResponse() throws STORKSAMLEngineException {
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(pal);
+
+ final STORKAttrQueryResponse storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, response, ipAddress,
+ destinationUrl, isNotHashing);
+
+ attrQueryResponse = storkResponse.getTokenSaml();
+
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(attrQueryResponse);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ LOG.info("RESPONSE: " + SSETestUtils.encodeSAMLToken(attrQueryResponse));
+
+
+ }
+
+ /**
+ * Test validation id parameter mandatory.
+ */
+ @Test
+ public final void testResponseMandatoryId() {
+ final String identifier = attrQueryenRequest.getSamlId();
+ attrQueryenRequest.setSamlId(null);
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest, response,
+ ipAddress, destinationUrl, isHashing);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ attrQueryenRequest.setSamlId(identifier);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate attribute query response in response to err1.
+ */
+ @Test
+ public final void testResponseMandatoryIssuer() {
+
+ final String issuer = attrQueryenRequest.getIssuer();
+ attrQueryenRequest.setIssuer(null);
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest, response,
+ ipAddress, destinationUrl, isHashing);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ attrQueryenRequest.setIssuer(issuer);
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test generate attribute query response assertion consumer null.
+ */
+ /*@Test
+ public final void testResponseMandatoryAssertionConsumerServiceURL() {
+ final String asserConsumerUrl = attrQueryenRequest
+ .getAssertionConsumerServiceURL();
+ attrQueryenRequest.setAssertionConsumerServiceURL(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+ try {
+ getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest, response,
+ ipAddress, isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ attrQueryenRequest.setAssertionConsumerServiceURL(asserConsumerUrl);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate attribute query response IP address null.
+ */
+ @Test
+ public final void testResponseValidationIP() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest, response, null,
+ destinationUrl, isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate attribute query response with personal attribute list null.
+ */
+ @Test
+ public final void testResponseMandatoryPersonalAttributeList() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(null);
+
+
+ try {
+ getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest, response,
+ ipAddress, destinationUrl, isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate attribute query response token null.
+ */
+ @Test
+ public final void testResponseInvalidParametersToken() {
+ try {
+ getEngine().validateSTORKAttrQueryResponse(null, ipAddress);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate attribute query response IP null.
+ */
+ @Test
+ public final void STORKAttrQueryResponse() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(pal);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate attribute query response parameter name wrong.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttr() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("AttrWrong");
+ wrongList.add(worngAttr);
+
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate attribute query response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrSimpleValue() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ worngAttr.setValue(null);
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate attribute query response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrNoValue() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate attribute query response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrNoName() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate attribute query response set null complex value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrComplexValue() {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ worngAttr.setComplexValue(null);
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponse(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+
+ /**
+ * Test validate attribute query response IP distinct and disabled validation
+ * IP.
+ */
+ @Test
+ public final void testResponseInvalidParametersIPDistinct() {
+ try {
+ // ipAddress origin "111.222.333.444"
+ // ipAddrValidation = false
+ // Subject Confirmation Bearer.
+
+ getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, "127.0.0.1");
+ } catch (STORKSAMLEngineException e) {
+ fail("validateAttributeQueryResponse(...) should've thrown an STORKSAMLEngineException!");
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test response invalid parameters invalid token.
+ */
+ @Test
+ public final void testResponseInvalidParametersTokenMsg() {
+ try {
+ // ipAddress origin "111.222.333.444"
+ // Subject Confirmation Bearer.
+ getEngine().validateSTORKAttrQueryResponse("errorMessage".getBytes(),
+ ipAddress);
+ fail("validateAuthenticationResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate attribute query response is fail.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ /*@Test
+ public final void testValidateAuthenticationResponseIsFail()
+ throws STORKSAMLEngineException {
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ assertFalse("Generate incorrect response: ", attrQeuryenResponse.isFail());
+ }
+
+ /**
+ * Test validate attribute query response destination.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthenticationResponseDestination()
+ throws STORKSAMLEngineException {
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ assertEquals("Destination incorrect: ",
+ attrQeuryenResponse.getInResponseTo(), attrQueryenRequest.getSamlId());
+ }
+
+ /**
+ * Test validate attribute query response values.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthenticationResponseValuesComplex()
+ throws STORKSAMLEngineException {
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ assertEquals("Country incorrect:", attrQeuryenResponse.getCountry(), "ES");
+
+ final Iterator<PersonalAttribute> iterator = attrQeuryenResponse
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+ final PersonalAttribute attribute = iterator.next();
+ if (attribute.getName().equalsIgnoreCase(
+ "canonicalResidenceAddress")) {
+ assertEquals("State incorrect: ", state, attribute
+ .getComplexValue().get("state"));
+ assertEquals("Town incorrect: ", town, attribute
+ .getComplexValue().get("town"));
+ assertEquals("Postal code incorrect: ", postalCode, attribute
+ .getComplexValue().get("postalCode"));
+ assertEquals("Street name incorrect: ", streetName, attribute
+ .getComplexValue().get("streetName"));
+ assertEquals("Street number incorrect: ", streetNumber,
+ attribute.getComplexValue().get("streetNumber"));
+ }
+ }
+ }
+
+ /**
+ * Test generate attribute query response fail in response to it's null.
+ * @throws STORKSAMLEngineException
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test //( expected=STORKSAMLEngineException.class)
+ public final void testGenerateAttrQueryResponseFailInResponseToNull() throws STORKSAMLEngineException {
+ final String identifier = attrQueryenRequest.getSamlId();
+ attrQueryenRequest.setSamlId(null);
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponseFail(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ attrQueryenRequest.setSamlId(identifier);
+ LOG.error("Error");
+ //throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Test generate attribute query response fail assertion consumer URL err1.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ /*@Test
+ public final void testGenerateAuthnResponseFailAssertionConsumerUrlNull()
+ throws STORKSAMLEngineException {
+
+ final String assertConsumerUrl = attrQueryenRequest
+ .getAssertionConsumerServiceURL();
+ attrQueryenRequest.setAssertionConsumerServiceURL(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ attrQueryResponse = getEngine().generateSTORKAuthnResponseFail(attrQueryenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ fail("generateAuthnResponseFail(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ attrQueryenRequest.setAssertionConsumerServiceURL(assertConsumerUrl);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate attribute query response fail code error err1.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAttrQueryResponseFailCodeErrorNull()
+ throws STORKSAMLEngineException {
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setStatusCode(null);
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponseFail(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+ fail("generateAttrQueryResponseFail(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+
+ /**
+ * Test generate attribute query request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryResponse() throws STORKSAMLEngineException {
+
+ IPersonalAttributeList palist = new PersonalAttributeList();
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ isAgeOver.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ palist.add(isAgeOver);
+
+ PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ final ArrayList<String> date = new ArrayList<String>();
+ date.add("16/12/2008");
+ dateOfBirth.setValue(date);
+ dateOfBirth.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ palist.add(dateOfBirth);
+
+
+ PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+
+ final ArrayList<String> idNumber = new ArrayList<String>();
+ idNumber.add("123456789PÑ");
+
+ final HashMap<String, String> complex = new HashMap<String, String>();
+ complex.put("one", "two");
+
+ //eIDNumber.setValue(null);
+ //eIDNumber.setValue(idNumber);
+ //eIDNumber.setComplexValue(complex);
+
+ eIDNumber.setStatus(STORKStatusCode.STATUS_NOT_AVAILABLE.toString());
+ palist.add(eIDNumber);
+
+ PersonalAttribute canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ canRessAddress.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> address = new HashMap<String, String>();
+
+ address.put("state", state);
+ address.put("town", town);
+ address.put("postalCode", postalCode);
+ address.put("streetName", streetName);
+ address.put("streetNumber", streetNumber);
+
+ canRessAddress.setComplexValue(address);
+ palist.add(canRessAddress);
+
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+
+ response.setPersonalAttributeList(palist);
+
+ final STORKAttrQueryResponse storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, response, ipAddress,
+ destinationUrl, isNotHashing);
+
+ attrQueryResponse = storkResponse.getTokenSaml();
+ LOG.info("Request id: " + attrQueryenRequest.getSamlId());
+
+ LOG.info("RESPONSE: " + SSETestUtils.encodeSAMLToken(attrQueryResponse));
+
+
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ LOG.info("RESPONSE ID: " + attrQeuryenResponse.getSamlId());
+ LOG.info("RESPONSE IN_RESPONSE_TO: " + attrQeuryenResponse.getInResponseTo());
+ LOG.info("RESPONSE COUNTRY: " + attrQeuryenResponse.getCountry());
+
+ }
+
+
+
+
+
+ /**
+ * Test validate attribute query response fail is fail.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAttrQueryResponseFailIsFail()
+ throws STORKSAMLEngineException {
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("message");
+
+ attrQueryResponse = getEngine().generateSTORKAttrQueryResponseFail(attrQueryenRequest,
+ response, ipAddress, destinationUrl, isNotHashing).getTokenSaml();
+
+ LOG.error("ERROR_FAIL: " + PEPSUtil.encodeSAMLToken(attrQueryResponse));
+
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ LOG.info("COUNTRY: " + attrQeuryenResponse.getCountry());
+ assertTrue("Generate incorrect response: ", attrQeuryenResponse.isFail());
+ }
+
+ /**
+ * Test generate/validate response with signedDoc
+ *
+ * @throws STORKSAMLEngineException
+ * the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAttrQueryResponseWithSignedDoc()
+ throws STORKSAMLEngineException {
+
+ String signedDocResponse = "<dss:SignResponse xmlns:dss=\"urn:oasis:names:tc:dss:1.0:core:schema\" RequestID=\"123456\"> <dss:Result> <dss:ResultMajor>urn:oasis:names:tc:dss:1.0:resultmajor:Success</dss:ResultMajor> </dss:Result> <dss:SignatureObject> <dss:Base64Signature Type=\"urn:ietf:rfc:3275\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1TaWduYXR1cmUiPjxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvVFIvMjAwMS9SRUMteG1sLWMxNG4tMjAwMTAzMTUiLz48ZHM6U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI3JzYS1zaGExIi8+PGRzOlJlZmVyZW5jZSBJZD0iUmVmZXJlbmNlLWJhYmE0ZDFhLWExN2UtNDJjNi05N2QyLWJlZWUxMzUwOTUwMyIgVHlwZT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI09iamVjdCIgVVJJPSIjT2JqZWN0LTk4NzMzY2RlLThiY2MtNDhhMC05Yjc3LTBlOTk5N2JkZDA1OCI+PGRzOlRyYW5zZm9ybXM+PGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNiYXNlNjQiLz48L2RzOlRyYW5zZm9ybXM+PGRzOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzOkRpZ2VzdFZhbHVlPkNrMVZxTmQ0NVFJdnEzQVpkOFhZUUx2RWh0QT08L2RzOkRpZ2VzdFZhbHVlPjwvZHM6UmVmZXJlbmNlPjxkczpSZWZlcmVuY2UgVHlwZT0iaHR0cDovL3VyaS5ldHNpLm9yZy8wMTkwMyNTaWduZWRQcm9wZXJ0aWVzIiBVUkk9IiNTaWduYXR1cmUtOGVhYmQwYTUtNjYwZC00YWZkLTk5MDUtMGFiYzc1NTNkMTkyLVNpZ25lZFByb3BlcnRpZXMiPjxkczpEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT5BNVk5MW40cXBMZ3l0VFc3ZnhqWENVZVJ2NTQ9PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48ZHM6UmVmZXJlbmNlIFVSST0iI1NpZ25hdHVyZS04ZWFiZDBhNS02NjBkLTRhZmQtOTkwNS0wYWJjNzU1M2QxOTItS2V5SW5mbyI+PGRzOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzOkRpZ2VzdFZhbHVlPlZQWDRuS0Z5UzZyRitGNmNSUjBQck5aZHc2Zz08L2RzOkRpZ2VzdFZhbHVlPjwvZHM6UmVmZXJlbmNlPjwvZHM6U2lnbmVkSW5mbz48ZHM6U2lnbmF0dXJlVmFsdWUgSWQ9IlNpZ25hdHVyZS04ZWFiZDBhNS02NjBkLTRhZmQtOTkwNS0wYWJjNzU1M2QxOTItU2lnbmF0dXJlVmFsdWUiPkxiS04vL0M3WGt5eFR0WVRpQ1VScjhuWnp4QW1zdGNNZDBDZ0VBQ3JLMWR5Z1JIcUdjSzR4dHMrV0NVOFB5RXFXclJJVFl6SXV3LzcNClY0Wno5VFQ2MHA0S1RNZXd1UUw2NHNrRVN4MllnMkVkaWtTTyt0S3hXa2hyYVVzbVZiR2JQbW1jbUR2OTd0SER3ODg3NDdlRnE1RjUNCnYrYVZTeUF6MDNpVUttdVNlSDg9PC9kczpTaWduYXR1cmVWYWx1ZT48ZHM6S2V5SW5mbyBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1LZXlJbmZvIj48ZHM6S2V5VmFsdWU+PGRzOlJTQUtleVZhbHVlPjxkczpNb2R1bHVzPnd1Y21qOXRJV3J2d2JTVFVEZndLbCtKdERNTUVSMGNMZDZEa0JTcjc5MHQrckdOakVTcVlqUndFSWVCbktvUUhQeDVIb1JlRjg4L3QNCnFZOStDaEVYcExITHM5cDVhWDdTREp1YnBRTWZwMXRERlgzNHl3Z3hTUXZjZWVKUVdCWGppZXVJbWZDMjFzNGJPY2dKYlYxaGJpZ1MNCnpPS1RRS3IxVHpkR1IrdVJ5MDA9PC9kczpNb2R1bHVzPjxkczpFeHBvbmVudD5BUUFCPC9kczpFeHBvbmVudD48L2RzOlJTQUtleVZhbHVlPjwvZHM6S2V5VmFsdWU+PGRzOlg1MDlEYXRhPjxkczpYNTA5Q2VydGlmaWNhdGU+TUlJSW1UQ0NCNEdnQXdJQkFnSURBWFVVTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUlCT3pFTE1Ba0dBMVVFQmhNQ1JWTXhPekE1QmdOVg0KQkFvVE1rRm5aVzVqYVdFZ1EyRjBZV3hoYm1FZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUNoT1NVWWdVUzB3T0RBeE1UYzJMVWtwTVRRdw0KTWdZRFZRUUhFeXRRWVhOellYUm5aU0JrWlNCc1lTQkRiMjVqWlhCamFXOGdNVEVnTURnd01EZ2dRbUZ5WTJWc2IyNWhNUzR3TEFZRA0KVlFRTEV5VlRaWEoyWldseklGQjFZbXhwWTNNZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUVWRFZpMHlNVFV3TXdZRFZRUUxFeXhXWldkbA0KZFNCb2RIUndjem92TDNkM2R5NWpZWFJqWlhKMExtNWxkQzkyWlhKRFNVTXRNaUFvWXlrd016RTFNRE1HQTFVRUN4TXNSVzUwYVhSaA0KZENCd2RXSnNhV05oSUdSbElHTmxjblJwWm1sallXTnBieUJrWlNCamFYVjBZV1JoYm5NeEd6QVpCZ05WQkFNVEVsQlNSVkJTVDBSVg0KUTBOSlR5QkpSRU5oZERBZUZ3MHhNREF5TVRFeE9ESXlNRFJhRncweE5EQXlNVEF4T0RJeU1EUmFNSUd3TVFzd0NRWURWUVFHRXdKRg0KVXpFMU1ETUdBMVVFQ3hNc1ZtVm5aWFVnYUhSMGNITTZMeTkzZDNjdVkyRjBZMlZ5ZEM1dVpYUXZkbVZ5U1VSRFlYUWdLR01wTURNeA0KRmpBVUJnTlZCQVFURFVKRlVreEJUa2RCSUZOUFZFOHhGekFWQmdOVkJDb1REazFCVWtsQklFVk9SMUpCUTBsQk1SSXdFQVlEVlFRRg0KRXdreE1EQXdNRGswTkZNeEpUQWpCZ05WQkFNVEhFMUJVa2xCSUVWT1IxSkJRMGxCSUVKRlVreEJUa2RCSUZOUFZFOHdnWjh3RFFZSg0KS29aSWh2Y05BUUVCQlFBRGdZMEFNSUdKQW9HQkFNTG5Kby9iU0ZxNzhHMGsxQTM4Q3BmaWJRekRCRWRIQzNlZzVBVXErL2RMZnF4ag0KWXhFcW1JMGNCQ0hnWnlxRUJ6OGVSNkVYaGZQUDdhbVBmZ29SRjZTeHk3UGFlV2wrMGd5Ym02VURINmRiUXhWOStNc0lNVWtMM0huaQ0KVUZnVjQ0bnJpSm53dHRiT0d6bklDVzFkWVc0b0VzemlrMENxOVU4M1JrZnJrY3ROQWdNQkFBR2pnZ1N3TUlJRXJEQU1CZ05WSFJNQg0KQWY4RUFqQUFNQTRHQTFVZER3RUIvd1FFQXdJRm9EQ0J6QVlEVlIwUkJJSEVNSUhCZ1E5aWMyOTBiMEJuYldGcGJDNWpiMjJrZ1lVdw0KZ1lJeEN6QUpCZ05WQkFZVEFrVlRNU3N3S1FZRFZRUUtGQ0pCWjhPb2JtTnBZU0JEWVhSaGJHRnVZU0JrWlNCRFpYSjBhV1pwWTJGag0KYWNPek1RNHdEQVlEVlFRTEV3VkpSRU5CVkRFUE1BMEdBMVVFQlJNR01ERTNOVEUwTVNVd0l3WURWUVFERXh4TlFWSkpRU0JGVGtkUw0KUVVOSlFTQkNSVkpNUVU1SFFTQlRUMVJQb0JBR0Npc0dBUVFCOVhnQkFRR2dBZ3dBb0JRR0RsWUVBQUVEQmdFRUFmVjRBUUVDb0FJTQ0KQURBZkJnTlZIUklFR0RBV2dSUmxZMTlwWkdOaGRFQmpZWFJqWlhKMExtNWxkREFkQmdOVkhRNEVGZ1FVQUZYanVOc2tCMk1seXZVQg0KaDdwOFRKMHVKMHd3Z2dGSUJnTlZIU01FZ2dFL01JSUJPNEFVUkt2Y2tVaE4xNGg0Q24vZ2RPRG42NzIzS1Z5aGdnRVBwSUlCQ3pDQw0KQVFjeEN6QUpCZ05WQkFZVEFrVlRNVHN3T1FZRFZRUUtFekpCWjJWdVkybGhJRU5oZEdGc1lXNWhJR1JsSUVObGNuUnBabWxqWVdOcA0KYnlBb1RrbEdJRkV0TURnd01URTNOaTFKS1RFb01DWUdBMVVFQ3hNZlUyVnlkbVZwY3lCUWRXSnNhV056SUdSbElFTmxjblJwWm1sag0KWVdOcGJ6RThNRG9HQTFVRUN4TXpWbVZuWlhVZ2FIUjBjSE02THk5M2QzY3VZMkYwWTJWeWRDNXVaWFF2ZG1WeWNISmxjSEp2WkhWag0KWTJsdklDaGpLVEF6TVRVd013WURWUVFMRXl4S1pYSmhjbkYxYVdFZ1JXNTBhWFJoZEhNZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUVOaA0KZEdGc1lXNWxjekVjTUJvR0ExVUVBeE1UVUZKRlVGSlBSRlZEUTBsUElFVkRMVUZEUTRJUWR3S1R0TTFFRVU5RkVQWFVZSGdnaERBZA0KQmdOVkhTVUVGakFVQmdnckJnRUZCUWNEQWdZSUt3WUJCUVVIQXdRd0VRWUpZSVpJQVliNFFnRUJCQVFEQWdXZ01EUUdDQ3NHQVFVRg0KQndFQkJDZ3dKakFrQmdnckJnRUZCUWN3QVlZWWFIUjBjSE02THk5dlkzTndMbU5oZEdObGNuUXVibVYwTUJnR0NDc0dBUVVGQndFRA0KQkF3d0NqQUlCZ1lFQUk1R0FRRXdnWVlHQTFVZEh3Ui9NSDB3UEtBNm9EaUdObWgwZEhBNkx5OWxjSE5qWkM1allYUmpaWEowTG01bA0KZEM5amNtd3ZjSEpsY0hKdlpIVmpZMmx2WDJWakxXbGtZMkYwTG1OeWJEQTlvRHVnT1lZM2FIUjBjRG92TDJWd2MyTmtNaTVqWVhSag0KWlhKMExtNWxkQzlqY213dmNISmxjSEp2WkhWalkybHZYMlZqTFdsa1kyRjBMbU55YkRDQjlnWURWUjBnQklIdU1JSHJNSUhvQmd3cg0KQmdFRUFmVjRBUU1CVmdFd2dkY3dMQVlJS3dZQkJRVUhBZ0VXSUdoMGRIQnpPaTh2ZDNkM0xtTmhkR05sY25RdWJtVjBMM1psY2tsRQ0KUTJGME1JR21CZ2dyQmdFRkJRY0NBakNCbVJxQmxrRnhkV1Z6ZENEdnY3MXpJSFZ1SUdObGNuUnBabWxqWVhRZ2NHVnljMjl1WVd3Zw0KU1VSRFFWUXNJSEpsWTI5dVpXZDFkQ0JrSjJsa1pXNTBhV1pwWTJGajc3KzlMQ0J6YVdkdVlYUjFjbUVnYVNCNGFXWnlZWFFnWkdVZw0KWTJ4aGMzTmxJRElnYVc1a2FYWnBaSFZoYkM0Z1ZtVm5aWFVnYUhSMGNITTZMeTkzZDNjdVkyRjBZMlZ5ZEM1dVpYUXZkbVZ5UkVOaA0KZERBdEJnTlZIUWtFSmpBa01CQUdDQ3NHQVFVRkJ3a0VNUVFUQWtWVE1CQUdDQ3NHQVFVRkJ3a0ZNUVFUQWtWVE1BMEdDU3FHU0liMw0KRFFFQkJRVUFBNElCQVFDcTc3ODBSR1FNTEIxZ2tkTk1mTFhuZ3FNb1JIR0taYnZ6a3JxSUFtVDhXQWQxRThyQXBoUjkveExKVXRwNQ0KbGJnMmZScjVibDJqOE9WREJLMlltRzQxaDhBRG40U1RJL0FwZU5JTlNmalpzNk5Sc25XekZ5ZlhYbVBDSFlGQi9YV3p5aW1DRXhndg0KdnR1SCszUUF3Y3dobjUwUExFdWh3NUM1dmxYN0x5NUs2ckxMTUZOVVVNYldWeTFoWmVsSy9DQlRjQWpJTzM4TlkrdllSQU1LU2Y0TQ0KL2daUXo0cUJlRlZKYTUyUjdOY0FxQ2ZyZkxmYVhwYkRTZzk4eG9CZU5zMmluR3p4OFVTZ0VyTFpqS0pzZG4vS2pURDlnUy9zVGRRNg0KUTdpZHFsZDJMRlZsTzIvYjk0Wk5aQmNTLzc4RU9EWGdkV2ZreVBDN1J3OHJlOW5JMy9qVDwvZHM6WDUwOUNlcnRpZmljYXRlPjwvZHM6WDUwOURhdGE+PC9kczpLZXlJbmZvPjxkczpPYmplY3QgRW5jb2Rpbmc9ImJhc2U2NCIgSWQ9Ik9iamVjdC05ODczM2NkZS04YmNjLTQ4YTAtOWI3Ny0wZTk5OTdiZGQwNTgiIE1pbWVUeXBlPSJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iPlNHVnNiRzhnVjI5eWJHUT08L2RzOk9iamVjdD48ZHM6T2JqZWN0Pjx4YWRlczpRdWFsaWZ5aW5nUHJvcGVydGllcyB4bWxuczp4YWRlcz0iaHR0cDovL3VyaS5ldHNpLm9yZy8wMTkwMy92MS4zLjIjIiBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1RdWFsaWZ5aW5nUHJvcGVydGllcyIgVGFyZ2V0PSIjU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1TaWduYXR1cmUiPjx4YWRlczpTaWduZWRQcm9wZXJ0aWVzIElkPSJTaWduYXR1cmUtOGVhYmQwYTUtNjYwZC00YWZkLTk5MDUtMGFiYzc1NTNkMTkyLVNpZ25lZFByb3BlcnRpZXMiPjx4YWRlczpTaWduZWRTaWduYXR1cmVQcm9wZXJ0aWVzPjx4YWRlczpTaWduaW5nVGltZT4yMDExLTAzLTIxVDExOjQ0OjQyKzAxOjAwPC94YWRlczpTaWduaW5nVGltZT48eGFkZXM6U2lnbmluZ0NlcnRpZmljYXRlPjx4YWRlczpDZXJ0Pjx4YWRlczpDZXJ0RGlnZXN0PjxkczpEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT4zbTZ3OTlUb3lTZDlKcEJsMWdCazhEei9iYlU9PC9kczpEaWdlc3RWYWx1ZT48L3hhZGVzOkNlcnREaWdlc3Q+PHhhZGVzOklzc3VlclNlcmlhbD48ZHM6WDUwOUlzc3Vlck5hbWU+Q049UFJFUFJPRFVDQ0lPIElEQ2F0LCBPVT1FbnRpdGF0IHB1YmxpY2EgZGUgY2VydGlmaWNhY2lvIGRlIGNpdXRhZGFucywgT1U9VmVnZXUgaHR0cHM6Ly93d3cuY2F0Y2VydC5uZXQvdmVyQ0lDLTIgKGMpMDMsIE9VPVNlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8gRUNWLTIsIEw9UGFzc2F0Z2UgZGUgbGEgQ29uY2VwY2lvIDExIDA4MDA4IEJhcmNlbG9uYSwgTz1BZ2VuY2lhIENhdGFsYW5hIGRlIENlcnRpZmljYWNpbyAoTklGIFEtMDgwMTE3Ni1JKSwgQz1FUzwvZHM6WDUwOUlzc3Vlck5hbWU+PGRzOlg1MDlTZXJpYWxOdW1iZXI+OTU1MDg8L2RzOlg1MDlTZXJpYWxOdW1iZXI+PC94YWRlczpJc3N1ZXJTZXJpYWw+PC94YWRlczpDZXJ0PjwveGFkZXM6U2lnbmluZ0NlcnRpZmljYXRlPjwveGFkZXM6U2lnbmVkU2lnbmF0dXJlUHJvcGVydGllcz48eGFkZXM6U2lnbmVkRGF0YU9iamVjdFByb3BlcnRpZXM+PHhhZGVzOkRhdGFPYmplY3RGb3JtYXQgT2JqZWN0UmVmZXJlbmNlPSIjUmVmZXJlbmNlLWJhYmE0ZDFhLWExN2UtNDJjNi05N2QyLWJlZWUxMzUwOTUwMyI+PHhhZGVzOk1pbWVUeXBlPmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTwveGFkZXM6TWltZVR5cGU+PHhhZGVzOkVuY29kaW5nPmJhc2U2NDwveGFkZXM6RW5jb2Rpbmc+PC94YWRlczpEYXRhT2JqZWN0Rm9ybWF0PjwveGFkZXM6U2lnbmVkRGF0YU9iamVjdFByb3BlcnRpZXM+PC94YWRlczpTaWduZWRQcm9wZXJ0aWVzPjwveGFkZXM6UXVhbGlmeWluZ1Byb3BlcnRpZXM+PC9kczpPYmplY3Q+PC9kczpTaWduYXR1cmU+</dss:Base64Signature> </dss:SignatureObject> </dss:SignResponse>";
+
+ IPersonalAttributeList palist = new PersonalAttributeList();
+
+ PersonalAttribute signedDoc = new PersonalAttribute();
+ signedDoc.setName("signedDoc");
+ signedDoc.setIsRequired(false);
+ ArrayList<String> signed = new ArrayList<String>();
+ signed.add(signedDocResponse);
+ signedDoc.setValue(signed);
+ palist.add(signedDoc);
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(false);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ palist.add(isAgeOver);
+
+ attrQueryenRequest.setPersonalAttributeList(palist);
+
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+
+ response.setPersonalAttributeList(palist);
+
+ final STORKAttrQueryResponse storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, response, ipAddress,
+ destinationUrl, isNotHashing);
+
+ attrQueryResponse = storkResponse.getTokenSaml();
+ attrQeuryenResponse = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse,
+ ipAddress);
+
+ assertTrue("SignedDoc response should be the same: ", attrQeuryenResponse
+ .getPersonalAttributeList().get("signedDoc").getValue().get(0)
+ .equals(signedDocResponse));
+
+ }
+
+ @Test
+ public final void testEncodeDecode() {
+ STORKAttrQueryRequest attrRequest = new STORKAttrQueryRequest();
+ STORKAttrQueryRequest request;
+ IPersonalAttributeList list = null;
+ boolean outcome = false;
+
+ try {
+ //STEP 1: Create the STORKAttrQueryRequest and get the SAML bytes
+ attrRequest.setSpSector("NOT AVAILABLE");
+ attrRequest.setSpInstitution("NOT AVAILABLE");
+ attrRequest.setSpApplication("NOT AVAILABLE");
+ attrRequest.setSpCountry("NOT AVAILABLE");
+
+ attrRequest.setIssuer("123");
+ attrRequest.setDestination("456");
+ attrRequest.setAssertionConsumerServiceURL("789");
+ attrRequest.setQaa(2);
+ attrRequest.setPersonalAttributeList(pal);
+
+ System.out.println("Original PAL:");
+ System.out.println(pal.toString());
+
+ attrRequest = engine.generateSTORKAttrQueryRequest(attrRequest);
+
+ byte[] saml = attrRequest.getTokenSaml();
+
+ //STEP 2: RE-Create the STORKAttrQueryRequest from the SAML bytes
+ request = engine.validateSTORKAttrQueryRequest(saml);
+
+ System.out.println("STORKAttrQueryRequest Issuer: " + request.getIssuer());
+ System.out.println("STORKAttrQueryRequest Destination: " + request.getDestination());
+ System.out.println("STORKAttrQueryRequest ServiceURL: " + request.getAssertionConsumerServiceURL());
+ System.out.println("STORKAttrQueryRequest Attributes: " + request.getPersonalAttributeList().toString());
+ System.out.println("STORKAttrQueryRequest QAA: " + request.getQaa());
+ //------------------------------
+ list = request.getPersonalAttributeList();
+
+ List<String> values = new ArrayList<String>();
+ values.add("test1");
+ values.add("test2");
+ values.add("test3");
+ list.get("newAttribute2").setValue(values);
+
+ System.out.println("Values added in newAttribute2 PAL:");
+ System.out.println(list.toString());
+
+ //////////////////////////////////////////////////////////////////////////
+ final STORKAttrQueryResponse response = new STORKAttrQueryResponse();
+ response.setPersonalAttributeList(list);
+
+ final STORKAttrQueryResponse storkResponse =
+ engine.generateSTORKAttrQueryResponse(request, response, "127.0.0.1",
+ request.getAssertionConsumerServiceURL(), false);
+
+ byte[] samlBytes = storkResponse.getTokenSaml();
+
+ //STEP 3: RE-Create the STORKAttrQueryResponse from the SAML bytes
+ STORKAttrQueryResponse attrResponse = null;
+ attrResponse =
+ engine.validateSTORKAttrQueryResponse(samlBytes, "127.0.0.1");
+
+ System.out.println("Response decoded PAL:");
+ System.out.println(attrResponse.getPersonalAttributeList().toString());
+
+ values = attrResponse.getPersonalAttributeList().get("newAttribute2").getValue();
+ if ( values.contains("test1") && values.contains("test2") && values.contains("test3") )
+ outcome = true;
+ } catch (final STORKSAMLEngineException e) {
+ LOG.error("Errror genereating SAML Token for Authentication Request", e);
+ }
+
+ assertTrue(outcome);
+ }
+
+ @Test
+ public final void testGenerateAttrRequestWithMultipleAssertions()
+ throws STORKSAMLEngineException {
+ STORKAttrQueryRequest req = null;
+ STORKAttrQueryResponse res0 = null;
+ STORKAttrQueryResponse res1 = null;
+ STORKAttrQueryResponse res2 = null;
+ STORKAttrQueryResponse res = null;
+ STORKAttrQueryResponse restotal = null;
+
+ try {
+ req = getEngine().validateSTORKAttrQueryRequest(attrQueryRequest);
+
+ attrQueryenRequest = getEngine().validateSTORKAttrQueryRequest(attrQueryRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ fail("Error validating STORKAuthnRequest");
+ }
+
+ IPersonalAttributeList pList = req.getPersonalAttributeList();
+ for (int i =0; i < pList.size(); i++)
+ {
+ PersonalAttribute attr = pList.get("dateOfBirth");
+ attr.setValue(Arrays.asList("19820919"));
+ pList.remove("dateOfBirth");
+ pList.add(attr);
+ PersonalAttribute attr1 = pList.get("givenName");
+ attr1.setValue(Arrays.asList("Sveinborn Oskarsson"));
+ pList.remove("givenName");
+ pList.add(attr1);
+ PersonalAttribute attr2 = pList.get("isAgeOver");
+ attr2.setValue(Arrays.asList("true"));
+ pList.remove("isAgeOver");
+ pList.add(attr2);
+ }
+
+ res = new STORKAttrQueryResponse();
+ res.setPersonalAttributeList(pList);
+
+ STORKAttrQueryResponse storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(req, res, ipAddress,
+ destinationUrl, isNotHashing);
+
+ res0 = getEngine().validateSTORKAttrQueryResponse(storkResponse.getTokenSaml(), ipAddress);
+
+ storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(req, res, ipAddress,
+ destinationUrl, isNotHashing);
+ res1 = getEngine().validateSTORKAttrQueryResponse(storkResponse.getTokenSaml(), ipAddress);
+
+ storkResponse = getEngine()
+ .generateSTORKAttrQueryResponse(req, res, ipAddress,
+ destinationUrl, isNotHashing);
+ res2 = getEngine().validateSTORKAttrQueryResponse(storkResponse.getTokenSaml(), ipAddress);
+
+ List<STORKAttrQueryResponse> responses = new ArrayList();
+ responses.add(res0);
+ responses.add(res1);
+ responses.add(res2);
+
+ STORKAttrQueryResponse resfinal = new STORKAttrQueryResponse();
+ storkResponse = getEngine().generateSTORKAttrQueryResponseWithAssertions(req, resfinal, responses,
+ ipAddress, destinationUrl, isNotHashing);
+
+ attrQueryResponse = storkResponse.getTokenSaml();
+ FileOutputStream output = null;
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryMultiAssertResponse.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(attrQueryResponse);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ res = null;
+ res = getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress);
+ System.out.println(res.getTotalPersonalAttributeList().toString());
+ assertNotNull(res);
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAuthRequestTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAuthRequestTest.java
new file mode 100644
index 000000000..02a8a6fab
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkAuthRequestTest.java
@@ -0,0 +1,968 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+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;
+
+/**
+ * The Class StorkAuthRequestTest defines a class to .
+ */
+public class StorkAuthRequestTest {
+
+ /** The engines. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+ private static STORKSAMLEngine engine2 = STORKSAMLEngine.getInstance("CONF2");
+ private static STORKSAMLEngine engine3 = STORKSAMLEngine.getInstance("CONF3");
+
+
+ /**
+ * Instantiates a new stork authentication request test.
+ */
+ public StorkAuthRequestTest() {
+ pal = new PersonalAttributeList();
+
+ final PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ final ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ pal.add(isAgeOver);
+
+ final PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ pal.add(dateOfBirth);
+
+ final PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ pal.add(eIDNumber);
+
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ assertConsumerUrl = "http://S-PEPS.gov.xx/PEPS/ColleagueResponse";
+
+ spName = "University of Oxford";
+ spSector = "EDU001";
+ spInstitution = "OXF001";
+ spApplication = "APP001";
+ spCountry = "EN";
+
+ spId = "EDU001-OXF001-APP001";
+
+ }
+
+ /** The destination. */
+ private String destination;
+
+ /** The service provider name. */
+ private String spName;
+
+ /** The service provider sector. */
+ private String spSector;
+
+ /** The service provider institution. */
+ private String spInstitution;
+
+ /** The service provider application. */
+ private String spApplication;
+
+ /** The service provider country. */
+ private String spCountry;
+
+ /** The service provider id. */
+ private String spId;
+
+ /** The quality authentication assurance level. */
+ private static final int QAAL = 3;
+
+ /** The List of Personal Attributes. */
+ private IPersonalAttributeList pal;
+
+ /** The assertion consumer URL. */
+ private String assertConsumerUrl;
+
+ /** The authentication request. */
+ private static byte[] authRequest;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkAuthRequestTest.class.getName());
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+ }
+
+ /**
+ * Test generate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnRequest() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ //engine.generateSTORKAuthnRequest(request);
+
+ LOG.info("STORKAuthnRequest 1: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAuthnRequest(request).getTokenSaml()));
+ request.setCitizenCountryCode("ES");
+ LOG.info("STORKAuthnRequest 2: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKAuthnRequest(request).getTokenSaml()));
+ }
+
+
+ /**
+ * Test generate authentication request error personal attribute name error.
+ */
+ @Test
+ public final void testGenerateAuthnRequestPALsErr1() {
+
+ final IPersonalAttributeList palWrong = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("attrNotValid");
+ worngAttr.setIsRequired(true);
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(palWrong);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+ /**
+ * Test generate authentication request error personal attribute value error.
+ */
+ @Test
+ public final void testGenerateAuthnRequestPALsErr2() {
+
+ final IPersonalAttributeList palWrong = new PersonalAttributeList();
+
+ final PersonalAttribute attrNotValid = new PersonalAttribute();
+ attrNotValid.setName("attrNotValid");
+ attrNotValid.setIsRequired(true);
+ palWrong.add(attrNotValid);
+
+
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(palWrong);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request error provider name null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestSPNAmeErr1() {
+
+
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(null);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try
+ {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ catch (STORKSAMLEngineException e)
+ {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request authentication assurance level
+ * negative value.
+ */
+ @Test
+ public final void testGenerateAuthnRequestQaalErr1() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(-1);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider sector null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestSectorErr() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(null);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider institution null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestInstitutionrErr() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(null);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider application null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestApplicationErr() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(null);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test generate authentication request service provider country null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestCountryErr() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(null);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request error with quality authentication
+ * assurance level wrong.
+ */
+ @Test
+ public final void testGenerateAuthnRequestQaalErr2() {
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(0);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request personal attribute list null value.
+ */
+ @Test
+ public final void testGenerateAuthnRequestPALErr1() {
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(null);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication request error with assertion consumer URL
+ * null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestAssertionConsumerErr1() {
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(null);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ engine.generateSTORKAuthnRequest(request);
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request null parameter.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestNullParam()
+ throws STORKSAMLEngineException {
+ try {
+ engine.validateSTORKAuthnRequest(null);
+ fail("validateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request error bytes encode.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestErrorEncode()
+ throws STORKSAMLEngineException {
+ try {
+ engine.validateSTORKAuthnRequest("messageError".getBytes());
+ fail("validateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequest() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ authRequest = engine.generateSTORKAuthnRequest(request).getTokenSaml();
+
+ final STORKAuthnRequest validatedRequest = engine.validateSTORKAuthnRequest(authRequest);
+
+ assertEquals("CrossBorderShare incorrect: ", validatedRequest.isEIDCrossBorderShare(), false);
+ assertEquals("CrossSectorShare incorrect: ", validatedRequest.isEIDCrossSectorShare(), false);
+ assertEquals("SectorShare incorrect: ", validatedRequest.isEIDSectorShare(), false);
+
+ }
+
+ /**
+ * Test validate data authenticate request. Verified parameters after
+ * validation.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateDataAuthnRequest() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = engine.validateSTORKAuthnRequest(authRequest);
+
+ assertEquals("Sestination incorrect: ", request.getDestination(), destination);
+
+ assertEquals("CrossBorderShare incorrect: ", request.isEIDCrossBorderShare(), false);
+ assertEquals("CrossSectorShare incorrect: ", request.isEIDCrossSectorShare(), false);
+ assertEquals("SectorShare incorrect: ", request.isEIDSectorShare(), false);
+
+ assertEquals("Service provider incorrect: ", request.getProviderName(), spName);
+ assertEquals("QAAL incorrect: ", request.getQaa(), QAAL);
+ assertEquals("SPSector incorrect: ", request.getSpSector(), spSector);
+ assertEquals("SPInstitution incorrect: ", request.getSpInstitution(), null);
+ assertEquals("SPApplication incorrect: ", request.getSpApplication(), spApplication);
+ assertEquals("Asserition consumer URL incorrect: ", request.getAssertionConsumerServiceURL(), assertConsumerUrl);
+
+ assertEquals("SP Country incorrect: ", request.getSpCountry(), spCountry);
+ assertEquals("SP Id incorrect: ", request.getSPID(), spId);
+ assertEquals("CitizenCountryCode incorrect: ", request.getCitizenCountryCode(), "ES");
+
+ }
+
+ /**
+ * Test validate file authentication request. Validate from XML file.
+ *
+ * @throws Exception the exception
+ */
+ @Test
+ public final void testValidateFileAuthnRequest() throws Exception {
+
+ final byte[] bytes = SSETestUtils.readStorkSamlFromFile("/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml");
+
+ try {
+ engine.validateSTORKAuthnRequest(bytes);
+ fail("testValidateFileAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error(e.getMessage());
+ }
+ }
+
+ /**
+ * Test validate file authentication request tag delete.
+ *
+ * @throws Exception the exception
+ */
+ @Test
+ public final void testValidateFileAuthnRequestTagDelete() throws Exception {
+
+ final byte[] bytes = SSETestUtils.readStorkSamlFromFile("/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml");
+
+ try {
+ engine.validateSTORKAuthnRequest(bytes);
+ fail("validateSTORKAuthnRequest(...) should have thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error(e.getMessage());
+
+ }
+ }
+
+ /**
+ * Test validate authentication request not trusted token.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestNotTrustedErr1()
+ throws STORKSAMLEngineException {
+
+ try {
+ final STORKSAMLEngine engineNotTrusted = STORKSAMLEngine
+ .getInstance("CONF2");
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+
+ final byte[] authReqNotTrust = engineNotTrusted
+ .generateSTORKAuthnRequest(request).getTokenSaml();
+
+ engine.validateSTORKAuthnRequest(authReqNotTrust);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("validateSTORKAuthnRequestNotTrusted(...) should not have thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test validate authentication request trusted.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestTrusted()
+ throws STORKSAMLEngineException {
+
+ final STORKSAMLEngine engineTrusted = STORKSAMLEngine
+ .getInstance("CONF3");
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+
+ final byte[] authReqNotTrust = engineTrusted.generateSTORKAuthnRequest(
+ request).getTokenSaml();
+
+ // engine ("CONF1") no have trust certificate from "CONF2"
+ engine.validateSTORKAuthnRequest(authReqNotTrust);
+
+ }
+
+
+
+
+ /**
+ * Test generate authentication request service provider application null.
+ */
+ @Test
+ public final void testGenerateAuthnRequestNADA() {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(null);
+ request.setSpInstitution(null);
+ request.setSpApplication(null);
+ request.setSpCountry(null);
+
+ try {
+
+ engine.validateSTORKAuthnRequest(authRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ fail("generateSTORKAuthnRequest(...) should've thrown an STORKSAMLEngineException!");
+ }
+ }
+
+ /**
+ * Test validate authentication request with unknown elements.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestWithUnknownElements() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute unknown = new PersonalAttribute();
+ unknown.setName("unknown");
+ unknown.setIsRequired(true);
+ pAttList.add(unknown);
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ STORKAuthnRequest req = new STORKAuthnRequest();
+
+ req = engine3.generateSTORKAuthnRequest(request);
+
+ req = engine.validateSTORKAuthnRequest(req.getTokenSaml());
+
+ assertNull("The value shouldn't exist", req.getPersonalAttributeList().get("unknown"));
+ assertNotNull("The value should exist", req.getPersonalAttributeList().get("eIdentifier"));
+
+ }
+
+ /**
+ * Test generate Request with required elements by default
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnRequestWithIsRequiredElementsByDefault() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ STORKAuthnRequest req = new STORKAuthnRequest();
+ STORKAuthnRequest reqTrue = new STORKAuthnRequest();
+ STORKAuthnRequest reqFalse = new STORKAuthnRequest();
+
+ reqTrue = engine.generateSTORKAuthnRequest(request);
+ reqFalse = engine2.generateSTORKAuthnRequest(request);
+ req = engine3.generateSTORKAuthnRequest(request);
+
+
+ String token = new String(req.getTokenSaml());
+ String reqTrueToken = new String(reqTrue.getTokenSaml());
+ String reqFalseToken = new String(reqFalse.getTokenSaml());
+
+ assertTrue("The token must contain the chain 'isRequired'", token.contains("isRequired"));
+ assertTrue("The token must contain the chain 'isRequired'", reqTrueToken.contains("isRequired"));
+ assertFalse("The token must contain the chain 'isRequired'", reqFalseToken.contains("isRequired"));
+
+ }
+
+ /**
+ * Test validating request and getting alias used to save
+ * the saml trusted certificate into trustore
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnRequestGettingItsAlias() throws STORKSAMLEngineException {
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ IPersonalAttributeList pAttList = new PersonalAttributeList();
+
+ final PersonalAttribute eIdentifier = new PersonalAttribute();
+ eIdentifier.setName("eIdentifier");
+ eIdentifier.setIsRequired(true);
+ pAttList.add(eIdentifier);
+
+ request.setPersonalAttributeList(pAttList);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ STORKAuthnRequest req = new STORKAuthnRequest();
+
+ req = engine3.generateSTORKAuthnRequest(request);
+ req = engine.validateSTORKAuthnRequest(req.getTokenSaml());
+ assertTrue("The alias should match this value", req.getAlias().equals("local-demo-cert"));
+
+ req = engine2.generateSTORKAuthnRequest(request);
+ req = engine2.validateSTORKAuthnRequest(req.getTokenSaml());
+ assertTrue("The alias should match this value", req.getAlias().equals("local-demo-cert"));
+
+
+
+ }
+
+ /**
+ * Test generating/validating request with signedDoc
+ *
+ * @throws STORKSAMLEngineException
+ * the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnRequestWithSignedDoc()
+ throws STORKSAMLEngineException {
+
+ String signedDocRequest = "<dss:SignRequest xmlns:dss=\"urn:oasis:names:tc:dss:1.0:core:schema\" RequestID=\"_d96b62a87d18f1095170c1f44c90b5fd\"><dss:InputDocuments><dss:Document><dss:Base64Data MimeType=\"text/plain\">VGVzdCB0ZXh0</dss:Base64Data></dss:Document></dss:InputDocuments></dss:SignRequest>";
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+
+ PersonalAttributeList paler = new PersonalAttributeList();
+
+ final PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ paler.add(eIDNumber);
+
+ final PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ final ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ paler.add(isAgeOver);
+
+ final PersonalAttribute signedDoc = new PersonalAttribute();
+ signedDoc.setName("signedDoc");
+ final ArrayList<String> signedDocs = new ArrayList<String>();
+ signedDocs.add(signedDocRequest);
+ signedDoc.setValue(signedDocs);
+ signedDoc.setIsRequired(false);
+ paler.add(signedDoc);
+
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(paler);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // new parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ STORKAuthnRequest req = new STORKAuthnRequest();
+
+ req = engine.generateSTORKAuthnRequest(request);
+ req = engine.validateSTORKAuthnRequest(req.getTokenSaml());
+
+ assertTrue("SignedDoc request should be the same: ", req
+ .getPersonalAttributeList().get("signedDoc").getValue().get(0)
+ .equals(signedDocRequest));
+
+
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutRequestTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutRequestTest.java
new file mode 100644
index 000000000..46904788f
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutRequestTest.java
@@ -0,0 +1,89 @@
+package eu.stork.peps.test.simple;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKLogoutRequest;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+
+public class StorkLogoutRequestTest {
+
+ /** The engines. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+ private static STORKSAMLEngine engine0 = STORKSAMLEngine.getInstance("CONF0");
+ private static STORKSAMLEngine engine2 = STORKSAMLEngine.getInstance("CONF2");
+ private static STORKSAMLEngine engine3 = STORKSAMLEngine.getInstance("CONF3");
+
+ public StorkLogoutRequestTest() {
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ spUserId = "IS/IS/1234567890";
+ }
+
+ /** The destination. */
+ private String destination;
+
+ /** The user id. */
+ private String spUserId;
+
+ /** The logout request. */
+ private static byte[] logoutRequest;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkLogoutRequestTest.class.getName());
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+ }
+
+ /**
+ * Test generate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateLogoutRequest() throws STORKSAMLEngineException {
+
+ final STORKLogoutRequest request = new STORKLogoutRequest();
+
+ request.setDestination(destination);
+
+ request.setSpProvidedId(spUserId);
+
+ STORKLogoutRequest req1 = engine0.generateSTORKLogoutRequest(request);
+ byte[] reqByte = req1.getTokenSaml();
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/LogoutRequest.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(reqByte);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ LOG.info("STORKAttrQueryRequest 1: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKLogoutRequest(request).getTokenSaml()));
+
+ LOG.info("STORKAttrQueryRequest 2: " + SSETestUtils.encodeSAMLToken(engine.generateSTORKLogoutRequest(request).getTokenSaml()));
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutResponseTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutResponseTest.java
new file mode 100644
index 000000000..2d05e04aa
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkLogoutResponseTest.java
@@ -0,0 +1,142 @@
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.STORKLogoutRequest;
+import eu.stork.peps.auth.commons.STORKLogoutResponse;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+
+public class StorkLogoutResponseTest {
+
+ /** The engines. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+ private static STORKSAMLEngine engine0 = STORKSAMLEngine.getInstance("CONF0");
+ private static STORKSAMLEngine engine2 = STORKSAMLEngine.getInstance("CONF2");
+ private static STORKSAMLEngine engine3 = STORKSAMLEngine.getInstance("CONF3");
+
+ public StorkLogoutResponseTest() {
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ spUserId = "IS/IS/1234567890";
+ }
+
+ /** The destination. */
+ private String destination;
+
+ /** The user id. */
+ private String spUserId;
+
+ /** The logout request. */
+ private static byte[] logoutRequest;
+
+ /** The logout response. */
+ private static byte[] logoutResponse;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkLogoutResponseTest.class.getName());
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+ }
+
+ /**
+ * Test generate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateLogoutRequest() throws STORKSAMLEngineException {
+
+ final STORKLogoutRequest request = new STORKLogoutRequest();
+
+ final STORKLogoutResponse response = new STORKLogoutResponse();
+
+ request.setDestination(destination);
+ response.setDestination(destination);
+
+ request.setSpProvidedId(spUserId);
+
+ STORKLogoutRequest req1 = engine0.generateSTORKLogoutRequest(request);
+
+ STORKLogoutResponse res = engine0.generateSTORKLogoutResponse(req1, response);
+
+ byte[] reqByte = res.getTokenSaml();
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/LogoutResponse.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(reqByte);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ assertNotNull(reqByte);
+ }
+
+ /**
+ * Test generate authentication request.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateLogoutRequestFail() throws STORKSAMLEngineException {
+
+ final STORKLogoutRequest request = new STORKLogoutRequest();
+
+ final STORKLogoutResponse response = new STORKLogoutResponse();
+
+ request.setDestination(destination);
+ response.setDestination(destination);
+ response.setStatusMessage("User not found.");
+ response.setStatusCode("1234");
+ request.setSpProvidedId(spUserId);
+
+ STORKLogoutRequest req1 = engine0.generateSTORKLogoutRequest(request);
+
+ STORKLogoutResponse res = engine0.generateSTORKLogoutResponseFail(req1, response);
+
+ byte[] reqByte = res.getTokenSaml();
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/LogoutResponseFail.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(reqByte);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ assertNotNull(reqByte);
+ }
+
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkNewResponseTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkNewResponseTest.java
new file mode 100644
index 000000000..62e9cfb18
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkNewResponseTest.java
@@ -0,0 +1,533 @@
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+
+public class StorkNewResponseTest {
+ /** The engine. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+ private static STORKSAMLEngine engine0 = STORKSAMLEngine.getInstance("CONF0");
+
+ /**
+ * Gets the engine.
+ *
+ * @return the engine
+ */
+ public static STORKSAMLEngine getEngine() {
+ return engine;
+ }
+
+ public static STORKSAMLEngine getEngine2() {
+ return engine0;
+ }
+
+ /**
+ * Sets the engine.
+ *
+ * @param newEngine the new engine
+ */
+ public static void setEngine(final STORKSAMLEngine newEngine) {
+ StorkNewResponseTest.engine = newEngine;
+ }
+
+ /** The destination. */
+ private static String destination;
+
+ /** The service provider name. */
+ private static String spName;
+
+ /** The service provider sector. */
+ private static String spSector;
+
+ /** The service provider institution. */
+ private static String spInstitution;
+
+ /** The service provider application. */
+ private static String spApplication;
+
+ /** The service provider country. */
+ private static String spCountry;
+
+ /** The service provider id. */
+ private static String spId;
+
+ /** The quality authentication assurance level. */
+ private static final int QAAL = 3;
+
+ /** The state. */
+ private static String state = "ES";
+
+ /** The town. */
+ private static String town = "Madrid";
+
+ /** The municipality code. */
+ private static String municipalityCode = "MA001";
+
+ /** The postal code. */
+ private static String postalCode = "28038";
+
+ /** The street name. */
+ private static String streetName = "Marchamalo";
+
+ /** The street number. */
+ private static String streetNumber = "3";
+
+ /** The apartament number. */
+ private static String apartamentNumber = "5º E";
+
+ /** The List of Personal Attributes. */
+ private static IPersonalAttributeList pal;
+
+ /** The List of Personal Attributes. */
+ private static IPersonalAttributeList pal2;
+
+ /** The assertion consumer URL. */
+ private static String assertConsumerUrl;
+
+ /** The authentication request. */
+ private static byte[] authRequest;
+
+ /** The authentication response. */
+ private static byte[] authResponse;
+
+ /** The authentication request. */
+ private static STORKAuthnRequest authenRequest;
+
+ /** The authentication response. */
+ private static STORKAuthnResponse authnResponse;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkResponseTest.class.getName());
+
+ /**
+ * Instantiates a new stork response test.
+ */
+ public StorkNewResponseTest() {
+ super();
+ }
+
+ /** The IP address. */
+ private static String ipAddress;
+
+ /** The is hashing. */
+ private final boolean isHashing = Boolean.TRUE;
+
+ /** The is not hashing. */
+ private final boolean isNotHashing = Boolean.FALSE;
+
+ /** The ERROR text. */
+ private static final String ERROR_TXT = "generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!";
+
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ /** The attribute query request. */
+ private static STORKAttrQueryRequest attrQueryenRequest;
+
+ /** The attribute query response. */
+ private static STORKAttrQueryResponse attrQeuryenResponse;
+
+ /** The attribute query request. */
+ private static byte[] attrQueryRequest;
+
+ /** The attribute query response. */
+ private static byte[] attrQueryResponse;
+
+
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+
+ pal = new PersonalAttributeList();
+ pal2 = new PersonalAttributeList();
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(false);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ pal.add(isAgeOver);
+
+ PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ pal.add(dateOfBirth);
+
+ PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ pal.add(eIDNumber);
+
+ final PersonalAttribute givenName = new PersonalAttribute();
+ givenName.setName("givenName");
+ givenName.setIsRequired(true);
+ pal.add(givenName);
+
+ PersonalAttribute canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ pal.add(canRessAddress);
+
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ pal.add(newAttribute);
+
+ PersonalAttribute hasDegree = new PersonalAttribute();
+ hasDegree.setName("hasDegree");
+ List<String> vals = new ArrayList<String>();
+ vals.add("Engineering");
+ vals.add("Computer Science");
+ hasDegree.setValue(vals);
+ pal2.add(hasDegree);
+
+ PersonalAttribute mandate = new PersonalAttribute();
+ mandate.setName("mandateContent");
+ List<String> manvalues = new ArrayList<String>();
+ manvalues.add("Powers");
+ mandate.setValue(manvalues);
+ pal2.add(mandate);
+
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ assertConsumerUrl = "http://S-PEPS.gov.xx/PEPS/ColleagueResponse";
+ spName = "University Oxford";
+
+ spName = "University of Oxford";
+ spSector = "EDU001";
+ spInstitution = "OXF001";
+ spApplication = "APP001";
+ spCountry = "EN";
+
+ spId = "EDU001-APP001-APP001";
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ authRequest = getEngine().generateSTORKAuthnRequest(request)
+ .getTokenSaml();
+
+ authenRequest = getEngine().validateSTORKAuthnRequest(authRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ fail("Error create STORKAuthnRequest");
+ }
+
+ ipAddress = "111.222.333.444";
+
+ pal = new PersonalAttributeList();
+
+ isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ ages = new ArrayList<String>();
+
+ ages.add("16");
+ ages.add("18");
+
+ isAgeOver.setValue(ages);
+ isAgeOver.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(isAgeOver);
+
+ dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ final ArrayList<String> date = new ArrayList<String>();
+ date.add("16/12/2008");
+ dateOfBirth.setValue(date);
+ dateOfBirth.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(dateOfBirth);
+
+ eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ final ArrayList<String> idNumber = new ArrayList<String>();
+ idNumber.add("123456789PA");
+ eIDNumber.setValue(idNumber);
+ eIDNumber.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(eIDNumber);
+
+ canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ canRessAddress.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> address = new HashMap<String, String>();
+
+ address.put("state", state);
+ address.put("municipalityCode", municipalityCode);
+ address.put("town", town);
+ address.put("postalCode", postalCode);
+ address.put("streetName", streetName);
+ address.put("streetNumber", streetNumber);
+ address.put("apartamentNumber", apartamentNumber);
+
+ canRessAddress.setComplexValue(address);
+ pal.add(canRessAddress);
+
+ newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ newAttribute.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> values = new HashMap<String, String>();
+
+ values.put("value1", "value1");
+ values.put("value2", "value2");
+ values.put("value3", "value3");
+ values.put("value4", "value4");
+
+ newAttribute.setComplexValue(values);
+ pal.add(newAttribute);
+
+ final STORKAttrQueryRequest arequest = new STORKAttrQueryRequest();
+ arequest.setDestination(destination);
+ //request.setProviderName(spName);
+ arequest.setQaa(QAAL);
+ arequest.setPersonalAttributeList(pal2);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ arequest.setSpSector(spSector);
+ arequest.setSpInstitution(spInstitution);
+ arequest.setSpApplication(spApplication);
+ arequest.setSpCountry(spCountry);
+ arequest.setSPID(spId);
+ arequest.setCitizenCountryCode("IS");
+ arequest.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ try {
+ attrQueryRequest = getEngine().generateSTORKAttrQueryRequest(arequest)
+ .getTokenSaml();
+
+ attrQueryenRequest = getEngine().validateSTORKAttrQueryRequest(attrQueryRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ fail("Error create STORKAuthnRequest");
+ }
+
+ }
+
+ /**
+ * Test generate authentication request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnResponseWithSimpleRes() throws STORKSAMLEngineException {
+
+ //Create the response holding pal
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ //List of query responses
+ List<STORKAttrQueryResponse> resList = new ArrayList<STORKAttrQueryResponse>();
+
+ final STORKAttrQueryResponse aResponse1 = new STORKAttrQueryResponse();
+ aResponse1.setPersonalAttributeList(pal2);
+
+ final STORKAttrQueryResponse aStorkResponse1 = getEngine2()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse1, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse1.getTokenSaml();
+
+ resList.add(getEngine2().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ final STORKAttrQueryResponse aResponse2 = new STORKAttrQueryResponse();
+ aResponse2.setPersonalAttributeList(pal2);
+
+ final STORKAttrQueryResponse aStorkResponse2 = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse2, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse2.getTokenSaml();
+
+ resList.add(getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ //Create the final response containing query responses
+ final STORKAuthnResponse storkResponse = getEngine()
+ .generateSTORKAuthnResponseAfterQuery(authenRequest, response, ipAddress,
+ isNotHashing, resList);
+
+ authResponse = storkResponse.getTokenSaml();
+
+ //Validate, write out and print out the attribute lists a
+ STORKAuthnResponse finalResponse = getEngine().validateSTORKAuthnResponseWithQuery(authResponse, ipAddress);
+ System.out.println("The original pal: " + finalResponse.getPersonalAttributeList().toString());
+ for (int i = 0; i < finalResponse.getPersonalAttributeLists().size(); i++)
+ {
+ System.out.println("Pal "+ Integer.toString(i) + ": " + finalResponse.getPersonalAttributeLists().get(i).toString());
+ }
+ System.out.println("The total pal: " + finalResponse.getTotalPersonalAttributeList().toString());
+
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthAttrQResponse.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(authResponse);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Test generate authentication request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnResponseWithComplexRes() throws STORKSAMLEngineException {
+
+ //Create the response holding pal
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ //Create a list for the attribute query responses we have
+ List<STORKAttrQueryResponse> resList = new ArrayList<STORKAttrQueryResponse>();
+
+ //Create the first attribute query response
+ final STORKAttrQueryResponse aResponse1 = new STORKAttrQueryResponse();
+ aResponse1.setPersonalAttributeList(pal2);
+
+ //Generate the first response
+ final STORKAttrQueryResponse aStorkResponse1 = getEngine2()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse1, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse1.getTokenSaml();
+
+ //Validate it and add to the response list
+ resList.add(getEngine2().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ //Create a second response like the first
+ final STORKAttrQueryResponse aResponse2 = new STORKAttrQueryResponse();
+ aResponse2.setPersonalAttributeList(pal2);
+
+ final STORKAttrQueryResponse aStorkResponse2 = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse2, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse2.getTokenSaml();
+
+ resList.add(getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ //Create a attribute query response which contains multiple assertions from an AP
+ final STORKAttrQueryResponse aResponseMulti = new STORKAttrQueryResponse();
+ aResponseMulti.setPersonalAttributeList(pal2);
+
+ //Create a list for the responses which the multiple assertion response will hold
+ List<STORKAttrQueryResponse> multiResponses = new ArrayList();
+
+ //Create two more simple responses which the multi assertion response will hold
+ final STORKAttrQueryResponse aResponse3 = new STORKAttrQueryResponse();
+ aResponse3.setPersonalAttributeList(pal2);
+
+ final STORKAttrQueryResponse aStorkResponse3 = getEngine2()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse3, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse3.getTokenSaml();
+ //Validate and add to the multi response
+ multiResponses.add(getEngine2().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ final STORKAttrQueryResponse aResponse4 = new STORKAttrQueryResponse();
+ aResponse4.setPersonalAttributeList(pal2);
+
+ final STORKAttrQueryResponse aStorkResponse4 = getEngine()
+ .generateSTORKAttrQueryResponse(attrQueryenRequest, aResponse4, ipAddress,
+ destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponse4.getTokenSaml();
+
+ multiResponses.add(getEngine2().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ //Generate the multi assertion query response
+ final STORKAttrQueryResponse aStorkResponseMulti = getEngine()
+ .generateSTORKAttrQueryResponseWithAssertions(attrQueryenRequest, aResponseMulti, multiResponses,
+ ipAddress, destination, isNotHashing);
+
+ attrQueryResponse = aStorkResponseMulti.getTokenSaml();
+
+ //Add to the list of query responses
+ resList.add(getEngine().validateSTORKAttrQueryResponse(attrQueryResponse, ipAddress));
+
+ //Generate the stork response with all the query responses
+ final STORKAuthnResponse storkResponse = getEngine()
+ .generateSTORKAuthnResponseAfterQuery(authenRequest, response, ipAddress,
+ isNotHashing, resList);
+
+ authResponse = storkResponse.getTokenSaml();
+
+ //Validate it, write out and print out the personal attribute lists
+ STORKAuthnResponse finalResponse = getEngine().validateSTORKAuthnResponseWithQuery(authResponse, ipAddress);
+ System.out.println("The original pal: " + finalResponse.getPersonalAttributeList().toString());
+ for (int i = 0; i < finalResponse.getPersonalAttributeLists().size(); i++)
+ {
+ System.out.println("Pal "+ Integer.toString(i) + ": " + finalResponse.getPersonalAttributeLists().get(i).toString());
+ }
+ System.out.println("The total pal: " + finalResponse.getTotalPersonalAttributeList().toString());
+
+ FileOutputStream output = null;
+
+ try {
+ output = new FileOutputStream(new File(System.getProperty("user.dir") + "/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthAttrQMultiAssertResponse.xml"));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ output.write(authResponse);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ assertNotNull(finalResponse);
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkResponseTest.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkResponseTest.java
new file mode 100644
index 000000000..fe6fcd4f6
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/StorkResponseTest.java
@@ -0,0 +1,935 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+package eu.stork.peps.test.simple;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import eu.stork.peps.auth.commons.IPersonalAttributeList;
+import eu.stork.peps.auth.commons.PEPSUtil;
+import eu.stork.peps.auth.commons.PersonalAttribute;
+import eu.stork.peps.auth.commons.PersonalAttributeList;
+import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
+import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
+import eu.stork.peps.auth.commons.STORKAuthnRequest;
+import eu.stork.peps.auth.commons.STORKAuthnResponse;
+import eu.stork.peps.auth.commons.STORKStatusCode;
+import eu.stork.peps.auth.commons.STORKSubStatusCode;
+import eu.stork.peps.auth.engine.STORKSAMLEngine;
+import eu.stork.peps.exceptions.STORKSAMLEngineException;
+
+/**
+ * The Class AuthRequestTest.
+ */
+public class StorkResponseTest {
+
+ /** The engine. */
+ private static STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF1");
+
+ /**
+ * Gets the engine.
+ *
+ * @return the engine
+ */
+ public static STORKSAMLEngine getEngine() {
+ return engine;
+ }
+
+ /**
+ * Sets the engine.
+ *
+ * @param newEngine the new engine
+ */
+ public static void setEngine(final STORKSAMLEngine newEngine) {
+ StorkResponseTest.engine = newEngine;
+ }
+
+ /** The destination. */
+ private static String destination;
+
+ /** The service provider name. */
+ private static String spName;
+
+ /** The service provider sector. */
+ private static String spSector;
+
+ /** The service provider institution. */
+ private static String spInstitution;
+
+ /** The service provider application. */
+ private static String spApplication;
+
+ /** The service provider country. */
+ private static String spCountry;
+
+ /** The service provider id. */
+ private static String spId;
+
+ /** The quality authentication assurance level. */
+ private static final int QAAL = 3;
+
+ /** The state. */
+ private static String state = "ES";
+
+ /** The town. */
+ private static String town = "Madrid";
+
+ /** The municipality code. */
+ private static String municipalityCode = "MA001";
+
+ /** The postal code. */
+ private static String postalCode = "28038";
+
+ /** The street name. */
+ private static String streetName = "Marchamalo";
+
+ /** The street number. */
+ private static String streetNumber = "3";
+
+ /** The apartament number. */
+ private static String apartamentNumber = "5º E";
+
+ /** The List of Personal Attributes. */
+ private static IPersonalAttributeList pal;
+
+ /** The assertion consumer URL. */
+ private static String assertConsumerUrl;
+
+ /** The authentication request. */
+ private static byte[] authRequest;
+
+ /** The authentication response. */
+ private static byte[] authResponse;
+
+ /** The authentication request. */
+ private static STORKAuthnRequest authenRequest;
+
+ /** The authentication response. */
+ private static STORKAuthnResponse authnResponse;
+
+ /** The Constant LOG. */
+ private static final Logger LOG = LoggerFactory
+ .getLogger(StorkResponseTest.class.getName());
+
+ /**
+ * Instantiates a new stork response test.
+ */
+ public StorkResponseTest() {
+ super();
+ }
+
+ /** The IP address. */
+ private static String ipAddress;
+
+ /** The is hashing. */
+ private final boolean isHashing = Boolean.TRUE;
+
+ /** The is not hashing. */
+ private final boolean isNotHashing = Boolean.FALSE;
+
+ /** The ERROR text. */
+ private static final String ERROR_TXT = "generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!";
+
+
+ /** Parser manager used to parse XML. */
+ private static BasicParserPool parser;
+
+ static {
+ parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+
+ pal = new PersonalAttributeList();
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(false);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ pal.add(isAgeOver);
+
+ PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ pal.add(dateOfBirth);
+
+ PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ pal.add(eIDNumber);
+
+ final PersonalAttribute givenName = new PersonalAttribute();
+ givenName.setName("givenName");
+ givenName.setIsRequired(true);
+ pal.add(givenName);
+
+ PersonalAttribute canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ pal.add(canRessAddress);
+
+ PersonalAttribute newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ pal.add(newAttribute);
+
+ destination = "http://C-PEPS.gov.xx/PEPS/ColleagueRequest";
+ assertConsumerUrl = "http://S-PEPS.gov.xx/PEPS/ColleagueResponse";
+ spName = "University Oxford";
+
+ spName = "University of Oxford";
+ spSector = "EDU001";
+ spInstitution = "OXF001";
+ spApplication = "APP001";
+ spCountry = "EN";
+
+ spId = "EDU001-APP001-APP001";
+
+ final STORKAuthnRequest request = new STORKAuthnRequest();
+ request.setDestination(destination);
+ request.setProviderName(spName);
+ request.setQaa(QAAL);
+ request.setPersonalAttributeList(pal);
+ request.setAssertionConsumerServiceURL(assertConsumerUrl);
+
+ // news parameters
+ request.setSpSector(spSector);
+ request.setSpInstitution(spInstitution);
+ request.setSpApplication(spApplication);
+ request.setSpCountry(spCountry);
+ request.setSPID(spId);
+ request.setCitizenCountryCode("ES");
+
+ try {
+ authRequest = getEngine().generateSTORKAuthnRequest(request)
+ .getTokenSaml();
+
+ authenRequest = getEngine().validateSTORKAuthnRequest(authRequest);
+
+ } catch (STORKSAMLEngineException e) {
+ fail("Error create STORKAuthnRequest");
+ }
+
+ ipAddress = "111.222.333.444";
+
+ pal = new PersonalAttributeList();
+
+ isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ ages = new ArrayList<String>();
+
+ ages.add("16");
+ ages.add("18");
+
+ isAgeOver.setValue(ages);
+ isAgeOver.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(isAgeOver);
+
+ dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ final ArrayList<String> date = new ArrayList<String>();
+ date.add("16/12/2008");
+ dateOfBirth.setValue(date);
+ dateOfBirth.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(dateOfBirth);
+
+ eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+ final ArrayList<String> idNumber = new ArrayList<String>();
+ idNumber.add("123456789PÑ");
+ eIDNumber.setValue(idNumber);
+ eIDNumber.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ pal.add(eIDNumber);
+
+ canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ canRessAddress.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> address = new HashMap<String, String>();
+
+ address.put("state", state);
+ address.put("municipalityCode", municipalityCode);
+ address.put("town", town);
+ address.put("postalCode", postalCode);
+ address.put("streetName", streetName);
+ address.put("streetNumber", streetNumber);
+ address.put("apartamentNumber", apartamentNumber);
+
+ canRessAddress.setComplexValue(address);
+ pal.add(canRessAddress);
+
+ newAttribute = new PersonalAttribute();
+ newAttribute.setName("newAttribute2");
+ newAttribute.setIsRequired(true);
+ newAttribute.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> values = new HashMap<String, String>();
+
+ values.put("value1", "value1");
+ values.put("value2", "value2");
+ values.put("value3", "value3");
+ values.put("value4", "value4");
+
+ newAttribute.setComplexValue(values);
+ pal.add(newAttribute);
+
+ }
+
+ /**
+ * Test generate authentication request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnResponse() throws STORKSAMLEngineException {
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ final STORKAuthnResponse storkResponse = getEngine()
+ .generateSTORKAuthnResponse(authenRequest, response, ipAddress,
+ isNotHashing);
+
+ authResponse = storkResponse.getTokenSaml();
+
+ LOG.info("RESPONSE: " + SSETestUtils.encodeSAMLToken(authResponse));
+
+
+ }
+
+ /**
+ * Test validation id parameter mandatory.
+ */
+ @Test
+ public final void testResponseMandatoryId() {
+ final String identifier = authenRequest.getSamlId();
+ authenRequest.setSamlId(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAuthnResponse(authenRequest, response,
+ ipAddress, isHashing);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ authenRequest.setSamlId(identifier);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication response in response to err1.
+ */
+ @Test
+ public final void testResponseMandatoryIssuer() {
+
+ final String issuer = authenRequest.getIssuer();
+ authenRequest.setIssuer(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAuthnResponse(authenRequest, response,
+ ipAddress, isHashing);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ authenRequest.setIssuer(issuer);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication response assertion consumer null.
+ */
+ @Test
+ public final void testResponseMandatoryAssertionConsumerServiceURL() {
+ final String asserConsumerUrl = authenRequest
+ .getAssertionConsumerServiceURL();
+ authenRequest.setAssertionConsumerServiceURL(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+ try {
+ getEngine().generateSTORKAuthnResponse(authenRequest, response,
+ ipAddress, isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ authenRequest.setAssertionConsumerServiceURL(asserConsumerUrl);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication response IP address null.
+ */
+ @Test
+ public final void testResponseValidationIP() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+
+ try {
+ getEngine().generateSTORKAuthnResponse(authenRequest, response, null,
+ isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication response with personal attribute list null.
+ */
+ @Test
+ public final void testResponseMandatoryPersonalAttributeList() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(null);
+
+
+ try {
+ getEngine().generateSTORKAuthnResponse(authenRequest, response,
+ ipAddress, isHashing);
+ fail("generateAuthnResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication response token null.
+ */
+ @Test
+ public final void testResponseInvalidParametersToken() {
+ try {
+ getEngine().validateSTORKAuthnResponse(null, ipAddress);
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication response IP null.
+ */
+ @Test
+ public final void testResponseInvalidParametersIP() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setPersonalAttributeList(pal);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate authentication response parameter name wrong.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttr() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("AttrWrong");
+ wrongList.add(worngAttr);
+
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate authentication response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrSimpleValue() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ worngAttr.setValue(null);
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate authentication response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrNoValue() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate authentication response set null value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrNoName() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+ /**
+ * Test validate authentication response set null complex value into attribute.
+ */
+ @Test
+ public final void testResponseInvalidParametersAttrComplexValue() {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ final IPersonalAttributeList wrongList = new PersonalAttributeList();
+
+ final PersonalAttribute worngAttr = new PersonalAttribute();
+ worngAttr.setName("isAgeOver");
+ worngAttr.setComplexValue(null);
+ wrongList.add(worngAttr);
+
+ response.setPersonalAttributeList(wrongList);
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponse(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ // In Conf1 ipValidate is false
+ getEngine().validateSTORKAuthnResponse(authResponse, null);
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+
+ /**
+ * Test validate authentication response IP distinct and disabled validation
+ * IP.
+ */
+ @Test
+ public final void testResponseInvalidParametersIPDistinct() {
+ try {
+ // ipAddress origin "111.222.333.444"
+ // ipAddrValidation = false
+ // Subject Confirmation Bearer.
+
+ getEngine().validateSTORKAuthnResponse(authResponse, "127.0.0.1");
+ fail("validateAuthenticationResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test response invalid parameters invalid token.
+ */
+ @Test
+ public final void testResponseInvalidParametersTokenMsg() {
+ try {
+ // ipAddress origin "111.222.333.444"
+ // Subject Confirmation Bearer.
+ getEngine().validateSTORKAuthnResponse("errorMessage".getBytes(),
+ ipAddress);
+ fail("validateAuthenticationResponse(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test validate authentication response is fail.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthenticationResponseIsFail()
+ throws STORKSAMLEngineException {
+ if (authResponse == null)
+ testGenerateAuthnResponse();
+
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ assertFalse("Generate incorrect response: ", authnResponse.isFail());
+ }
+
+ /**
+ * Test validate authentication response destination.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthenticationResponseDestination()
+ throws STORKSAMLEngineException {
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ assertEquals("Destination incorrect: ",
+ authnResponse.getInResponseTo(), authenRequest.getSamlId());
+ }
+
+ /**
+ * Test validate authentication response values.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ public final void testValidateAuthenticationResponseValuesComplex()
+ throws STORKSAMLEngineException {
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ assertEquals("Country incorrect:", authnResponse.getCountry(), "EN");
+
+ final Iterator<PersonalAttribute> iterator = authnResponse
+ .getPersonalAttributeList().iterator();
+
+ while (iterator.hasNext()) {
+ final PersonalAttribute attribute = iterator.next();
+ if (attribute.getName().equalsIgnoreCase(
+ "canonicalResidenceAddress")) {
+ assertEquals("State incorrect: ", state, attribute
+ .getComplexValue().get("state"));
+ assertEquals("Municipality Code incorrect: ", municipalityCode,
+ attribute.getComplexValue().get("municipalityCode"));
+ assertEquals("Town incorrect: ", town, attribute
+ .getComplexValue().get("town"));
+ assertEquals("Postal code incorrect: ", postalCode, attribute
+ .getComplexValue().get("postalCode"));
+ assertEquals("Street name incorrect: ", streetName, attribute
+ .getComplexValue().get("streetName"));
+ assertEquals("Street number incorrect: ", streetNumber,
+ attribute.getComplexValue().get("streetNumber"));
+ assertEquals("Apartament number incorrect: ", apartamentNumber,
+ attribute.getComplexValue().get("apartamentNumber"));
+ }
+ }
+ }
+
+ /**
+ * Test generate authenticate response fail in response to it's null.
+ * @throws STORKSAMLEngineException
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test //( expected=STORKSAMLEngineException.class)
+ public final void testGenerateAuthnResponseFailInResponseToNull() throws STORKSAMLEngineException {
+ final String identifier = authenRequest.getSamlId();
+ authenRequest.setSamlId(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponseFail(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ fail(ERROR_TXT);
+ } catch (STORKSAMLEngineException e) {
+ authenRequest.setSamlId(identifier);
+ LOG.error("Error");
+ //throw new STORKSAMLEngineException(e);
+ }
+ }
+
+ /**
+ * Test generate authenticate response fail assertion consumer URL err1.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnResponseFailAssertionConsumerUrlNull()
+ throws STORKSAMLEngineException {
+
+ final String assertConsumerUrl = authenRequest
+ .getAssertionConsumerServiceURL();
+ authenRequest.setAssertionConsumerServiceURL(null);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponseFail(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ fail("generateAuthnResponseFail(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ authenRequest.setAssertionConsumerServiceURL(assertConsumerUrl);
+ LOG.error("Error");
+ }
+ }
+
+ /**
+ * Test generate authentication response fail code error err1.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthnResponseFailCodeErrorNull()
+ throws STORKSAMLEngineException {
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setStatusCode(null);
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("");
+
+ try {
+ authResponse = getEngine().generateSTORKAuthnResponseFail(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+ fail("generateAuthnResponseFail(...) should've thrown an STORKSAMLEngineException!");
+ } catch (STORKSAMLEngineException e) {
+ LOG.error("Error");
+ }
+ }
+
+
+
+
+ /**
+ * Test generate authentication request without errors.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthnResponse() throws STORKSAMLEngineException {
+
+ IPersonalAttributeList palist = new PersonalAttributeList();
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(true);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ isAgeOver.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ palist.add(isAgeOver);
+
+ PersonalAttribute dateOfBirth = new PersonalAttribute();
+ dateOfBirth.setName("dateOfBirth");
+ dateOfBirth.setIsRequired(false);
+ final ArrayList<String> date = new ArrayList<String>();
+ date.add("16/12/2008");
+ dateOfBirth.setValue(date);
+ dateOfBirth.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ palist.add(dateOfBirth);
+
+
+ PersonalAttribute eIDNumber = new PersonalAttribute();
+ eIDNumber.setName("eIdentifier");
+ eIDNumber.setIsRequired(true);
+
+ final ArrayList<String> idNumber = new ArrayList<String>();
+ idNumber.add("123456789PÑ");
+
+ final HashMap<String, String> complex = new HashMap<String, String>();
+ complex.put("one", "two");
+
+ //eIDNumber.setValue(null);
+ //eIDNumber.setValue(idNumber);
+ //eIDNumber.setComplexValue(complex);
+
+ eIDNumber.setStatus(STORKStatusCode.STATUS_NOT_AVAILABLE.toString());
+ palist.add(eIDNumber);
+
+ PersonalAttribute canRessAddress = new PersonalAttribute();
+ canRessAddress.setName("canonicalResidenceAddress");
+ canRessAddress.setIsRequired(true);
+ canRessAddress.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
+ final HashMap<String, String> address = new HashMap<String, String>();
+
+ address.put("state", state);
+ address.put("municipalityCode", municipalityCode);
+ address.put("town", town);
+ address.put("postalCode", postalCode);
+ address.put("streetName", streetName);
+ address.put("streetNumber", streetNumber);
+ address.put("apartamentNumber", apartamentNumber);
+
+ canRessAddress.setComplexValue(address);
+ palist.add(canRessAddress);
+
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+
+ response.setPersonalAttributeList(palist);
+
+ final STORKAuthnResponse storkResponse = getEngine()
+ .generateSTORKAuthnResponse(authenRequest, response, ipAddress,
+ isNotHashing);
+
+ authResponse = storkResponse.getTokenSaml();
+ LOG.info("Request id: " + authenRequest.getSamlId());
+
+ LOG.info("RESPONSE: " + SSETestUtils.encodeSAMLToken(authResponse));
+
+
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ LOG.info("RESPONSE ID: " + authnResponse.getSamlId());
+ LOG.info("RESPONSE IN_RESPONSE_TO: " + authnResponse.getInResponseTo());
+ LOG.info("RESPONSE COUNTRY: " + authnResponse.getCountry());
+
+ }
+
+
+
+
+
+ /**
+ * Test validate authentication response fail is fail.
+ *
+ * @throws STORKSAMLEngineException the STORKSAML engine exception
+ */
+ @Test
+ public final void testValidateAuthenticationResponseFailIsFail()
+ throws STORKSAMLEngineException {
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+ response.setStatusCode(STORKStatusCode.REQUESTER_URI.toString());
+ response.setSubStatusCode(STORKSubStatusCode.AUTHN_FAILED_URI.toString());
+ response.setMessage("message");
+
+ authResponse = getEngine().generateSTORKAuthnResponseFail(authenRequest,
+ response, ipAddress, isNotHashing).getTokenSaml();
+
+ LOG.error("ERROR_FAIL: " + PEPSUtil.encodeSAMLToken(authResponse));
+
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ LOG.info("COUNTRY: " + authnResponse.getCountry());
+ assertTrue("Generate incorrect response: ", authnResponse.isFail());
+ }
+
+ /**
+ * Test generate/validate response with signedDoc
+ *
+ * @throws STORKSAMLEngineException
+ * the STORKSAML engine exception
+ */
+ @Test
+ public final void testGenerateAuthenResponseWithSignedDoc()
+ throws STORKSAMLEngineException {
+
+ String signedDocResponse = "<dss:SignResponse xmlns:dss=\"urn:oasis:names:tc:dss:1.0:core:schema\" RequestID=\"123456\"> <dss:Result> <dss:ResultMajor>urn:oasis:names:tc:dss:1.0:resultmajor:Success</dss:ResultMajor> </dss:Result> <dss:SignatureObject> <dss:Base64Signature Type=\"urn:ietf:rfc:3275\">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1TaWduYXR1cmUiPjxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvVFIvMjAwMS9SRUMteG1sLWMxNG4tMjAwMTAzMTUiLz48ZHM6U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI3JzYS1zaGExIi8+PGRzOlJlZmVyZW5jZSBJZD0iUmVmZXJlbmNlLWJhYmE0ZDFhLWExN2UtNDJjNi05N2QyLWJlZWUxMzUwOTUwMyIgVHlwZT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI09iamVjdCIgVVJJPSIjT2JqZWN0LTk4NzMzY2RlLThiY2MtNDhhMC05Yjc3LTBlOTk5N2JkZDA1OCI+PGRzOlRyYW5zZm9ybXM+PGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNiYXNlNjQiLz48L2RzOlRyYW5zZm9ybXM+PGRzOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzOkRpZ2VzdFZhbHVlPkNrMVZxTmQ0NVFJdnEzQVpkOFhZUUx2RWh0QT08L2RzOkRpZ2VzdFZhbHVlPjwvZHM6UmVmZXJlbmNlPjxkczpSZWZlcmVuY2UgVHlwZT0iaHR0cDovL3VyaS5ldHNpLm9yZy8wMTkwMyNTaWduZWRQcm9wZXJ0aWVzIiBVUkk9IiNTaWduYXR1cmUtOGVhYmQwYTUtNjYwZC00YWZkLTk5MDUtMGFiYzc1NTNkMTkyLVNpZ25lZFByb3BlcnRpZXMiPjxkczpEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT5BNVk5MW40cXBMZ3l0VFc3ZnhqWENVZVJ2NTQ9PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48ZHM6UmVmZXJlbmNlIFVSST0iI1NpZ25hdHVyZS04ZWFiZDBhNS02NjBkLTRhZmQtOTkwNS0wYWJjNzU1M2QxOTItS2V5SW5mbyI+PGRzOkRpZ2VzdE1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNzaGExIi8+PGRzOkRpZ2VzdFZhbHVlPlZQWDRuS0Z5UzZyRitGNmNSUjBQck5aZHc2Zz08L2RzOkRpZ2VzdFZhbHVlPjwvZHM6UmVmZXJlbmNlPjwvZHM6U2lnbmVkSW5mbz48ZHM6U2lnbmF0dXJlVmFsdWUgSWQ9IlNpZ25hdHVyZS04ZWFiZDBhNS02NjBkLTRhZmQtOTkwNS0wYWJjNzU1M2QxOTItU2lnbmF0dXJlVmFsdWUiPkxiS04vL0M3WGt5eFR0WVRpQ1VScjhuWnp4QW1zdGNNZDBDZ0VBQ3JLMWR5Z1JIcUdjSzR4dHMrV0NVOFB5RXFXclJJVFl6SXV3LzcNClY0Wno5VFQ2MHA0S1RNZXd1UUw2NHNrRVN4MllnMkVkaWtTTyt0S3hXa2hyYVVzbVZiR2JQbW1jbUR2OTd0SER3ODg3NDdlRnE1RjUNCnYrYVZTeUF6MDNpVUttdVNlSDg9PC9kczpTaWduYXR1cmVWYWx1ZT48ZHM6S2V5SW5mbyBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1LZXlJbmZvIj48ZHM6S2V5VmFsdWU+PGRzOlJTQUtleVZhbHVlPjxkczpNb2R1bHVzPnd1Y21qOXRJV3J2d2JTVFVEZndLbCtKdERNTUVSMGNMZDZEa0JTcjc5MHQrckdOakVTcVlqUndFSWVCbktvUUhQeDVIb1JlRjg4L3QNCnFZOStDaEVYcExITHM5cDVhWDdTREp1YnBRTWZwMXRERlgzNHl3Z3hTUXZjZWVKUVdCWGppZXVJbWZDMjFzNGJPY2dKYlYxaGJpZ1MNCnpPS1RRS3IxVHpkR1IrdVJ5MDA9PC9kczpNb2R1bHVzPjxkczpFeHBvbmVudD5BUUFCPC9kczpFeHBvbmVudD48L2RzOlJTQUtleVZhbHVlPjwvZHM6S2V5VmFsdWU+PGRzOlg1MDlEYXRhPjxkczpYNTA5Q2VydGlmaWNhdGU+TUlJSW1UQ0NCNEdnQXdJQkFnSURBWFVVTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUlCT3pFTE1Ba0dBMVVFQmhNQ1JWTXhPekE1QmdOVg0KQkFvVE1rRm5aVzVqYVdFZ1EyRjBZV3hoYm1FZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUNoT1NVWWdVUzB3T0RBeE1UYzJMVWtwTVRRdw0KTWdZRFZRUUhFeXRRWVhOellYUm5aU0JrWlNCc1lTQkRiMjVqWlhCamFXOGdNVEVnTURnd01EZ2dRbUZ5WTJWc2IyNWhNUzR3TEFZRA0KVlFRTEV5VlRaWEoyWldseklGQjFZbXhwWTNNZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUVWRFZpMHlNVFV3TXdZRFZRUUxFeXhXWldkbA0KZFNCb2RIUndjem92TDNkM2R5NWpZWFJqWlhKMExtNWxkQzkyWlhKRFNVTXRNaUFvWXlrd016RTFNRE1HQTFVRUN4TXNSVzUwYVhSaA0KZENCd2RXSnNhV05oSUdSbElHTmxjblJwWm1sallXTnBieUJrWlNCamFYVjBZV1JoYm5NeEd6QVpCZ05WQkFNVEVsQlNSVkJTVDBSVg0KUTBOSlR5QkpSRU5oZERBZUZ3MHhNREF5TVRFeE9ESXlNRFJhRncweE5EQXlNVEF4T0RJeU1EUmFNSUd3TVFzd0NRWURWUVFHRXdKRg0KVXpFMU1ETUdBMVVFQ3hNc1ZtVm5aWFVnYUhSMGNITTZMeTkzZDNjdVkyRjBZMlZ5ZEM1dVpYUXZkbVZ5U1VSRFlYUWdLR01wTURNeA0KRmpBVUJnTlZCQVFURFVKRlVreEJUa2RCSUZOUFZFOHhGekFWQmdOVkJDb1REazFCVWtsQklFVk9SMUpCUTBsQk1SSXdFQVlEVlFRRg0KRXdreE1EQXdNRGswTkZNeEpUQWpCZ05WQkFNVEhFMUJVa2xCSUVWT1IxSkJRMGxCSUVKRlVreEJUa2RCSUZOUFZFOHdnWjh3RFFZSg0KS29aSWh2Y05BUUVCQlFBRGdZMEFNSUdKQW9HQkFNTG5Kby9iU0ZxNzhHMGsxQTM4Q3BmaWJRekRCRWRIQzNlZzVBVXErL2RMZnF4ag0KWXhFcW1JMGNCQ0hnWnlxRUJ6OGVSNkVYaGZQUDdhbVBmZ29SRjZTeHk3UGFlV2wrMGd5Ym02VURINmRiUXhWOStNc0lNVWtMM0huaQ0KVUZnVjQ0bnJpSm53dHRiT0d6bklDVzFkWVc0b0VzemlrMENxOVU4M1JrZnJrY3ROQWdNQkFBR2pnZ1N3TUlJRXJEQU1CZ05WSFJNQg0KQWY4RUFqQUFNQTRHQTFVZER3RUIvd1FFQXdJRm9EQ0J6QVlEVlIwUkJJSEVNSUhCZ1E5aWMyOTBiMEJuYldGcGJDNWpiMjJrZ1lVdw0KZ1lJeEN6QUpCZ05WQkFZVEFrVlRNU3N3S1FZRFZRUUtGQ0pCWjhPb2JtTnBZU0JEWVhSaGJHRnVZU0JrWlNCRFpYSjBhV1pwWTJGag0KYWNPek1RNHdEQVlEVlFRTEV3VkpSRU5CVkRFUE1BMEdBMVVFQlJNR01ERTNOVEUwTVNVd0l3WURWUVFERXh4TlFWSkpRU0JGVGtkUw0KUVVOSlFTQkNSVkpNUVU1SFFTQlRUMVJQb0JBR0Npc0dBUVFCOVhnQkFRR2dBZ3dBb0JRR0RsWUVBQUVEQmdFRUFmVjRBUUVDb0FJTQ0KQURBZkJnTlZIUklFR0RBV2dSUmxZMTlwWkdOaGRFQmpZWFJqWlhKMExtNWxkREFkQmdOVkhRNEVGZ1FVQUZYanVOc2tCMk1seXZVQg0KaDdwOFRKMHVKMHd3Z2dGSUJnTlZIU01FZ2dFL01JSUJPNEFVUkt2Y2tVaE4xNGg0Q24vZ2RPRG42NzIzS1Z5aGdnRVBwSUlCQ3pDQw0KQVFjeEN6QUpCZ05WQkFZVEFrVlRNVHN3T1FZRFZRUUtFekpCWjJWdVkybGhJRU5oZEdGc1lXNWhJR1JsSUVObGNuUnBabWxqWVdOcA0KYnlBb1RrbEdJRkV0TURnd01URTNOaTFKS1RFb01DWUdBMVVFQ3hNZlUyVnlkbVZwY3lCUWRXSnNhV056SUdSbElFTmxjblJwWm1sag0KWVdOcGJ6RThNRG9HQTFVRUN4TXpWbVZuWlhVZ2FIUjBjSE02THk5M2QzY3VZMkYwWTJWeWRDNXVaWFF2ZG1WeWNISmxjSEp2WkhWag0KWTJsdklDaGpLVEF6TVRVd013WURWUVFMRXl4S1pYSmhjbkYxYVdFZ1JXNTBhWFJoZEhNZ1pHVWdRMlZ5ZEdsbWFXTmhZMmx2SUVOaA0KZEdGc1lXNWxjekVjTUJvR0ExVUVBeE1UVUZKRlVGSlBSRlZEUTBsUElFVkRMVUZEUTRJUWR3S1R0TTFFRVU5RkVQWFVZSGdnaERBZA0KQmdOVkhTVUVGakFVQmdnckJnRUZCUWNEQWdZSUt3WUJCUVVIQXdRd0VRWUpZSVpJQVliNFFnRUJCQVFEQWdXZ01EUUdDQ3NHQVFVRg0KQndFQkJDZ3dKakFrQmdnckJnRUZCUWN3QVlZWWFIUjBjSE02THk5dlkzTndMbU5oZEdObGNuUXVibVYwTUJnR0NDc0dBUVVGQndFRA0KQkF3d0NqQUlCZ1lFQUk1R0FRRXdnWVlHQTFVZEh3Ui9NSDB3UEtBNm9EaUdObWgwZEhBNkx5OWxjSE5qWkM1allYUmpaWEowTG01bA0KZEM5amNtd3ZjSEpsY0hKdlpIVmpZMmx2WDJWakxXbGtZMkYwTG1OeWJEQTlvRHVnT1lZM2FIUjBjRG92TDJWd2MyTmtNaTVqWVhSag0KWlhKMExtNWxkQzlqY213dmNISmxjSEp2WkhWalkybHZYMlZqTFdsa1kyRjBMbU55YkRDQjlnWURWUjBnQklIdU1JSHJNSUhvQmd3cg0KQmdFRUFmVjRBUU1CVmdFd2dkY3dMQVlJS3dZQkJRVUhBZ0VXSUdoMGRIQnpPaTh2ZDNkM0xtTmhkR05sY25RdWJtVjBMM1psY2tsRQ0KUTJGME1JR21CZ2dyQmdFRkJRY0NBakNCbVJxQmxrRnhkV1Z6ZENEdnY3MXpJSFZ1SUdObGNuUnBabWxqWVhRZ2NHVnljMjl1WVd3Zw0KU1VSRFFWUXNJSEpsWTI5dVpXZDFkQ0JrSjJsa1pXNTBhV1pwWTJGajc3KzlMQ0J6YVdkdVlYUjFjbUVnYVNCNGFXWnlZWFFnWkdVZw0KWTJ4aGMzTmxJRElnYVc1a2FYWnBaSFZoYkM0Z1ZtVm5aWFVnYUhSMGNITTZMeTkzZDNjdVkyRjBZMlZ5ZEM1dVpYUXZkbVZ5UkVOaA0KZERBdEJnTlZIUWtFSmpBa01CQUdDQ3NHQVFVRkJ3a0VNUVFUQWtWVE1CQUdDQ3NHQVFVRkJ3a0ZNUVFUQWtWVE1BMEdDU3FHU0liMw0KRFFFQkJRVUFBNElCQVFDcTc3ODBSR1FNTEIxZ2tkTk1mTFhuZ3FNb1JIR0taYnZ6a3JxSUFtVDhXQWQxRThyQXBoUjkveExKVXRwNQ0KbGJnMmZScjVibDJqOE9WREJLMlltRzQxaDhBRG40U1RJL0FwZU5JTlNmalpzNk5Sc25XekZ5ZlhYbVBDSFlGQi9YV3p5aW1DRXhndg0KdnR1SCszUUF3Y3dobjUwUExFdWh3NUM1dmxYN0x5NUs2ckxMTUZOVVVNYldWeTFoWmVsSy9DQlRjQWpJTzM4TlkrdllSQU1LU2Y0TQ0KL2daUXo0cUJlRlZKYTUyUjdOY0FxQ2ZyZkxmYVhwYkRTZzk4eG9CZU5zMmluR3p4OFVTZ0VyTFpqS0pzZG4vS2pURDlnUy9zVGRRNg0KUTdpZHFsZDJMRlZsTzIvYjk0Wk5aQmNTLzc4RU9EWGdkV2ZreVBDN1J3OHJlOW5JMy9qVDwvZHM6WDUwOUNlcnRpZmljYXRlPjwvZHM6WDUwOURhdGE+PC9kczpLZXlJbmZvPjxkczpPYmplY3QgRW5jb2Rpbmc9ImJhc2U2NCIgSWQ9Ik9iamVjdC05ODczM2NkZS04YmNjLTQ4YTAtOWI3Ny0wZTk5OTdiZGQwNTgiIE1pbWVUeXBlPSJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iPlNHVnNiRzhnVjI5eWJHUT08L2RzOk9iamVjdD48ZHM6T2JqZWN0Pjx4YWRlczpRdWFsaWZ5aW5nUHJvcGVydGllcyB4bWxuczp4YWRlcz0iaHR0cDovL3VyaS5ldHNpLm9yZy8wMTkwMy92MS4zLjIjIiBJZD0iU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1RdWFsaWZ5aW5nUHJvcGVydGllcyIgVGFyZ2V0PSIjU2lnbmF0dXJlLThlYWJkMGE1LTY2MGQtNGFmZC05OTA1LTBhYmM3NTUzZDE5Mi1TaWduYXR1cmUiPjx4YWRlczpTaWduZWRQcm9wZXJ0aWVzIElkPSJTaWduYXR1cmUtOGVhYmQwYTUtNjYwZC00YWZkLTk5MDUtMGFiYzc1NTNkMTkyLVNpZ25lZFByb3BlcnRpZXMiPjx4YWRlczpTaWduZWRTaWduYXR1cmVQcm9wZXJ0aWVzPjx4YWRlczpTaWduaW5nVGltZT4yMDExLTAzLTIxVDExOjQ0OjQyKzAxOjAwPC94YWRlczpTaWduaW5nVGltZT48eGFkZXM6U2lnbmluZ0NlcnRpZmljYXRlPjx4YWRlczpDZXJ0Pjx4YWRlczpDZXJ0RGlnZXN0PjxkczpEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIvPjxkczpEaWdlc3RWYWx1ZT4zbTZ3OTlUb3lTZDlKcEJsMWdCazhEei9iYlU9PC9kczpEaWdlc3RWYWx1ZT48L3hhZGVzOkNlcnREaWdlc3Q+PHhhZGVzOklzc3VlclNlcmlhbD48ZHM6WDUwOUlzc3Vlck5hbWU+Q049UFJFUFJPRFVDQ0lPIElEQ2F0LCBPVT1FbnRpdGF0IHB1YmxpY2EgZGUgY2VydGlmaWNhY2lvIGRlIGNpdXRhZGFucywgT1U9VmVnZXUgaHR0cHM6Ly93d3cuY2F0Y2VydC5uZXQvdmVyQ0lDLTIgKGMpMDMsIE9VPVNlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8gRUNWLTIsIEw9UGFzc2F0Z2UgZGUgbGEgQ29uY2VwY2lvIDExIDA4MDA4IEJhcmNlbG9uYSwgTz1BZ2VuY2lhIENhdGFsYW5hIGRlIENlcnRpZmljYWNpbyAoTklGIFEtMDgwMTE3Ni1JKSwgQz1FUzwvZHM6WDUwOUlzc3Vlck5hbWU+PGRzOlg1MDlTZXJpYWxOdW1iZXI+OTU1MDg8L2RzOlg1MDlTZXJpYWxOdW1iZXI+PC94YWRlczpJc3N1ZXJTZXJpYWw+PC94YWRlczpDZXJ0PjwveGFkZXM6U2lnbmluZ0NlcnRpZmljYXRlPjwveGFkZXM6U2lnbmVkU2lnbmF0dXJlUHJvcGVydGllcz48eGFkZXM6U2lnbmVkRGF0YU9iamVjdFByb3BlcnRpZXM+PHhhZGVzOkRhdGFPYmplY3RGb3JtYXQgT2JqZWN0UmVmZXJlbmNlPSIjUmVmZXJlbmNlLWJhYmE0ZDFhLWExN2UtNDJjNi05N2QyLWJlZWUxMzUwOTUwMyI+PHhhZGVzOk1pbWVUeXBlPmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTwveGFkZXM6TWltZVR5cGU+PHhhZGVzOkVuY29kaW5nPmJhc2U2NDwveGFkZXM6RW5jb2Rpbmc+PC94YWRlczpEYXRhT2JqZWN0Rm9ybWF0PjwveGFkZXM6U2lnbmVkRGF0YU9iamVjdFByb3BlcnRpZXM+PC94YWRlczpTaWduZWRQcm9wZXJ0aWVzPjwveGFkZXM6UXVhbGlmeWluZ1Byb3BlcnRpZXM+PC9kczpPYmplY3Q+PC9kczpTaWduYXR1cmU+</dss:Base64Signature> </dss:SignatureObject> </dss:SignResponse>";
+
+ IPersonalAttributeList palist = new PersonalAttributeList();
+
+ PersonalAttribute signedDoc = new PersonalAttribute();
+ signedDoc.setName("signedDoc");
+ signedDoc.setIsRequired(false);
+ ArrayList<String> signed = new ArrayList<String>();
+ signed.add(signedDocResponse);
+ signedDoc.setValue(signed);
+ palist.add(signedDoc);
+
+ PersonalAttribute isAgeOver = new PersonalAttribute();
+ isAgeOver.setName("isAgeOver");
+ isAgeOver.setIsRequired(false);
+ ArrayList<String> ages = new ArrayList<String>();
+ ages.add("16");
+ ages.add("18");
+ isAgeOver.setValue(ages);
+ palist.add(isAgeOver);
+
+ authenRequest.setPersonalAttributeList(palist);
+
+ final STORKAuthnResponse response = new STORKAuthnResponse();
+
+ response.setPersonalAttributeList(palist);
+
+ final STORKAuthnResponse storkResponse = getEngine()
+ .generateSTORKAuthnResponse(authenRequest, response, ipAddress,
+ isNotHashing);
+
+ authResponse = storkResponse.getTokenSaml();
+ authnResponse = getEngine().validateSTORKAuthnResponse(authResponse,
+ ipAddress);
+
+ assertTrue("SignedDoc response should be the same: ", authnResponse
+ .getPersonalAttributeList().get("signedDoc").getValue().get(0)
+ .equals(signedDocResponse));
+
+ }
+}
diff --git a/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/package-info.java b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/package-info.java
new file mode 100644
index 000000000..1c34e2ad5
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/java/eu/stork/peps/test/simple/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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/european-union-public-licence-eupl-v.1.1
+ *
+ * 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.
+ */
+
+/**
+ * Provides the classes necessary to create a SAML message.
+ * @since 1.0
+ */
+package eu.stork.peps.test.simple; \ No newline at end of file
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 48fd9adff..171e05f12 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
@@ -1,21 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<instances>
-
-
- <!-- Configuration name-->
- <instance name="outgoing">
- <!-- Configurations parameters StorkSamlEngine -->
- <configuration name="SamlEngineConf">
- <parameter name="fileConfiguration" value="StorkSamlEngine_outgoing.xml" />
- </configuration>
-
- <!-- Settings module signature-->
- <configuration name="SignatureConf">
- <!-- Specific signature module -->
- <parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
- <!-- Settings specific module -->
- <parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
- </configuration>
- </instance>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<instances>
+
+ <!-- Configuration name -->
+ <instance name="CONF0">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_Conf0.xml" />
+ </configuration>
+
+ <!-- Settings module signature -->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class"
+ value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_Conf0.xml" />
+ </configuration>
+ </instance>
+
+ <!-- ******************** CONF1 ******************** -->
+ <!-- Configuration name -->
+ <instance name="CONF1">
+ <!-- Configurations parameters StorkSamlEngine -->
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_Conf1.xml" />
+ </configuration>
+
+ <!-- Settings module signature -->
+ <configuration name="SignatureConf">
+ <!-- Specific signature module -->
+ <parameter name="class"
+ value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <!-- Settings specific module -->
+ <parameter name="fileConfiguration" value="SignModule_Conf1.xml" />
+ </configuration>
+ </instance>
+
+ <!-- ******************** CONF2 ******************** -->
+
+ <instance name="CONF2">
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_Conf2.xml" />
+ </configuration>
+
+ <configuration name="SignatureConf">
+ <parameter name="class"
+ value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <parameter name="fileConfiguration" value="SignModule_Conf2.xml" />
+ </configuration>
+ </instance>
+
+ <!-- ******************** CONF3 ******************** -->
+
+ <instance name="CONF3">
+ <configuration name="SamlEngineConf">
+ <parameter name="fileConfiguration" value="StorkSamlEngine_Conf3.xml" />
+ </configuration>
+
+ <configuration name="SignatureConf">
+ <parameter name="class"
+ value="eu.stork.peps.auth.engine.core.impl.SignSW" />
+ <parameter name="fileConfiguration" value="SignModule_Conf3.xml" />
+ </configuration>
+ </instance>
+
</instances> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml
index 99c1b043d..a9f2038b8 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf0.xml
@@ -1,12 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SWModule sign with JKS.</comment>
- <entry key="keystorePath">projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/keyStoreCountry0.jks</entry>
- <entry key="keyStorePassword">local-demo</entry>
- <entry key="keyPassword">local-demo</entry>
- <entry key="issuer">CN=saml-demo-cert,OU=STORK2,O=Advania,L=Reykjavik,ST=Reykjavik,C=IS</entry>
- <entry key="serialNumber">529E05C8</entry>
- <entry key="keystoreType">JKS</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<!-- properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">C:\opt\keystores\keyStoreCountry0.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=saml-demo-cert,OU=STORK2,O=Advania,L=Reykjavik,ST=Reykjavik,C=IS</entry>
+ <entry key="serialNumber">524D4C6C</entry>
+ <entry key="keystoreType">JKS</entry>
+</properties-->
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">C:\opt\keystores\storkDemoKeysTest.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml
index af68d33aa..e556a7331 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf1.xml
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SWModule sign with JKS.</comment>
- <entry key="keystorePath">src/test/resources/keyStoreCountry1.jks</entry>
- <entry key="keyStorePassword">local-demo</entry>
- <entry key="keyPassword">local-demo</entry>
- <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
- <entry key="serialNumber">529E04FF</entry>
- <entry key="keystoreType">JKS</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">C:\opt\keystores\storkDemoKeysTest.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml
index b13cb390a..3da1e33df 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf2.xml
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SWModule sign with JKS.</comment>
- <entry key="keystorePath">src/test/resources/keyStoreCountry2.jks</entry>
- <entry key="keyStorePassword">local-demo</entry>
- <entry key="keyPassword">local-demo</entry>
- <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
- <entry key="serialNumber">529E04FF</entry>
- <entry key="keystoreType">JKS</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">C:\opt\keystores\keyStoreCountry2.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml
index ed933020a..4c14a1711 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_Conf3.xml
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SWModule sign with JKS.</comment>
- <entry key="keystorePath">src/test/resources/keyStoreCountry3.jks</entry>
- <entry key="keyStorePassword">local-demo</entry>
- <entry key="keyPassword">local-demo</entry>
- <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
- <entry key="serialNumber">529E04FF</entry>
- <entry key="keystoreType">JKS</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SWModule sign with JKS.</comment>
+ <entry key="keystorePath">C:\opt\keystores\keyStoreCountry3.jks</entry>
+ <entry key="keyStorePassword">local-demo</entry>
+ <entry key="keyPassword">local-demo</entry>
+ <entry key="issuer">CN=local-demo, O=Indra, L=Madrid, ST=Spain, C=ES</entry>
+ <entry key="serialNumber">4BA89DB2</entry>
+ <entry key="keystoreType">JKS</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_P11.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_P11.xml
index 64eb426c8..c683d97c3 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_P11.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_P11.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>HWModule sign with interface PKCS11.</comment>
- <entry key="configurationFile">p11Config.cfg</entry>
- <entry key="keyPassword">*******</entry>
- <entry key="issuer">CN=XXXXXXXXX</entry>
- <entry key="serialNumber">xxxxxxxxxxxxxx</entry>
- <entry key="keystoreType">PKCS11</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>HWModule sign with interface PKCS11.</comment>
+ <entry key="configurationFile">p11Config.cfg</entry>
+ <entry key="keyPassword">*******</entry>
+ <entry key="issuer">CN=XXXXXXXXX</entry>
+ <entry key="serialNumber">xxxxxxxxxxxxxx</entry>
+ <entry key="keystoreType">PKCS11</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml
index 0a28a5de8..8c3a94601 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf0.xml
@@ -1,91 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SAML constants for AuthnRequests and Responses.</comment>
-
- <!--
- Types of consent obtained from the user for this authentication and
- data transfer.
- Allow values: 'unspecified'.
- -->
- <entry key="consentAuthnRequest">unspecified</entry>
-
- <!--
- Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
- -->
- <entry key="consentAuthnResponse">obtained</entry>
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- -->
- <entry key="formatEntity">entity</entry>
-
- <!--Only HTTP-POST binding is only supported for inter PEPS-->
- <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
- <entry key="protocolBinding">HTTP-POST</entry>
-
-
-
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- <entry key="eIDSectorShare">true</entry>
- <entry key="eIDCrossSectorShare">true</entry>
- <entry key="eIDCrossBorderShare">true</entry>
- -->
-
-
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="friendlyName">false</entry>
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="isRequired">true</entry>
-
- <!--PEPS in the Service Provider's country-->
- <entry key="requester">http://S-PEPS.gov.xx</entry>
-
- <!--PEPS in the citizen's origin country-->
- <entry key="responder">http://C-PEPS.gov.xx</entry>
-
- <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
- <entry key="timeNotOnOrAfter">300</entry>
-
- <!--Validation IP of the response-->
- <entry key="ipAddrValidation">false</entry>
-
-
- <!--Subject Attribute Definitions-->
- <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
- <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
- <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
- <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
- <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
- <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
- <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
- <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
- <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
- <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
- <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
- <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
- <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
- <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
- <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
- <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
-
- <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
- <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
-
- <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
- <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
-
- <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
- <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
-
- <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
- <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
- <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
- <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!-- Types of consent obtained from the user for this authentication and
+ data transfer. Allow values: 'unspecified'. -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!-- Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit',
+ 'unspecified'. -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS -->
+ <!--The SOAP binding is only supported for direct communication between
+ SP-MW and VIdP -->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. <entry key="eIDSectorShare">true</entry> <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry> -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country -->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country -->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive
+ number) -->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response -->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions -->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
+ <entry key="docRequest">http://www.stork.gov.eu/1.0/docRequest</entry>
+
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml
index 0a28a5de8..ad04cc3df 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf1.xml
@@ -1,91 +1,85 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SAML constants for AuthnRequests and Responses.</comment>
-
- <!--
- Types of consent obtained from the user for this authentication and
- data transfer.
- Allow values: 'unspecified'.
- -->
- <entry key="consentAuthnRequest">unspecified</entry>
-
- <!--
- Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit', 'unspecified'.
- -->
- <entry key="consentAuthnResponse">obtained</entry>
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- -->
- <entry key="formatEntity">entity</entry>
-
- <!--Only HTTP-POST binding is only supported for inter PEPS-->
- <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
- <entry key="protocolBinding">HTTP-POST</entry>
-
-
-
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- <entry key="eIDSectorShare">true</entry>
- <entry key="eIDCrossSectorShare">true</entry>
- <entry key="eIDCrossBorderShare">true</entry>
- -->
-
-
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="friendlyName">false</entry>
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="isRequired">true</entry>
-
- <!--PEPS in the Service Provider's country-->
- <entry key="requester">http://S-PEPS.gov.xx</entry>
-
- <!--PEPS in the citizen's origin country-->
- <entry key="responder">http://C-PEPS.gov.xx</entry>
-
- <!--Subject cannot be confirmed on or after this seconds time (positive number)-->
- <entry key="timeNotOnOrAfter">300</entry>
-
- <!--Validation IP of the response-->
- <entry key="ipAddrValidation">false</entry>
-
-
- <!--Subject Attribute Definitions-->
- <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
- <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
- <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
- <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
- <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
- <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
- <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
- <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
- <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
- <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
- <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
- <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
- <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
- <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
- <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
- <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
-
- <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
- <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
-
- <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
- <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
-
- <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
- <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
-
- <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
- <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
- <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
- <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!-- Types of consent obtained from the user for this authentication and
+ data transfer. Allow values: 'unspecified'. -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+
+ <!-- Allow values: 'obtained', 'prior', 'current-implicit', 'current-explicit',
+ 'unspecified'. -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS -->
+ <!--The SOAP binding is only supported for direct communication between
+ SP-MW and VIdP -->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+
+
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. <entry key="eIDSectorShare">true</entry> <entry key="eIDCrossSectorShare">true</entry>
+ <entry key="eIDCrossBorderShare">true</entry> -->
+
+
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="friendlyName">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">true</entry>
+
+ <!--PEPS in the Service Provider's country -->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country -->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time (positive
+ number) -->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response -->
+ <entry key="ipAddrValidation">false</entry>
+
+
+ <!--Subject Attribute Definitions -->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+
+ <entry key="textResidenceAddress">http://www.stork.gov.eu/1.0/textResidenceAddress</entry>
+ <entry key="canonicalResidenceAddress">http://www.stork.gov.eu/1.0/canonicalResidenceAddress</entry>
+
+ <entry key="title">http://www.stork.gov.eu/1.0/title</entry>
+ <entry key="residencePermit">http://www.stork.gov.eu/1.0/residencePermit</entry>
+
+ <entry key="signedDoc">http://www.stork.gov.eu/1.0/signedDoc</entry>
+ <entry key="citizen509Certificate">http://www.stork.gov.eu/1.0/citizen509Certificate</entry>
+
+ <entry key="newAttribute1">http://www.stork.gov.eu/1.0/newAttribute1</entry>
+ <entry key="newAttribute2">http://www.stork.gov.eu/1.0/newAttribute2</entry>
+ <entry key="hasDegree">http://www.stork.gov.eu/1.0/hasDegree</entry>
+ <entry key="mandateContent">http://www.stork.gov.eu/1.0/mandateContent</entry>
+
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml
index 435ef4b82..fd1db92ac 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf2.xml
@@ -1,64 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SAML constants for AuthnRequests and Responses.</comment>
-
- <!--
- Types of consent obtained from the user for this authentication and
- data transfer.
- Allow values: 'unspecified'.
- -->
- <entry key="consentAuthnRequest">unspecified</entry>
- <!--
- Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
- -->
- <entry key="consentAuthnResponse">obtained</entry>
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- -->
- <entry key="formatEntity">entity</entry>
-
- <!--Only HTTP-POST binding is only supported for inter PEPS-->
- <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
- <entry key="protocolBinding">HTTP-POST</entry>
-
- <entry key="eIDSectorShare">false</entry>
- <entry key="eIDCrossSectorShare">false</entry>
- <entry key="eIDCrossBorderShare">false</entry>
-
- <!--PEPS in the Service Provider's country-->
- <entry key="requester">http://S-PEPS.gov.xx</entry>
-
- <!--PEPS in the citizen's origin country-->
- <entry key="responder">http://C-PEPS.gov.xx</entry>
-
- <!--Subject cannot be confirmed on or after this seconds time-->
- <entry key="timeNotOnOrAfter">300</entry>
-
- <!--Validation IP of the response-->
- <entry key="ipAddrValidation">false</entry>
-
- <!-- A friendly name for the attribute that can be displayed to a user -->
- <entry key="isRequired">false</entry>
-
-
- <!--Subject Attribute Definitions-->
- <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
- <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
- <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
- <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
- <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
- <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
- <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
- <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
- <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
- <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
- <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
- <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
- <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
- <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
- <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
- <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!-- Types of consent obtained from the user for this authentication and
+ data transfer. Allow values: 'unspecified'. -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!-- Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit',
+ 'unspecified'. -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS -->
+ <!--The SOAP binding is only supported for direct communication between
+ SP-MW and VIdP -->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country -->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country -->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time -->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response -->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!-- A friendly name for the attribute that can be displayed to a user -->
+ <entry key="isRequired">false</entry>
+
+
+ <!--Subject Attribute Definitions -->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml
index bec8934f8..bea40d274 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_Conf3.xml
@@ -1,61 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-
-<properties>
- <comment>SAML constants for AuthnRequests and Responses.</comment>
-
- <!--
- Types of consent obtained from the user for this authentication and
- data transfer.
- Allow values: 'unspecified'.
- -->
- <entry key="consentAuthnRequest">unspecified</entry>
- <!--
- Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit', 'unspecified'.
- -->
- <entry key="consentAuthnResponse">obtained</entry>
-
- <!--URI representing the classification of the identifier
- Allow values: 'entity'.
- -->
- <entry key="formatEntity">entity</entry>
-
- <!--Only HTTP-POST binding is only supported for inter PEPS-->
- <!--The SOAP binding is only supported for direct communication between SP-MW and VIdP-->
- <entry key="protocolBinding">HTTP-POST</entry>
-
- <entry key="eIDSectorShare">false</entry>
- <entry key="eIDCrossSectorShare">false</entry>
- <entry key="eIDCrossBorderShare">false</entry>
-
- <!--PEPS in the Service Provider's country-->
- <entry key="requester">http://S-PEPS.gov.xx</entry>
-
- <!--PEPS in the citizen's origin country-->
- <entry key="responder">http://C-PEPS.gov.xx</entry>
-
- <!--Subject cannot be confirmed on or after this seconds time-->
- <entry key="timeNotOnOrAfter">300</entry>
-
- <!--Validation IP of the response-->
- <entry key="ipAddrValidation">false</entry>
-
- <!--Subject Attribute Definitions-->
- <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
- <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
- <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
- <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
- <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
- <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
- <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
- <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
- <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
- <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
- <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
- <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
- <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
- <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
- <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
- <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
- <entry key="unknown">http://www.stork.gov.eu/1.0/unknown</entry>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+ <comment>SAML constants for AuthnRequests and Responses.</comment>
+
+ <!-- Types of consent obtained from the user for this authentication and
+ data transfer. Allow values: 'unspecified'. -->
+ <entry key="consentAuthnRequest">unspecified</entry>
+ <!-- Allow values: 'obtained', 'prior', 'curent-implicit', 'curent-explicit',
+ 'unspecified'. -->
+ <entry key="consentAuthnResponse">obtained</entry>
+
+ <!--URI representing the classification of the identifier Allow values:
+ 'entity'. -->
+ <entry key="formatEntity">entity</entry>
+
+ <!--Only HTTP-POST binding is only supported for inter PEPS -->
+ <!--The SOAP binding is only supported for direct communication between
+ SP-MW and VIdP -->
+ <entry key="protocolBinding">HTTP-POST</entry>
+
+ <entry key="eIDSectorShare">false</entry>
+ <entry key="eIDCrossSectorShare">false</entry>
+ <entry key="eIDCrossBorderShare">false</entry>
+
+ <!--PEPS in the Service Provider's country -->
+ <entry key="requester">http://S-PEPS.gov.xx</entry>
+
+ <!--PEPS in the citizen's origin country -->
+ <entry key="responder">http://C-PEPS.gov.xx</entry>
+
+ <!--Subject cannot be confirmed on or after this seconds time -->
+ <entry key="timeNotOnOrAfter">300</entry>
+
+ <!--Validation IP of the response -->
+ <entry key="ipAddrValidation">false</entry>
+
+ <!--Subject Attribute Definitions -->
+ <entry key="eIdentifier">http://www.stork.gov.eu/1.0/eIdentifier</entry>
+ <entry key="givenName">http://www.stork.gov.eu/1.0/givenName</entry>
+ <entry key="surname">http://www.stork.gov.eu/1.0/surname</entry>
+ <entry key="inheritedFamilyName">http://www.stork.gov.eu/1.0/inheritedFamilyName</entry>
+ <entry key="adoptedFamilyName">http://www.stork.gov.eu/1.0/adoptedFamilyName</entry>
+ <entry key="gender">http://www.stork.gov.eu/1.0/gender</entry>
+ <entry key="dateOfBirth">http://www.stork.gov.eu/1.0/dateOfBirth</entry>
+ <entry key="countryCodeOfBirth">http://www.stork.gov.eu/1.0/countryCodeOfBirth</entry>
+ <entry key="nationalityCode">http://www.stork.gov.eu/1.0/nationalityCode</entry>
+ <entry key="maritalStatus">http://www.stork.gov.eu/1.0/maritalStatus</entry>
+ <entry key="residenceAddress">http://www.stork.gov.eu/1.0/residenceAddress</entry>
+ <entry key="eMail">http://www.stork.gov.eu/1.0/eMail</entry>
+ <entry key="academicTitle">http://www.stork.gov.eu/1.0/academicTitle</entry>
+ <entry key="pseudonym">http://www.stork.gov.eu/1.0/pseudonym</entry>
+ <entry key="age">http://www.stork.gov.eu/1.0/age</entry>
+ <entry key="isAgeOver">http://www.stork.gov.eu/1.0/isAgeOver</entry>
+ <entry key="unknown">http://www.stork.gov.eu/1.0/unknown</entry>
</properties> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
index 511919167..3764389e4 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequest.xml
@@ -1,16 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest" ID="_939726f0a02072f40b548de378612a50" IssueInstant="2013-10-04T16:57:55.547Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_939726f0a02072f40b548de378612a50"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>BgPDTVCv7BhiWIs6HsC06jaHaag=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>dIC61bGi6Jqp1zSVojpjaVq9WaZcDtNImXgo1Dyze5/hJA07Sy4TaHu+/IuLEC99aLjM6rxh2UUNqpPaQCFlF5eVkVv/c4gHEZVyevhjJKTidqmnuhlI78PGMx2thfxFsHsPcqHqOzy1Z6w18K1ds6APQP+aXI9TNKis+pykn4nJititYuiSseD0VY0F4QnXx+U6k3raoi1CAFE5fe7EuI/KfxuhhQLAbLq90Vm8R94ITBjfSS25mXstXNe9zppTSjDB42ld1TjDovDwXAn5OxiZasIEb5m68sRlxgoQ/2/+ZdYNNINFLAwkCbb8MiCbGASd626Bme0Kx+ropeWdxw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDXjCCAkagAwIBAgIEUk1MbDANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJUzESMBAGA1UE
-CAwJUmV5a2phdmlrMRIwEAYDVQQHDAlSZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNV
-BAsMBlNUT1JLMjEXMBUGA1UEAwwOc2FtbC1kZW1vLWNlcnQwHhcNMTMxMDAzMTA1MzEyWhcNMjMx
-MDAzMTA1MzEyWjBxMQswCQYDVQQGEwJJUzESMBAGA1UECAwJUmV5a2phdmlrMRIwEAYDVQQHDAlS
-ZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNVBAsMBlNUT1JLMjEXMBUGA1UEAwwOc2Ft
-bC1kZW1vLWNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkSgTxZkNRXZTKLB0c
-4oz7/8Dh56FX+0cYg7hjw4e8vn+ITXkxzrmUH57FtsvKln4mq1H0FHXL80u3IiWX8qY+QLgNeKeB
-m85lXuyOb3wWpKAaQvpLAkejGLCx22AN2L0WZkKZV2puwRQVsRHCq6U6vToJXDZ6Ui6ltKsAl/ZS
-8qUFpiIvqD5ea4ohz4JsFE/uApRc7pbJ4VbOmAAeH/tQTayptq2kPb2vvUVk+2cH5J7UD+GCI88E
-e+mS+C33tV9NmWUHL69mYEe8FXjumbKA5e9i1ejn9i0/BLUtHFonHnL9YFMim0foI7NNc5mNg9aw
-vm0PuByVU3kuibQkqGBLAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAA9X5B4NBmVuhjECi+KOnRRX
-5oUV+jbYKhGZODDPi+F4Uo7ZtPFQ6sS3tE54+8AoDl5zQ5q5fDDVXhB42IIIjDxHKo8cBXie5FZ6
-mJtErvWZWYWdO0uV2OQAUALq2LieidqSFDJ+Pjl8w1New8oi3migwyE0jZo4Q97lJGDfJTruV0A2
-JE/Gt6QAAcWhhN2hZl92pYkIi5OeqHXyzBUp5vg8LLfNmeyziCAiXDC1Sy/aQU/cllZ3zFJMrqZM
-s2xBpmB4sF1YRbIrr2OqEVE6M6DUx+pAQOd2uogV3AMT9D5MYpckI1jx/o/Tto7ju74nIVOskDiN
-K0FR8izxcT0HixM=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjorn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
+ Destination="http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest" ID="_939726f0a02072f40b548de378612a50"
+ IssueInstant="2013-10-04T16:57:55.547Z" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignedInfo>
+ <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+ <ds:Reference URI="#_939726f0a02072f40b548de378612a50">
+ <ds:Transforms>
+ <ds:Transform
+ Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+ <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
+ <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
+ PrefixList="xs" />
+ </ds:Transform>
+ </ds:Transforms>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+ <ds:DigestValue>BgPDTVCv7BhiWIs6HsC06jaHaag=</ds:DigestValue>
+ </ds:Reference>
+ </ds:SignedInfo>
+ <ds:SignatureValue>dIC61bGi6Jqp1zSVojpjaVq9WaZcDtNImXgo1Dyze5/hJA07Sy4TaHu+/IuLEC99aLjM6rxh2UUNqpPaQCFlF5eVkVv/c4gHEZVyevhjJKTidqmnuhlI78PGMx2thfxFsHsPcqHqOzy1Z6w18K1ds6APQP+aXI9TNKis+pykn4nJititYuiSseD0VY0F4QnXx+U6k3raoi1CAFE5fe7EuI/KfxuhhQLAbLq90Vm8R94ITBjfSS25mXstXNe9zppTSjDB42ld1TjDovDwXAn5OxiZasIEb5m68sRlxgoQ/2/+ZdYNNINFLAwkCbb8MiCbGASd626Bme0Kx+ropeWdxw==</ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIDXjCCAkagAwIBAgIEUk1MbDANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJJUzESMBAGA1UE
+ CAwJUmV5a2phdmlrMRIwEAYDVQQHDAlSZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNV
+ BAsMBlNUT1JLMjEXMBUGA1UEAwwOc2FtbC1kZW1vLWNlcnQwHhcNMTMxMDAzMTA1MzEyWhcNMjMx
+ MDAzMTA1MzEyWjBxMQswCQYDVQQGEwJJUzESMBAGA1UECAwJUmV5a2phdmlrMRIwEAYDVQQHDAlS
+ ZXlramF2aWsxEDAOBgNVBAoMB0FkdmFuaWExDzANBgNVBAsMBlNUT1JLMjEXMBUGA1UEAwwOc2Ft
+ bC1kZW1vLWNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCkSgTxZkNRXZTKLB0c
+ 4oz7/8Dh56FX+0cYg7hjw4e8vn+ITXkxzrmUH57FtsvKln4mq1H0FHXL80u3IiWX8qY+QLgNeKeB
+ m85lXuyOb3wWpKAaQvpLAkejGLCx22AN2L0WZkKZV2puwRQVsRHCq6U6vToJXDZ6Ui6ltKsAl/ZS
+ 8qUFpiIvqD5ea4ohz4JsFE/uApRc7pbJ4VbOmAAeH/tQTayptq2kPb2vvUVk+2cH5J7UD+GCI88E
+ e+mS+C33tV9NmWUHL69mYEe8FXjumbKA5e9i1ejn9i0/BLUtHFonHnL9YFMim0foI7NNc5mNg9aw
+ vm0PuByVU3kuibQkqGBLAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAA9X5B4NBmVuhjECi+KOnRRX
+ 5oUV+jbYKhGZODDPi+F4Uo7ZtPFQ6sS3tE54+8AoDl5zQ5q5fDDVXhB42IIIjDxHKo8cBXie5FZ6
+ mJtErvWZWYWdO0uV2OQAUALq2LieidqSFDJ+Pjl8w1New8oi3migwyE0jZo4Q97lJGDfJTruV0A2
+ JE/Gt6QAAcWhhN2hZl92pYkIi5OeqHXyzBUp5vg8LLfNmeyziCAiXDC1Sy/aQU/cllZ3zFJMrqZM
+ s2xBpmB4sF1YRbIrr2OqEVE6M6DUx+pAQOd2uogV3AMT9D5MYpckI1jx/o/Tto7ju74nIVOskDiN
+ K0FR8izxcT0HixM=</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Extensions>
+ <stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel>
+ <storkp:eIDSectorShare>false</storkp:eIDSectorShare>
+ <storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare>
+ <storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare>
+ <storkp:RequestedAttributes>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="false" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">16</stork:AttributeValue>
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">18</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">Sveinbjorn</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ </storkp:RequestedAttributes>
+ </saml2p:Extensions>
+ <saml2:Subject>
+ <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" />
+ </saml2:Subject>
+</saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestSdoc.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestSdoc.xml
new file mode 100644
index 000000000..d64572829
--- /dev/null
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestSdoc.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" AssertionConsumerServiceURL="http://S-PEPS.gov.xx/PEPS/ColleagueResponse" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://A-PEPS.gov.xx/PEPS/AttributeColleagueRequest" ID="_334488599e0c2781ff34857c4964debb" IssueInstant="2014-02-06T22:09:18.113Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><ds:Reference URI="#_334488599e0c2781ff34857c4964debb"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>X1nUVB6qXdoKbJzNekiSo9ExLdw=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>ExCPHHC/9OhdhOl1Ou+43Qw1nvskpbMYMu9vqa7m16doxM2PIUmK7LUw7hZiKtjIdBxuhpca3OrjO8O6MuTDN1FksWoj+7B1KTLFtmspucT5O7Cu2OqhK5WIVuCaLuA7CD0N2UfFouRwR5NlLHyzn9Trd7IM5OjA41dGb5jqYl7Ir+62+MgjhZRlLooDzb5fDAczbxv9LHGiKRBpgnk40w3gDAvoSPNdEuKhZi8LPQWWNBvVi3N5ZmJmAIacZWBqePywXTjygmChWAc8p7ptAX6tw0hpBxyxoW3aaZZzWQNcwobTRYbn89fcM11gqIz/YK7VXtiQ7WEQt1enQD/GAA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDIjCCAgqgAwIBAgIES6idsjANBgkqhkiG9w0BAQUFADBTMQswCQYDVQQGEwJFUzEOMAwGA1UE
+CAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExEzARBgNVBAMMCmxvY2Fs
+LWRlbW8wHhcNMTMwODI4MTY0NzM1WhcNMTUwODI4MTY0NzM1WjBTMQswCQYDVQQGEwJFUzEOMAwG
+A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExEzARBgNVBAMMCmxv
+Y2FsLWRlbW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx+7zEQUbt8Ot9dByR5TuY
+NPmTwaKhECtnkxYAx9tl+Ga3kFiv+dOSeDoQOhxkICG1ZMaG0Gtk0EQWjscC1cLwDXpAOdhOm5xh
+ndFHxa3V3Y3zomFZA7A3nwP8wt17wDrc1xi2Ye8VrwO7Vjb/F8Rgutlcrvq+LF4g9nQLoRiKUq8w
+NFvDlvhBbLr8hMVBMY/jY7tSQ85qLqKUkWRcoDttJjgWZoO1vpBS4m+FywtYdOoHnN6fv4Dvf1r2
+rNLgebgBvSfwznxiulwW6FBLasYX0rYKP7RfwG8TJ+FumOgAjADj2LdwK25RZNg44XU2V1z1Fp37
+fNXhfo08LpdD1ueFAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBADMRGTWOmadZyCoJNluV+M7LopjC
+9WpFUj76X0cAoNXmt12zYqYe8hjRmBr6l2V/FXT3/TyWET1nILG46zwwAxslw3b2LvkhU+9QcuB8
+yC8TCJJ0kgsTZ/EUZPSbwUG7Nn2jkMiyjlyKcjSCQOzEKQyR1xYwyZG40+BPeGbYjmRgm6kcmCxY
+USWoPwNyfke9gNT80f0pUj7wJ9YwWbTIz1rhf/h7rxoMYypXo+JXwaXW/Ra8v1uDcwfKpE5ZgwAU
+nubLXF4A+H7/N7ZvB5XDwJ4W+99nuPsKfwacD8m1sflTXcEPzzhOq6iQ9anJT94/pMctnp827zXA
+y66jvDrin5I=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><stork:spCountry>IS</stork:spCountry><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/docRequest" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">IS/IS/fbea6e68-0393-401b-b616-f767fff9418c</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
index 9f9fe5156..becc689fe 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryRequestTagDelete.xml
@@ -1,15 +1,66 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_f6c8fc355b9f125cb5283f038e1b3cdf" IssueInstant="2013-10-03T10:28:15.449Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignatureValue>hhQXDKNrJJ3Yy/pkZNZF4GlWrA/Xsx4CH9chgVa5HK4qZQvFXvZwegdw6U7rm7qv0zmI4xaLTv/bpmqJzEPfY3sIvrDRu9EouEKwtjbMbcvVQsx7I+j0yy7/cBcQJe3lRwQwyvazfYVbnSeGFxBN6WOHPqv6uInaQO/hXkicT3tBtm8o3UgUDY6c8wIMuD5A0hWTkL6z6f893AbdN85OQYAdHItNsQWeLOIeiGC918X7qqTfhFtBAB2oGVjlsSEqWox1jNqrPl1jjA0dP76m5SIVSqF8XcDR306ZB9GLJywOHKba0lxGLsXOAzJ+8u9jeixJ6VZKFqZg2Fhl/saKbg==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
-YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
-LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
-A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
-Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
-ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
-0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
-6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
-y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
-9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
-6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
-pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
-/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
-yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
-Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</stork:AttributeValue><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">Sveinbjörn</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue></stork:RequestedAttribute></storkp:RequestedAttributes></saml2p:Extensions><saml2:Subject><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:1.0:cm:sender-vouches"/></saml2:Subject></saml2p:AttributeQuery> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:AttributeQuery xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
+ Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_f6c8fc355b9f125cb5283f038e1b3cdf"
+ IssueInstant="2013-10-03T10:28:15.449Z" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignatureValue>hhQXDKNrJJ3Yy/pkZNZF4GlWrA/Xsx4CH9chgVa5HK4qZQvFXvZwegdw6U7rm7qv0zmI4xaLTv/bpmqJzEPfY3sIvrDRu9EouEKwtjbMbcvVQsx7I+j0yy7/cBcQJe3lRwQwyvazfYVbnSeGFxBN6WOHPqv6uInaQO/hXkicT3tBtm8o3UgUDY6c8wIMuD5A0hWTkL6z6f893AbdN85OQYAdHItNsQWeLOIeiGC918X7qqTfhFtBAB2oGVjlsSEqWox1jNqrPl1jjA0dP76m5SIVSqF8XcDR306ZB9GLJywOHKba0lxGLsXOAzJ+8u9jeixJ6VZKFqZg2Fhl/saKbg==</ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+ YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+ LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+ A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+ Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+ 0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+ 6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+ y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+ 9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+ 6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+ pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+ /NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+ yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+ Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Extensions>
+ <stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel>
+ <storkp:eIDSectorShare>false</storkp:eIDSectorShare>
+ <storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare>
+ <storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare>
+ <storkp:RequestedAttributes>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="false" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">16</stork:AttributeValue>
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">18</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">Sveinbjörn</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">ES/IS/1234567890</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ </storkp:RequestedAttributes>
+ </saml2p:Extensions>
+ <saml2:Subject>
+ <saml2:SubjectConfirmation
+ Method="urn:oasis:names:tc:SAML:1.0:cm:sender-vouches" />
+ </saml2:Subject>
+</saml2p:AttributeQuery> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
index 1ff7fbeeb..7ea486812 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AttrQueryResponse.xml
@@ -1,15 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:obtained" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_483140d440fc4eef8e949ace49669f2e" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#_483140d440fc4eef8e949ace49669f2e"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>yMOVS1T/yRiVh3L6IBM9rR9Ie3w=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>d8e/RyNNPmnHRIzTIuRSnW6B60oWGBGxjRua/HvNxTuod0qSarYJxEedhY9Wl1Z9WYXlry28FuKjp3DA3HhzNaVd7A7QpFqNC4dnizSVWFjxlhmoE/Uv3Y/ha9P/fk6nbtHCSKW4kHSX7QfFLeggcLmUG0IULRF8UmRdQ0WerCl0aSZZeSp8J3LsFBPeWCRSwXgfiLn+RehggzZmQU6g0ssxrpnsYEAtjAiOli+YVQGuumsZGaJ8zHA/DgJ2FTGovNUyfuSUFLhd9nLlSqFs2Avnx0Ck7Q1dxDO5truOm6e285YLHqLaGdetFyPQAj/Z4w4RJ5u5X6d7rhBjTfRAAw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
-YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
-LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
-A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
-Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
-ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
-0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
-6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
-y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
-9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
-6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
-pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
-/NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
-yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
-Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/><saml2p:StatusMessage>urn:oasis:names:tc:SAML:2.0:status:Success</saml2p:StatusMessage></saml2p:Status><saml2:Assertion ID="_9ed05849dee5c154e62fa9e3ba53e9f3" IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer><saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="http://C-PEPS.gov.xx">urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml2:SubjectConfirmationData Address="111.222.333.444" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" NotOnOrAfter="2013-10-08T09:16:17.255Z"/></saml2:SubjectConfirmation></saml2:Subject><saml2:Conditions NotBefore="2013-10-08T09:11:17.255Z" NotOnOrAfter="2013-10-08T09:16:17.255Z"><saml2:AudienceRestriction><saml2:Audience>http://S-PEPS.gov.xx</saml2:Audience></saml2:AudienceRestriction><saml2:OneTimeUse/></saml2:Conditions><saml2:AuthnStatement AuthnInstant="2013-10-08T09:11:17.255Z"><saml2:SubjectLocality Address="111.222.333.444"/><saml2:AuthnContext><saml2:AuthnContextDecl/></saml2:AuthnContext></saml2:AuthnStatement><saml2:AttributeStatement><saml2:Attribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16/12/2008</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/canonicalResidenceAddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:postalCode xsi:type="xs:anyType">105</stork:postalCode><stork:state xsi:type="xs:anyType">IS</stork:state><stork:streetNumber xsi:type="xs:anyType">10</stork:streetNumber><stork:streetName xsi:type="xs:anyType">Gudrunartun</stork:streetName><stork:town xsi:type="xs:anyType">Reykjavik</stork:town></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/newAttribute2" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType"><stork:value3 xsi:type="xs:anyType">value3</stork:value3><stork:value4 xsi:type="xs:anyType">value4</stork:value4><stork:value1 xsi:type="xs:anyType">value1</stork:value1><stork:value2 xsi:type="xs:anyType">value2</stork:value2></saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">16</saml2:AttributeValue><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">18</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" stork:AttributeStatus="Available"><saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:anyType">123456789IS</saml2:AttributeValue></saml2:Attribute></saml2:AttributeStatement></saml2:Assertion></saml2p:Response> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:obtained"
+ Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ID="_483140d440fc4eef8e949ace49669f2e"
+ InResponseTo="_0a22c1120bf2de912714c24e99dd38ed" IssueInstant="2013-10-08T09:11:17.255Z"
+ Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignedInfo>
+ <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+ <ds:Reference URI="#_483140d440fc4eef8e949ace49669f2e">
+ <ds:Transforms>
+ <ds:Transform
+ Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+ <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
+ <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
+ PrefixList="xs" />
+ </ds:Transform>
+ </ds:Transforms>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+ <ds:DigestValue>yMOVS1T/yRiVh3L6IBM9rR9Ie3w=</ds:DigestValue>
+ </ds:Reference>
+ </ds:SignedInfo>
+ <ds:SignatureValue>d8e/RyNNPmnHRIzTIuRSnW6B60oWGBGxjRua/HvNxTuod0qSarYJxEedhY9Wl1Z9WYXlry28FuKjp3DA3HhzNaVd7A7QpFqNC4dnizSVWFjxlhmoE/Uv3Y/ha9P/fk6nbtHCSKW4kHSX7QfFLeggcLmUG0IULRF8UmRdQ0WerCl0aSZZeSp8J3LsFBPeWCRSwXgfiLn+RehggzZmQU6g0ssxrpnsYEAtjAiOli+YVQGuumsZGaJ8zHA/DgJ2FTGovNUyfuSUFLhd9nLlSqFs2Avnx0Ck7Q1dxDO5truOm6e285YLHqLaGdetFyPQAj/Z4w4RJ5u5X6d7rhBjTfRAAw==</ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIDJzCCAg8CBEuonbIwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMCRVMxDjAMBgNVBAgMBVNw
+ YWluMQ8wDQYDVQQHDAZNYWRyaWQxDjAMBgNVBAoMBUluZHJhMRgwFgYDVQQDDA9sb2NhbC1kZW1v
+ LWNlcnQwHhcNMTAwMzIzMTA1MzM4WhcNMTAwNjAxMTA1MzM4WjBYMQswCQYDVQQGEwJFUzEOMAwG
+ A1UECAwFU3BhaW4xDzANBgNVBAcMBk1hZHJpZDEOMAwGA1UECgwFSW5kcmExGDAWBgNVBAMMD2xv
+ Y2FsLWRlbW8tY2VydDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJfdQ1/mkM9sqqab
+ ri8qqqX4s0J6UEEXyF+0AjLU8RC4WMeYFSZ5tfwnyLsoXY0/9bZLXnBxSibQYaf4SnpZJhlVA4sU
+ 0d8qyEWA2OvXGDCm7uspGHG3CRQa7fpHsmHmfIAqho9XDlwpwJdx5gK4Edc6aArcMQfjqMhy1s1n
+ 6Of1i1lMGGsGrERIRY7biIQu/8nITbHH18sUAZMG1u/Q0Avi9O3LWyswHXUouZ818fWwG6xru2N5
+ y6vtVO/SL3doRSdqYkEms93TgxTtaKg8XNe24zhNTte6nvWLaKesi2KzZGC57HU47HBFEs8NWk7z
+ 9BDf8uLyPz9VDahwVKzMto8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAgpuReXQ7Dsfdoe5zzy2F
+ 6kn1qqtMkRGsBPKnDFCI/GkIZpBiqlfwdh6sipnFKWfKEDlPKN1kEhbkDR2GA1Cp4F4ZSL/HumZM
+ pWabRhDxhTPvHIFbbShPDJY93+jw/yQeaWgMuhw3WzdH9TrVoRZH0Q7sG1pIJo5/6IogIZwFvJHT
+ /NDutKmurU6Lw8Vnde8PfnQd+FTEhz0SEGyKkWjAuhGbJfseBy/z3L+MJq1rdSQ9PF7wXDvWNzJq
+ yaNBUWWBV1TskvkNZXcaguroVPy2XhA1aixlAajWEXLk6Uuj5UYqalrV/reNYvDvY0BV2CIn51r7
+ Ppm8IFVTk8mYfX8/jw==</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Status>
+ <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
+ <saml2p:StatusMessage>urn:oasis:names:tc:SAML:2.0:status:Success</saml2p:StatusMessage>
+ </saml2p:Status>
+ <saml2:Assertion ID="_9ed05849dee5c154e62fa9e3ba53e9f3"
+ IssueInstant="2013-10-08T09:11:17.255Z" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://C-PEPS.gov.xx</saml2:Issuer>
+ <saml2:Subject>
+ <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
+ NameQualifier="http://C-PEPS.gov.xx">urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</saml2:NameID>
+ <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
+ <saml2:SubjectConfirmationData
+ Address="111.222.333.444" InResponseTo="_0a22c1120bf2de912714c24e99dd38ed"
+ NotOnOrAfter="2013-10-08T09:16:17.255Z" />
+ </saml2:SubjectConfirmation>
+ </saml2:Subject>
+ <saml2:Conditions NotBefore="2013-10-08T09:11:17.255Z"
+ NotOnOrAfter="2013-10-08T09:16:17.255Z">
+ <saml2:AudienceRestriction>
+ <saml2:Audience>http://S-PEPS.gov.xx</saml2:Audience>
+ </saml2:AudienceRestriction>
+ <saml2:OneTimeUse />
+ </saml2:Conditions>
+ <saml2:AuthnStatement AuthnInstant="2013-10-08T09:11:17.255Z">
+ <saml2:SubjectLocality Address="111.222.333.444" />
+ <saml2:AuthnContext>
+ <saml2:AuthnContextDecl />
+ </saml2:AuthnContext>
+ </saml2:AuthnStatement>
+ <saml2:AttributeStatement>
+ <saml2:Attribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ stork:AttributeStatus="Available">
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">16/12/2008</saml2:AttributeValue>
+ </saml2:Attribute>
+ <saml2:Attribute
+ Name="http://www.stork.gov.eu/1.0/canonicalResidenceAddress"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ stork:AttributeStatus="Available">
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">
+ <stork:postalCode xsi:type="xs:anyType">105</stork:postalCode>
+ <stork:state xsi:type="xs:anyType">IS</stork:state>
+ <stork:streetNumber xsi:type="xs:anyType">10</stork:streetNumber>
+ <stork:streetName xsi:type="xs:anyType">Gudrunartun</stork:streetName>
+ <stork:town xsi:type="xs:anyType">Reykjavik</stork:town>
+ </saml2:AttributeValue>
+ </saml2:Attribute>
+ <saml2:Attribute Name="http://www.stork.gov.eu/1.0/newAttribute2"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ stork:AttributeStatus="Available">
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">
+ <stork:value3 xsi:type="xs:anyType">value3</stork:value3>
+ <stork:value4 xsi:type="xs:anyType">value4</stork:value4>
+ <stork:value1 xsi:type="xs:anyType">value1</stork:value1>
+ <stork:value2 xsi:type="xs:anyType">value2</stork:value2>
+ </saml2:AttributeValue>
+ </saml2:Attribute>
+ <saml2:Attribute Name="http://www.stork.gov.eu/1.0/isAgeOver"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ stork:AttributeStatus="Available">
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">16</saml2:AttributeValue>
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">18</saml2:AttributeValue>
+ </saml2:Attribute>
+ <saml2:Attribute Name="http://www.stork.gov.eu/1.0/eIdentifier"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ stork:AttributeStatus="Available">
+ <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="xs:anyType">123456789IS</saml2:AttributeValue>
+ </saml2:Attribute>
+ </saml2:AttributeStatement>
+ </saml2:Assertion>
+</saml2p:Response> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
index c822702df..c48bfde95 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequest.xml
@@ -1,26 +1,72 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://S-PEPS.gov.xx/PEPS/ColleagueResponse" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest" ForceAuthn="true" ID="_e54eee285e7b8e2772875c406ec39674" IsPassive="false" IssueInstant="2010-06-08T07:37:54.533Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="University of Oxford" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
-<ds:SignedInfo>
-<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
-<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
-<ds:Reference URI="#_e54eee285e7b8e2772875c406ec39674">
-<ds:Transforms>
-<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
-<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml2 saml2p stork storkp xs"/></ds:Transform>
-</ds:Transforms>
-<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-<ds:DigestValue>yzsqaxBNicOrixBUno5cL0CBOpE=</ds:DigestValue>
-</ds:Reference>
-</ds:SignedInfo>
-<ds:SignatureValue>
-Xycll1PF7hh3Xdykpr6nIr8Q6PQ6OxLIBBBugoGpAm/V4Hu7tKakHJp8TgtRWZ30jG5eolOXnJkC
-wiaTVUFaQz7cNn27syRJkdA+eYlz9doiwUJ5eD1cAyddZYsNPpSeAj5UK45oN0qCH+/pI9mRw8Oi
-YIN/BUEtXkoYTjPtkmA=
-</ds:SignatureValue>
-<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBmDCCAQECBEuWisIwDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UEAxMIY291bnRyeTEwHhcNMTAw
-MzA5MTc1MjAyWhcNMTAwNjA3MTc1MjAyWjATMREwDwYDVQQDEwhjb3VudHJ5MTCBnzANBgkqhkiG
-9w0BAQEFAAOBjQAwgYkCgYEAnb2gcchwxvJBclcsfCBWJnYefLJYQnDGCQ3RUtYZc26JznnLXclu
-h1XfLJlWgYk/pFKz7B9KfJztal47c6mBfisnxjhdcLqcbXOuRIm7E8TZPzdbHEd60WHPDv20jr+r
-/WkOQs12tKQMbgDX2wtBBcJODLYCDiYa1oQsnyhdOGkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBk
-3luVRc0EqEE1zZeYvRPi5a2yOZfI9H+/rXI1qNLwmICnuJX++ukUbqJHm/FV1iSPM9O9oqzifJ/K
-eKL5EcUugJ76Tu5XO8za2FoJvYr+jIZDsEkCg+OSzcp/eljiWAIh2enZcQ/ON6QxWXeSNJPH0xOq
-KAoZgbUK0Zld3Dsheg==</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><stork:spSector>EDU001</stork:spSector><stork:spInstitution>OXF001</stork:spInstitution><stork:spApplication>APP001</stork:spApplication><stork:spCountry>EN</stork:spCountry><storkp:eIDSectorShare>true</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>true</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>true</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">16</stork:AttributeValue><stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">18</stork:AttributeValue></stork:RequestedAttribute><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="false"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:assertion" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ AssertionConsumerServiceURL="http://S-PEPS.gov.xx/PEPS/ColleagueResponse"
+ Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://C-PEPS.gov.xx/PEPS/ColleagueRequest"
+ ForceAuthn="true" ID="_e54eee285e7b8e2772875c406ec39674" IsPassive="false"
+ IssueInstant="2010-06-08T07:37:54.533Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
+ ProviderName="University of Oxford" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignedInfo>
+ <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
+ <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
+ <ds:Reference URI="#_e54eee285e7b8e2772875c406ec39674">
+ <ds:Transforms>
+ <ds:Transform
+ Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
+ <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
+ <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
+ PrefixList="ds saml2 saml2p stork storkp xs" />
+ </ds:Transform>
+ </ds:Transforms>
+ <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
+ <ds:DigestValue>yzsqaxBNicOrixBUno5cL0CBOpE=</ds:DigestValue>
+ </ds:Reference>
+ </ds:SignedInfo>
+ <ds:SignatureValue>
+ Xycll1PF7hh3Xdykpr6nIr8Q6PQ6OxLIBBBugoGpAm/V4Hu7tKakHJp8TgtRWZ30jG5eolOXnJkC
+ wiaTVUFaQz7cNn27syRJkdA+eYlz9doiwUJ5eD1cAyddZYsNPpSeAj5UK45oN0qCH+/pI9mRw8Oi
+ YIN/BUEtXkoYTjPtkmA=
+ </ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIBmDCCAQECBEuWisIwDQYJKoZIhvcNAQEFBQAwEzERMA8GA1UEAxMIY291bnRyeTEwHhcNMTAw
+ MzA5MTc1MjAyWhcNMTAwNjA3MTc1MjAyWjATMREwDwYDVQQDEwhjb3VudHJ5MTCBnzANBgkqhkiG
+ 9w0BAQEFAAOBjQAwgYkCgYEAnb2gcchwxvJBclcsfCBWJnYefLJYQnDGCQ3RUtYZc26JznnLXclu
+ h1XfLJlWgYk/pFKz7B9KfJztal47c6mBfisnxjhdcLqcbXOuRIm7E8TZPzdbHEd60WHPDv20jr+r
+ /WkOQs12tKQMbgDX2wtBBcJODLYCDiYa1oQsnyhdOGkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBk
+ 3luVRc0EqEE1zZeYvRPi5a2yOZfI9H+/rXI1qNLwmICnuJX++ukUbqJHm/FV1iSPM9O9oqzifJ/K
+ eKL5EcUugJ76Tu5XO8za2FoJvYr+jIZDsEkCg+OSzcp/eljiWAIh2enZcQ/ON6QxWXeSNJPH0xOq
+ KAoZgbUK0Zld3Dsheg==</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Extensions>
+ <stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel>
+ <stork:spSector>EDU001</stork:spSector>
+ <stork:spInstitution>OXF001</stork:spInstitution>
+ <stork:spApplication>APP001</stork:spApplication>
+ <stork:spCountry>EN</stork:spCountry>
+ <storkp:eIDSectorShare>true</storkp:eIDSectorShare>
+ <storkp:eIDCrossSectorShare>true</storkp:eIDCrossSectorShare>
+ <storkp:eIDCrossBorderShare>true</storkp:eIDCrossBorderShare>
+ <storkp:RequestedAttributes>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/isAgeOver"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true">
+ <stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">16</stork:AttributeValue>
+ <stork:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">18</stork:AttributeValue>
+ </stork:RequestedAttribute>
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="false" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/eIdentifier"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ </storkp:RequestedAttributes>
+ </saml2p:Extensions>
+</saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
index 2a54c7d59..8766f9a8b 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDelete.xml
@@ -1,14 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://locahost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
-<ds:SignatureValue>
-S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
-Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
-Xt8p8tK3EoMocZse2hw=
-</ds:SignatureValue>
-<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
-OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
-lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
-ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
-r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
-kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
-3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage"
+ Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://locahost:8080/PEPS/ServiceProvider"
+ ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false"
+ IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
+ ProviderName="PT-SP" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignatureValue>
+ S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+ Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+ Xt8p8tK3EoMocZse2hw=
+ </ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+ OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+ A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+ lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+ r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+ kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+ 3cyl/wz8</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Extensions>
+ <stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel>
+ <storkp:eIDSectorShare>false</storkp:eIDSectorShare>
+ <storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare>
+ <storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare>
+ <storkp:RequestedAttributes>
+ <stork:RequestedAttribute
+ Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ </storkp:RequestedAttributes>
+ </saml2p:Extensions>
+</saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
index 3239cf6e7..1b1e1646c 100644
--- a/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/data/eu/stork/STORKSAMLEngine/AuthnRequestTagDeleteEncoded.xml
@@ -1,14 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?><saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://localhost:8080/PEPS/ServiceProvider" ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false" IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" ProviderName="PT-SP" Version="2.0"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
-<ds:SignatureValue>
-S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
-Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
-Xt8p8tK3EoMocZse2hw=
-</ds:SignatureValue>
-<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
-OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
-A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
-lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
-ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
-r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
-kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
-3cyl/wz8</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Extensions><stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel><storkp:eIDSectorShare>false</storkp:eIDSectorShare><storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare><storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare><storkp:RequestedAttributes><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/><stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" isRequired="true"/></storkp:RequestedAttributes></saml2p:Extensions></saml2p:AuthnRequest> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:stork="urn:eu:stork:names:tc:STORK:1.0:stork" xmlns:storkp="urn:eu:stork:names:tc:STORK:1.0:protocol"
+ AssertionConsumerServiceURL="http://localhost:8080/SP/ReturnPage"
+ Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="http://localhost:8080/PEPS/ServiceProvider"
+ ForceAuthn="true" ID="_0c64ff85-1323-4618-847b-12d1983b86e4" IsPassive="false"
+ IssueInstant="2010-04-07T16:45:03.593Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
+ ProviderName="PT-SP" Version="2.0">
+ <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://S-PEPS.gov.xx</saml2:Issuer>
+ <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <ds:SignatureValue>
+ S6nY97RSCUJXq3HZ5obSLCI341LvtAA3vHjR1FWxrIMDPACQMqlNWBYNnRP1RiZiJV6x0RieH+SR
+ Vkiy03jYyhr0XkwAE5Wd6Huf+zIbeTXjZkdQj7JpAXoB+ky4G/+L0deamvsP3eO7ZJ4grady4gmC
+ Xt8p8tK3EoMocZse2hw=
+ </ds:SignatureValue>
+ <ds:KeyInfo>
+ <ds:X509Data>
+ <ds:X509Certificate>MIIBkTCB+wIESpT8bTANBgkqhkiG9w0BAQUFADAQMQ4wDAYDVQQDEwVzdG9yazAeFw0wOTA4MjYw
+ OTEyMTNaFw0wOTExMjQwOTEyMTNaMBAxDjAMBgNVBAMTBXN0b3JrMIGfMA0GCSqGSIb3DQEBAQUA
+ A4GNADCBiQKBgQDK/QL8NuMd41I1lObObeRA6DaM8bjeYqIz5mg5WnnZv4jlcK7Gq89Lk6htXRFl
+ lAXpDYhI3zolMIMHEMZ3zQQPc7lgTV6Bbz9uD2YTJ9Kx55e8Y6Y49DO+TiiejGJxTzTFUcuBJHaK
+ ipuvLVd1a8N3RAnaGSUOozhrTqxba82mEwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFJgeS18nhUl
+ r7WnvSn9FlkI94U//Hk3iZLc3/cScTu7D7Y/J0eUq4TF8PsSzWX5khGuqrTkswNgfEtl2IpACQ2w
+ kB8+RxeRNdddQlGHlO4ZqnpvxXBwSouiy2yUeAo0y++vMFm6DO4sxfk8eTtimPDo5SzBtjtGtbqS
+ 3cyl/wz8</ds:X509Certificate>
+ </ds:X509Data>
+ </ds:KeyInfo>
+ </ds:Signature>
+ <saml2p:Extensions>
+ <stork:QualityAuthenticationAssuranceLevel>3</stork:QualityAuthenticationAssuranceLevel>
+ <storkp:eIDSectorShare>false</storkp:eIDSectorShare>
+ <storkp:eIDCrossSectorShare>false</storkp:eIDCrossSectorShare>
+ <storkp:eIDCrossBorderShare>false</storkp:eIDCrossBorderShare>
+ <storkp:RequestedAttributes>
+ <stork:RequestedAttribute
+ Name="http://www.stork.gov.eu/1.0/nationalityCode" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/dateOfBirth"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ <stork:RequestedAttribute Name="http://www.stork.gov.eu/1.0/givenName"
+ NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
+ isRequired="true" />
+ </storkp:RequestedAttributes>
+ </saml2p:Extensions>
+</saml2p:AuthnRequest> \ No newline at end of file
diff --git a/id/server/stork2-saml-engine/src/test/resources/logback-test.xml b/id/server/stork2-saml-engine/src/test/resources/logback-test.xml
index ff900e124..99d7d353a 100644
--- a/id/server/stork2-saml-engine/src/test/resources/logback-test.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/logback-test.xml
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Basic configuration used until the IdP can load the real configuration
- -->
+<!-- Basic configuration used until the IdP can load the real configuration -->
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
diff --git a/id/server/stork2-saml-engine/src/test/resources/p11Conf.cfg b/id/server/stork2-saml-engine/src/test/resources/p11Conf.cfg
index b712219c1..bd9f357ce 100644
--- a/id/server/stork2-saml-engine/src/test/resources/p11Conf.cfg
+++ b/id/server/stork2-saml-engine/src/test/resources/p11Conf.cfg
@@ -1,24 +1,24 @@
-//ATTRIBUTE VALUE
-//name name suffix of this provider instance
-//library pathname of PKCS#11 implementation
-//slotListIndex slot index
-
-//PREFIX DESCRIPTION
-//CKO_ Object class
-//CKA_ Attribute
-//CKK_ Key type
-
-//attributes(operation, keytype, keyalgorithm) = {
-// name1 = value1
-// [...]
-//}
-
-name=nameProvider
-library=library.dll
-slotListIndex=0
-attributes(*,CKO_PUBLIC_KEY,CKK_RSA)={
- CKA_VERIFY=true
-}
-attributes(*,CKO_PRIVATE_KEY,CKK_RSA)={
- CKA_SIGN=true
+//ATTRIBUTE VALUE
+//name name suffix of this provider instance
+//library pathname of PKCS#11 implementation
+//slotListIndex slot index
+
+//PREFIX DESCRIPTION
+//CKO_ Object class
+//CKA_ Attribute
+//CKK_ Key type
+
+//attributes(operation, keytype, keyalgorithm) = {
+// name1 = value1
+// [...]
+//}
+
+name=nameProvider
+library=library.dll
+slotListIndex=0
+attributes(*,CKO_PUBLIC_KEY,CKK_RSA)={
+ CKA_VERIFY=true
+}
+attributes(*,CKO_PRIVATE_KEY,CKK_RSA)={
+ CKA_SIGN=true
} \ No newline at end of file
diff --git a/id/templates/pom.xml b/id/templates/pom.xml
deleted file mode 100644
index 8ffc7b9c6..000000000
--- a/id/templates/pom.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>MOA</groupId>
- <artifactId>id</artifactId>
- <version>1.9.98-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>MOA.id</groupId>
- <artifactId>moa-id-templates</artifactId>
- <packaging>war</packaging>
- <version>1.5.2</version>
- <name>MOA ID Sample Templates</name>
-
- <properties>
- <repositoryPath>${basedir}/../../repository</repositoryPath>
- </properties>
-
- <build>
- <finalName>moaid-templates</finalName>
- </build>
-
-</project>
diff --git a/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html b/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html
deleted file mode 100644
index 251793a93..000000000
--- a/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>MOA ID - Auswahl der B&uuuml;rgerkartenumgebung</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="Author" content="Max Mustermann">
- <meta name="keywords" content="MOA-ID">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/main.css">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/display.css" media="screen,projection,tv,handheld">
-</head>
-
-<body>
-<img src="/moaid-templates/SampleLogo.gif" alt='Organisation XY'>
-<h1 align="center">Auswahl der B&uuml;rgerkartenumgebung</h1>
-<p></p>
-<p>Sie haben sich f&uuml;r Anmeldung mit Ihrer B&uuml;rgerkarte entschieden. Da es verschiedene Formen der B&uuml;rgerkarte gibt, m&uuml;ssen Sie nun w&auml;hlen, welche Sie bei der Anmeldung verwenden wollen.</p>
-<h3>Auswahl der B&uuml;rgerkarte</h3>
-<form name="CustomizedForm" method="post" action="<StartAuth>">
- <BKUSelect>
- <input type="submit" value="Ausw&auml;hlen"/>
-</form>
-<br/>
-<p></p>
-
- <input type="hidden" value="Weitere Info"/>
-</form>
-
-<h4>Hinweise: </h4>
-<ul>
- <li>
- <p>Wollen Sie eine A-Trust B&uuml;rgerkarte erwerben? Hier finden Sie Informationen
- dazu: <a href="http://www.a-trust.at/info.asp?node=337" target="_blank">A-Trust
- B&uuml;rgerkarte.</a> Bei der Anmeldung mit der A-Trust B&uuml;rgerkarte
- ben&ouml;tigen Sie eine funktionsf&auml;hige B&uuml;rgerkartensoftware sowie
- einen passenden Kartenleser.</p>
- </li>
-</ul>
-
-
-</body>
-</html>
diff --git a/id/templates/src/main/webapp/SampleInputProcessorSignTemplate.html b/id/templates/src/main/webapp/SampleInputProcessorSignTemplate.html
deleted file mode 100644
index c9b0a37b3..000000000
--- a/id/templates/src/main/webapp/SampleInputProcessorSignTemplate.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>MOA ID - Identifizierter Zugang mit B&uuml;rgerkarte</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="Author" content="Max Mustermann">
- <meta name="keywords" content="MOA-ID">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/main.css">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/display.css" media="screen,projection,tv,handheld">
- <script language="javascript" type="text/javascript">
- //<!--
- function autoSubmit() {
- document.VerifyAuthBlockForm.submitButton.disabled=true;
- document.VerifyAuthBlockForm.submit();
- } //-->
- </script>
-</head>
-
-<body onLoad="autoSubmit()">
-<img src="/moaid-templates/SampleLogo.gif" alt='Organisation XY'>
-<h1 align="center">Sicherer Zugang zur Online-Anwendung mit B&uuml;rgerkarte</h1>
-<p></p>
-
-Der identifizierte Zugang erfolgt &uuml;ber die Module f&uuml;r Online Applikationen (MOA) unter Verwendung einer B&uuml;rgerkarte und deren Signaturfunktion.
-
-<p></p>
-<p>Sie werden in ku&uuml;rze zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese
-signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.</p>
-
-<form name="VerifyAuthBlockForm" action="<BKU>" method="post" enctype="application/x-www-form-urlencoded">
- <div align="center">
- <input type="hidden" name="XMLRequest" value="<XMLRequest>"/>
- <input type="hidden" name="DataURL" value="<DataURL>"/>
- <input type="hidden" name="PushInfobox" value="<PushInfobox>"/>
- <input type="submit" value="Signieren der Anmeldedaten" id="submitButton"/>
- </div>
-</form>
-
-<div align="right"><a href="http://validator.w3.org/check?uri=http://localhost:8080/moaid-templates/SampleTemplate.html"><img border="0"
- src="/moaid-templates/valid-html401.gif"
- alt="Valid HTML 4.01!" height="31" width="88"></a> </div>
-<p align="right">&nbsp; </p>
-
-</body>
-</html>
diff --git a/id/templates/src/main/webapp/SampleLogo.gif b/id/templates/src/main/webapp/SampleLogo.gif
deleted file mode 100644
index 4b7c682b1..000000000
--- a/id/templates/src/main/webapp/SampleLogo.gif
+++ /dev/null
Binary files differ
diff --git a/id/templates/src/main/webapp/SampleTemplate.html b/id/templates/src/main/webapp/SampleTemplate.html
deleted file mode 100644
index 824c7153c..000000000
--- a/id/templates/src/main/webapp/SampleTemplate.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>MOA ID - Identifizierter Zugang mit B&uuml;rgerkarte</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="Author" content="Max Mustermann">
- <meta name="keywords" content="MOA-ID">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/main.css">
- <link rel="stylesheet" type="text/css" href="/moaid-templates/css/display.css" media="screen,projection,tv,handheld">
-</head>
-
-<body>
-<img src="/moaid-templates/SampleLogo.gif" alt='Organisation XY'>
-<h1 align="center">Sicherer Zugang zur Online-Anwendung mit B&uuml;rgerkarte</h1>
-<p></p>
-
-Der identifizierte Zugang erfolgt &uuml;ber die Module f&uuml;r Online Applikationen (MOA) unter Verwendung einer B&uuml;rgerkarte und deren Signaturfunktion.
-
-<p></p>
-<p>Wenn Sie in Folge die Schaltfl&auml;che "Anmeldung mit B&uuml;rgerkarte"
-aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese
-signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.</p>
-
-
-<form name="CustomizedForm" action="<BKU>" method="post">
- <div align="center">
- <input type="hidden" name="XMLRequest" value="<XMLRequest>"/>
- <input type="hidden" name="DataURL" value="<DataURL>"/>
- <input type="hidden" name="PushInfobox" value="<PushInfobox>"/>
- <input type="submit" value="Anmeldung mit B&uuml;rgerkarte" name="submit"/>
- </div>
-</form>
-<form name="CustomizedInfoForm" action="<BKU>" method="post">
- <input type="hidden" name="XMLRequest" value="<CertInfoXMLRequest>"/>
- <input type="hidden" name="DataURL" value="<CertInfoDataURL>"/>
-<br/>
-<p></p>
- <input type="hidden" value="Weitere Info"/>
-</form>
-
-<div align="right"><a href="http://validator.w3.org/check?uri=http://localhost:8080/moaid-templates/SampleTemplate.html"><img border="0"
- src="/moaid-templates/valid-html401.gif"
- alt="Valid HTML 4.01!" height="31" width="88"></a> </div>
-<p align="right">&nbsp; </p>
-
-</body>
-</html>
diff --git a/id/templates/src/main/webapp/WEB-INF/web.xml b/id/templates/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 6954e9c87..000000000
--- a/id/templates/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
-
-<web-app>
- <display-name>Sample MOA-ID Templates</display-name>
- <description>>Sample MOA-ID Templates</description>
-</web-app>
-
diff --git a/id/templates/src/main/webapp/css/display.css b/id/templates/src/main/webapp/css/display.css
deleted file mode 100644
index fc6da85b0..000000000
--- a/id/templates/src/main/webapp/css/display.css
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Beispiel Display-Stylesheet */
-
-span.printText {
- font-size:80%;
- margin-left:1em;
- margin-top:-1.2em;
- margin-bottom:1em;
- font-weight:bold;
- float:right
-}
-
-#mainmenu {
- padding-left: 8px
-}
-
-#currentcontext {
- background-color:#eff3ff;
- border-top: 1px solid #76769f;
- border-bottom: 1px solid #76769f;
-}
-
-#contextmenu {
- position: absolute;
- padding-top: 0.5em;
- margin-top: 1em;
- background: #e7e9f6;
- width: 12.5em;
-}
-
-#contextmenubottom {
- padding-top:1em;
- background:white;
- background-image:url(/style/img/mnv.gif);
- background-repeat:repeat-x;
-}
-
-#contentcontainer {
- position: absolute;
- padding: 0px;
- margin-left: 13.5em;
- margin-top: 1em;
- width: 40em;
- text-align: justify;
-}
-
-#content {
- margin-top:0em;
- margin-left:1em;
-}
-
-
-/* #z_location { font-size:80%; margin-left:1em; padding-top:1em; } */
diff --git a/id/templates/src/main/webapp/css/main.css b/id/templates/src/main/webapp/css/main.css
deleted file mode 100644
index bcad5589c..000000000
--- a/id/templates/src/main/webapp/css/main.css
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Haupt-Stylesheet fuer z.B. für CIO/ciointern/iktintern/WSIS Webseite sowie in MOA-ID Templates*/
-/* Original design by Tinfish Media Lab */
-/* Additional design by Bernd Martin, Arno Hollosi */
-
-body {
- margin-bottom:0.5em;
- margin-right:2em;
- margin-left:0.5em;
- margin-top:0.5em;
- background-color:#FFFFFF;
- color:#000000;
-}
-
-/* Font */
-body,table,td,th
-{
- font-family:arial,sans-serif;
- font-size:small;
-}
-th { background-color:#ffffbb; color:#000000; }
-
-
-/* Ueberschriften */
-h1,h2,h3,h4,h5
-{
- color:#336699;
- background-color:#FFFFFF;
-}
-h1 { font-size:140%; }
-h2 { font-size:120%; }
-h3 { font-size:110%; }
-
-/* Links */
-a:link { color:#336699; text-decoration:none; }
-a:visited { color:#660066; text-decoration:none; }
-a:active { color:#336699; text-decoration:none; }
-a:hover { color:#000000; text-decoration:underline; }
-
-dt { font-weight:bold; }
-
-dl.filelist dt { font-weight: normal; }
-dl.filelist dd { margin-bottom: 0.5em; }
-
-
-div.pic { font-size:80%; color:#888888; background-color:#FFFFFF; }
-
-div.verz0 { margin-left:0em; }
-div.verz1 { margin-left:1em; }
-div.verz2 { margin-left:2em; }
-div.verz3 { margin-left:3em; }
-div.verz4 { margin-left:4em; }
-div.verz5 { margin-left:5em; }
-div.verz6 { margin-left:6em; }
-div.verz7 { margin-left:7em; }
-
-div.backLink { font-size:70%; margin-left:0em; margin-bottom:0em; font-weight:bold }
-div.noJavaScript { font-size:70%; margin-top:1.2em; margin-bottom:1.2em; font-weight:bold }
-
-div.newsDate { font-size:70%; margin-left:0em; margin-bottom:0em; margin-top:1em; font-weight:bold }
-div.newsTitle { font-size:100%; margin-left:0em; margin-bottom:0.1em; font-weight:bold }
-div.newsDesc { font-size:90%; margin-left:2em; margin-bottom:0em; }
-div.newsCreator { font-size:70%; margin-left:2.6em; margin-bottom:1em; }
-div.newsResultDesc { font-size:90%; margin-left:2em; margin-bottom:1em; }
-
-div.indentSmall { margin-left:1em }
-div.indentNormal { margin-left:1.5em }
-div.indentHigh { margin-left:2em }
-
-div.pic { font-size:80%; color:#888888; background-color:#FFFFFF; }
-
-span.hinw { color:#993333; background-color:#FFFFFF; }
-span.filesizeinfo { font-size:75% }
-span.imprintText { font-size:80%; margin-left:1em; float:right }
-span.footer { font-size:80%; margin-left:1em; margin-bottom:1em;}
diff --git a/id/templates/src/main/webapp/valid-html401.gif b/id/templates/src/main/webapp/valid-html401.gif
deleted file mode 100644
index 1270561e1..000000000
--- a/id/templates/src/main/webapp/valid-html401.gif
+++ /dev/null
Binary files differ
diff --git a/pom.xml b/pom.xml
index ca41e3ce7..06908810c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,6 +9,7 @@
<properties>
<repositoryPath>${basedir}/repository</repositoryPath>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
@@ -64,9 +65,11 @@
<plugin>
<inherited>false</inherited>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.4</version>
+ <version>2.2-beta-1</version>
+ <!-- TODO Update Version 2.2-beta-1 for MOA-SPSS -->
<configuration>
<finalName>moa</finalName>
+ <encoding>UTF-8</encoding>
<descriptors>
<descriptor>id/assembly-auth.xml</descriptor>
<descriptor>id/assembly-proxy.xml</descriptor>
@@ -145,7 +148,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.14</version>
+ <version>1.2.17</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -198,7 +201,7 @@
<dependency>
<groupId>MOA.id.server</groupId>
<artifactId>moa-id-lib</artifactId>
- <version>1.9.98-SNAPSHOT</version>
+ <version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -229,7 +232,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
+ <version>1.1.3</version>
<scope>compile</scope>
</dependency>
@@ -352,18 +355,18 @@
<!-- TSL -->
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_tsl</artifactId>
<version>1.0</version>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_util</artifactId>
<version>0.23</version>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_xsect</artifactId>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
<version>1.1709142</version>
</dependency>
<dependency>
@@ -382,7 +385,7 @@
<version>3.7.8-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_jsse</artifactId>
<version>4.4</version>
</dependency>
@@ -469,6 +472,12 @@
<type>dll</type>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+
</dependencies>
<repositories>
diff --git a/repository/eu/stork/Commons/1.2.0/Commons-1.2.0.jar b/repository/eu/stork/Commons/1.2.0/Commons-1.2.0.jar
deleted file mode 100644
index 4332a474d..000000000
--- a/repository/eu/stork/Commons/1.2.0/Commons-1.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.jar b/repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.jar
new file mode 100644
index 000000000..2943eac88
--- /dev/null
+++ b/repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.jar
Binary files differ
diff --git a/repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.pom b/repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.pom
index ef04f07c4..7dab86ee0 100644
--- a/repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.pom
+++ b/repository/eu/stork/oasis-dss-api/1.0.0-RELEASE/oasis-dss-api-1.0.0-RELEASE.pom
@@ -3,32 +3,10 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>oasis-dss-api</artifactId>
<groupId>eu.stork</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-RELEASE</version>
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxb2-maven-plugin</artifactId>
- <version>1.5</version>
- <executions>
- <execution>
- <id>oasis-dss</id>
- <goals>
- <goal>xjc</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <args>
- <arg>-npa</arg>
- </args>
- <schemaDirectory>${project.basedir}/src/main/resources/schema/oasis-dss</schemaDirectory>
- <schemaFiles>oasis-dss-core-schema-v1.0-os.xsd</schemaFiles>
- <packageName>eu.stork.oasisdss.profile</packageName>
- <extension>true</extension>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
@@ -75,11 +53,21 @@
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
+<!-- <dependency> -->
+<!-- <groupId>org.jvnet.jaxb2_commons</groupId> -->
+<!-- <artifactId>jaxb2-namespace-prefix</artifactId> -->
+<!-- <version>1.1</version> -->
+<!-- </dependency> -->
<dependency>
- <groupId>com.sun.xml.ws</groupId>
- <artifactId>jaxws-rt</artifactId>
- <version>2.1.7</version>
+ <groupId>eu.medsea.mimeutil</groupId>
+ <artifactId>mime-util</artifactId>
+ <version>2.1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
-
</dependencies>
</project> \ No newline at end of file
diff --git a/repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.jar b/repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.jar
deleted file mode 100644
index 5ad0cb42e..000000000
--- a/repository/eu/stork/oasis-dss-api/1.0.0-SNAPSHOT/oasis-dss-api-1.0.0-SNAPSHOT.jar
+++ /dev/null
Binary files differ
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.jar b/repository/iaik/asit/1.3.4/asit-1.3.4.jar
new file mode 100644
index 000000000..e331f467c
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.jar
Binary files differ
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.jar.md5 b/repository/iaik/asit/1.3.4/asit-1.3.4.jar.md5
new file mode 100644
index 000000000..b34c0523d
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.jar.md5
@@ -0,0 +1 @@
+b7224977a72089a9d5e78af0b402c56d \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.jar.sha1 b/repository/iaik/asit/1.3.4/asit-1.3.4.jar.sha1
new file mode 100644
index 000000000..c7a57ac50
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.jar.sha1
@@ -0,0 +1 @@
+d3d60e9f28392c28c8a8ece918281bce5358dd59 \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.pom b/repository/iaik/asit/1.3.4/asit-1.3.4.pom
new file mode 100644
index 000000000..93ca1f600
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.pom
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>iaik</groupId>
+ <artifactId>asit</artifactId>
+ <version>1.3.4</version>
+
+ <packaging>jar</packaging>
+
+ <name>A-SIT framework</name>
+ <description>Framework fuer A-SIT Anwendungen</description>
+ <url>http://www.iaik.tugraz.at</url>
+ <inceptionYear>2007</inceptionYear>
+
+ <developers>
+ <developer>
+ <id>atauber</id>
+ <name>Arne Tauber</name>
+ <organization>IAIK</organization>
+ <email>arne.tauber@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>tknall</id>
+ <name>Thomas Knall</name>
+ <organization>IAIK</organization>
+ <email>thomas.knall@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>troessler</id>
+ <name>Thomas Roessler</name>
+ <organization>IAIK</organization>
+ <email>thomas.roessler@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <ciManagement>
+ <system>continuum</system>
+ <url>http://development:8088/continuum</url>
+ <notifiers>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>tknall</address>
+ </configuration>
+ </notifier>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>atauber</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+
+ <scm>
+ <connection>scm:svn:http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</connection>
+ <developerConnection>scm:svn:http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</developerConnection>
+ <url>http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</url>
+ </scm>
+
+ <organization>
+ <name>Institut fuer Angewandte Informationsverarbeitung und Kommunikationstechnologie</name>
+ <url>http://www.iaik.tugraz.at/</url>
+ </organization>
+
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <url>
+ file://development/c:/data/public/websites/PROJECTS/${pom.artifactId}/${pom.version}
+ </url>
+ </site>
+ </distributionManagement>
+
+ <build>
+
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>**/package.html</exclude>
+ <exclude>**/.svn</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/package.html</exclude>
+ <exclude>**/.svn</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <finalName>${artifactId}-${version}</finalName>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- skip>true</skip-->
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <locales>en</locales>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArguments>
+ <verbose />
+ </compilerArguments>
+ <excludes>
+ <exclude>asit/test/*/</exclude>
+ </excludes>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <!--mainClass>resource_uri_to_main_class</mainClass-->
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>src/main/assembly/assemble_libraries.xml</descriptor>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <public>true</public>
+ <package>true</package>
+ <private>true</private>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <link>http://struts.apache.org/1.2.4/api/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ </links>
+ <source>1.4</source>
+ <target>1.4</target>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank"&gt;${pom.organization.name}&lt;/a&gt;. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>project-team</report>
+ <!-- report>mailing-list</report -->
+ <!-- report>cim</report -->
+ <!-- report>issue-tracking</report -->
+ <!-- >report>license</report -->
+ <!-- >report>scm</report -->
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <public>true</public>
+ <package>true</package>
+ <private>true</private>
+ <links>
+ <link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <link>http://struts.apache.org/1.2.4/api/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ </links>
+ <source>1.4</source>
+ <target>1.4</target>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank"&gt;${pom.organization.name}&lt;/a&gt;. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ <!--
+ <plugin>
+ <groupId>www.ibiblio.org</groupId>
+ <artifactId>maven-jcoverage-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-docck-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changes-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-doap-plugin</artifactId>
+ <plugin>
+ </plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ </plugin>
+ -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-changes-plugin</artifactId>
+ <configuration>
+ <xmlPath>${basedir}/src/site/changes.xml</xmlPath>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>changes-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <showSuccess>true</showSuccess>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>${basedir}/src/site/checkstyle.xml</configLocation>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ <dependencies>
+ <!-- see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version> <!-- was: 2.3.1 -->
+ <scope>provided</scope>
+ <!--
+ available scopes: compile, provided, runtime, test, system
+ -->
+ <!--
+ projects that are libraries should declare dependencies as optional
+ see: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
+ -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts</artifactId>
+ <version>1.2.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.142</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ixsil_eval</artifactId>
+ <version>1.2.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version> <!-- was: 1.3.1 -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_eval_signed</artifactId>
+ <version>2.15</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>2.1.7c</version> <!-- was: 2.1.7 -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>fop</groupId>
+ <artifactId>fop</artifactId>
+ <version>0.20.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-jaxrpc</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>4.1.31</version> <!-- was: unknown -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.pom.md5 b/repository/iaik/asit/1.3.4/asit-1.3.4.pom.md5
new file mode 100644
index 000000000..3bfb19649
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.pom.md5
@@ -0,0 +1 @@
+f42cef68752c2b2c0d6de5a6fb1a9d7c \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.4/asit-1.3.4.pom.sha1 b/repository/iaik/asit/1.3.4/asit-1.3.4.pom.sha1
new file mode 100644
index 000000000..9253d46cf
--- /dev/null
+++ b/repository/iaik/asit/1.3.4/asit-1.3.4.pom.sha1
@@ -0,0 +1 @@
+dd7966e311b2b719ecabe6bb7b6bde3f80d7ce01 \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.5/asit-1.3.5.jar b/repository/iaik/asit/1.3.5/asit-1.3.5.jar
new file mode 100644
index 000000000..f04ec1e6f
--- /dev/null
+++ b/repository/iaik/asit/1.3.5/asit-1.3.5.jar
Binary files differ
diff --git a/repository/iaik/asit/1.3.5/asit-1.3.5.jar.sha1 b/repository/iaik/asit/1.3.5/asit-1.3.5.jar.sha1
new file mode 100644
index 000000000..564da72b0
--- /dev/null
+++ b/repository/iaik/asit/1.3.5/asit-1.3.5.jar.sha1
@@ -0,0 +1 @@
+56ef339009e19c81b9ead9262c43a84371e2aa73 \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.5/asit-1.3.5.pom b/repository/iaik/asit/1.3.5/asit-1.3.5.pom
new file mode 100644
index 000000000..58a6e5a09
--- /dev/null
+++ b/repository/iaik/asit/1.3.5/asit-1.3.5.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>asit</artifactId>
+ <version>1.3.5</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/asit/1.3.5/asit-1.3.5.pom.sha1 b/repository/iaik/asit/1.3.5/asit-1.3.5.pom.sha1
new file mode 100644
index 000000000..0fa712339
--- /dev/null
+++ b/repository/iaik/asit/1.3.5/asit-1.3.5.pom.sha1
@@ -0,0 +1 @@
+72c48087cb86db39f62d955159710f6cb8dc5d04 \ No newline at end of file
diff --git a/repository/iaik/asit/1.3.6/asit-1.3.6-javadoc.jar b/repository/iaik/asit/1.3.6/asit-1.3.6-javadoc.jar
new file mode 100644
index 000000000..1ba8dc308
--- /dev/null
+++ b/repository/iaik/asit/1.3.6/asit-1.3.6-javadoc.jar
Binary files differ
diff --git a/repository/iaik/asit/1.3.6/asit-1.3.6-sources.jar b/repository/iaik/asit/1.3.6/asit-1.3.6-sources.jar
new file mode 100644
index 000000000..ae38e3336
--- /dev/null
+++ b/repository/iaik/asit/1.3.6/asit-1.3.6-sources.jar
Binary files differ
diff --git a/repository/iaik/asit/1.3.6/asit-1.3.6.jar b/repository/iaik/asit/1.3.6/asit-1.3.6.jar
new file mode 100644
index 000000000..8a754fe81
--- /dev/null
+++ b/repository/iaik/asit/1.3.6/asit-1.3.6.jar
Binary files differ
diff --git a/repository/iaik/asit/1.3.6/asit-1.3.6.pom b/repository/iaik/asit/1.3.6/asit-1.3.6.pom
new file mode 100644
index 000000000..7770aef52
--- /dev/null
+++ b/repository/iaik/asit/1.3.6/asit-1.3.6.pom
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>iaik</groupId>
+ <artifactId>asit</artifactId>
+ <version>1.3.6</version>
+
+ <packaging>jar</packaging>
+
+ <name>A-SIT framework</name>
+ <description>Framework fuer A-SIT Anwendungen</description>
+ <url>http://www.iaik.tugraz.at</url>
+ <inceptionYear>2007</inceptionYear>
+
+ <developers>
+ <developer>
+ <id>atauber</id>
+ <name>Arne Tauber</name>
+ <organization>IAIK</organization>
+ <email>arne.tauber@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>tknall</id>
+ <name>Thomas Knall</name>
+ <organization>IAIK</organization>
+ <email>thomas.knall@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>troessler</id>
+ <name>Thomas Roessler</name>
+ <organization>IAIK</organization>
+ <email>thomas.roessler@iaik.tugraz.at</email>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <ciManagement>
+ <system>continuum</system>
+ <url>http://development:8088/continuum</url>
+ <notifiers>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>tknall</address>
+ </configuration>
+ </notifier>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>atauber</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+
+ <scm>
+ <connection>scm:svn:http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</connection>
+ <developerConnection>scm:svn:http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</developerConnection>
+ <url>http://bugzilla.iaik.tugraz.at/svn/egiz/prj/current/framework/asit/trunk</url>
+ </scm>
+
+ <organization>
+ <name>Institut fuer Angewandte Informationsverarbeitung und Kommunikationstechnologie</name>
+ <url>http://www.iaik.tugraz.at/</url>
+ </organization>
+
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <url>
+ file://development/c:/data/public/websites/PROJECTS/${pom.artifactId}/${pom.version}
+ </url>
+ </site>
+ </distributionManagement>
+
+ <build>
+
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>**/package.html</exclude>
+ <exclude>**/.svn</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <excludes>
+ <exclude>**/package.html</exclude>
+ <exclude>**/.svn</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <finalName>${artifactId}-${version}</finalName>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- skip>true</skip-->
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <locales>en</locales>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArguments>
+ <verbose />
+ </compilerArguments>
+ <excludes>
+ <exclude>asit/test/*/</exclude>
+ </excludes>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <!--mainClass>resource_uri_to_main_class</mainClass-->
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>src/main/assembly/assemble_libraries.xml</descriptor>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <public>true</public>
+ <package>true</package>
+ <private>true</private>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <link>http://struts.apache.org/1.2.4/api/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ </links>
+ <source>1.4</source>
+ <target>1.4</target>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank"&gt;${pom.organization.name}&lt;/a&gt;. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>project-team</report>
+ <!-- report>mailing-list</report -->
+ <!-- report>cim</report -->
+ <!-- report>issue-tracking</report -->
+ <!-- >report>license</report -->
+ <!-- >report>scm</report -->
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <public>true</public>
+ <package>true</package>
+ <private>true</private>
+ <links>
+ <link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <link>http://struts.apache.org/1.2.4/api/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ </links>
+ <source>1.4</source>
+ <target>1.4</target>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank"&gt;${pom.organization.name}&lt;/a&gt;. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ <!--
+ <plugin>
+ <groupId>www.ibiblio.org</groupId>
+ <artifactId>maven-jcoverage-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-docck-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changes-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-doap-plugin</artifactId>
+ <plugin>
+ </plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ </plugin>
+ -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-changes-plugin</artifactId>
+ <configuration>
+ <xmlPath>${basedir}/src/site/changes.xml</xmlPath>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>changes-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <showSuccess>true</showSuccess>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>${basedir}/src/site/checkstyle.xml</configLocation>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ <dependencies>
+ <!-- see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version> <!-- was: 2.3.1 -->
+ <scope>provided</scope>
+ <!--
+ available scopes: compile, provided, runtime, test, system
+ -->
+ <!--
+ projects that are libraries should declare dependencies as optional
+ see: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
+ -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts</artifactId>
+ <version>1.2.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.142</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ixsil_eval</artifactId>
+ <version>1.2.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version> <!-- was: 1.3.1 -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_eval_signed</artifactId>
+ <version>2.15</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>2.1.7c</version> <!-- was: 2.1.7 -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>fop</groupId>
+ <artifactId>fop</artifactId>
+ <version>0.20.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-jaxrpc</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>4.1.31</version> <!-- was: unknown -->
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar
new file mode 100644
index 000000000..78bdc2f58
--- /dev/null
+++ b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar
Binary files differ
diff --git a/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar.sha1 b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar.sha1
new file mode 100644
index 000000000..2f7b99a43
--- /dev/null
+++ b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.jar.sha1
@@ -0,0 +1 @@
+3cd8e2702cc2706dca2cd68e675e96b115edca6c
diff --git a/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom
new file mode 100644
index 000000000..20666ba88
--- /dev/null
+++ b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom
@@ -0,0 +1,6 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>bescheide</artifactId>
+ <version>2007-09-13</version>
+</project>
diff --git a/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom.sha1 b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom.sha1
new file mode 100644
index 000000000..44af41359
--- /dev/null
+++ b/repository/iaik/bescheide/2007-09-13/bescheide-2007-09-13.pom.sha1
@@ -0,0 +1 @@
+0ae1ab9cc1b907d2c6dfcc227637dc72faca95fa
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar
new file mode 100644
index 000000000..b9b08856c
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar
Binary files differ
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.md5 b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.md5
new file mode 100644
index 000000000..1b409ac45
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.md5
@@ -0,0 +1 @@
+a9ebe33840edea5854f3e8b8c0c03cab \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.sha1 b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.sha1
new file mode 100644
index 000000000..c7e599b34
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.jar.sha1
@@ -0,0 +1 @@
+b999d8a518efa41bdf67bd9fd964e9b09affe5dd \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom
new file mode 100644
index 000000000..3f6ccf7e5
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom
@@ -0,0 +1,633 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>iaik</groupId>
+ <artifactId>commons-iaik</artifactId>
+ <name>COMMONS IAIK Library</name>
+ <version>0.5.5</version>
+
+ <description>Sammlung haeufig verwendeter Klassen und Methoden</description>
+ <url>http://www.iaik.tugraz.at</url>
+ <inceptionYear>2006</inceptionYear>
+ <developers>
+ <developer>
+ <id>tknall</id>
+ <name>Thomas Knall</name>
+ <email>thomas.knall@iaik.tugraz.at</email>
+ <organization>IAIK</organization>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ </developers>
+
+ <organization>
+ <name>IAIK - Institute for Applied Information Processing and Communications</name>
+ <url>http://www.iaik.tugraz.at</url>
+ </organization>
+
+ <pluginRepositories>
+ <!--
+ <pluginRepository>
+ <id>tlc</id>
+ <name>TLC Repository</name>
+ <url>http://commons.ucalgary.ca/pub/m2</url>
+ </pluginRepository>
+ -->
+ <!--
+ <pluginRepository>
+ <id>apache.org</id>
+ <name>Maven Plugin Snapshots</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ -->
+ </pluginRepositories>
+
+ <scm>
+ <connection>scm:svn:http://bugzilla.iaik.tugraz.at/asit/prj/commons-iaik/trunk/</connection>
+ <url>http://bugzilla.iaik.tugraz.at/asit/prj/commons-iaik/trunk/</url>
+ </scm>
+
+ <distributionManagement>
+ <site>
+ <id>website</id>
+ <url>
+ file://development/c:/data/public/websites/PROJECTS/${artifactId}/${project.version}
+ </url>
+ </site>
+ </distributionManagement>
+
+ <build>
+
+ <resources>
+
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/CommonsIAIK.properties</include>
+ </includes>
+ <excludes>
+ <exclude>srgb.profile</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ <includes>
+ <!-- needed for ITextText only -->
+ <include>**/taglib.tld</include>
+ </includes>
+ <excludes>
+ <exclude>srgb.profile</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.xsd</include>
+ </includes>
+ <excludes>
+ <exclude>**/application_config.xml</exclude>
+ <exclude>**/application_default_config.xml</exclude>
+ </excludes>
+ </resource>
+
+ </resources>
+
+ <finalName>${artifactId}-${version}</finalName>
+
+ <plugins>
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>maven-buildnumber-plugin</artifactId>
+ <version>0.9.6</version>
+ <configuration>
+ <format>{0,date,yyyy-MM-dd'T'HH:mm:ssZ}</format>
+ <items>
+ <item>timestamp</item>
+ </items>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <showsuccess>true</showsuccess>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <locales>en</locales>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <excludes>
+ <exclude>at/iaik/commons/test/*/</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <!-- plugin>
+ <groupId>com.pyx4me</groupId>
+ <artifactId>proguard-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals><goal>proguard</goal></goals>
+ </execution>
+ </executions>
+ <configuration>
+ <obfuscate>true</obfuscate>
+ <libs>
+ <lib>${java.home}/lib/rt.jar</lib>
+ <lib>${java.home}/lib/jsse.jar</lib>
+ </libs>
+ </configuration>
+ </plugin-->
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>at.iaik.commons.metadata.CommonsIAIK</mainClass>
+ <!--
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ -->
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ <manifestEntries>
+ <!--
+ <Implementation-Build>${buildNumber}</Implementation-Build>
+ -->
+ <Implementation-Build>${build.date}</Implementation-Build>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <!--
+ <descriptor>src/main/assembly/assemble_libraries.xml</descriptor>
+ <descriptor>src/main/assembly/assemble_repository.xml</descriptor>
+ -->
+ <descriptor>src/main/assembly/assemble_libraries.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <show>public</show>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <!--
+ <link>http://struts.apache.org/1.2.9/api/</link>
+ -->
+ <link>http://struts.apache.org/1.3.10/apidocs/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ <link>http://www.jconfig.org/javadoc/</link>
+ <link>http://www.hibernate.org/hib_docs/v3/api/</link>
+ <link>http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/</link>
+ <link>http://www.saxproject.org/apidoc/</link>
+ </links>
+ <source>1.5</source>
+ <target>1.5</target>
+ <verbose>false</verbose>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank">${pom.organization.name}&lt;/a>. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- apache struts upgraded to 1.3.x: see http://wiki.apache.org/struts/StrutsUpgradeNotes12to13 -->
+ <!--
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts</artifactId>
+ <version>1.2.9</version>
+ <optional>true</optional>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts-core</artifactId>
+ <version>1.3.10</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts-taglib</artifactId>
+ <version>1.3.10</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.1.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.jconfig</groupId>
+ <artifactId>jconfig</artifactId>
+ <version>2.9</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis</artifactId>
+ <version>1.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-saaj</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-wsdl4j</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-jaxrpc</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>0.2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>5.0.28</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.3.02</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.serializer</groupId>
+ <artifactId>serializer</artifactId>
+ <version>2.7.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>xmlgraphics-commons</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.16</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ixsil_eval</artifactId>
+ <version>1.2.2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>asit</artifactId>
+ <version>1.3.4</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>zsproxy</artifactId>
+ <version>2007-03-02</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>batik</groupId>
+ <artifactId>batik-all</artifactId>
+ <version>1.6</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>fop</groupId>
+ <artifactId>fop</artifactId>
+ <version>0.92beta</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>knowcenter</groupId>
+ <artifactId>pdf-as</artifactId>
+ <version>3.0.9-20090203</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.11build48</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_eval_signed</artifactId>
+ <version>2.15</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_cms_eval</artifactId>
+ <version>4.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>at.gv.bmi</groupId>
+ <artifactId>szr-client</artifactId>
+ <version>3.71</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ <!--
+ <version>2.0.7</version>
+ -->
+ <version>2.1.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.6</version>
+ <optional>true</optional>
+ </dependency>
+
+ </dependencies>
+
+ <properties>
+ <build.date>2009-02-05</build.date>
+ </properties>
+
+ <reporting>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>
+ maven-project-info-reports-plugin
+ </artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>project-team</report>
+ <!-- report>mailing-list</report -->
+ <report>cim</report>
+ <!-- report>issue-tracking</report -->
+ <report>license</report>
+ <report>scm</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam></additionalparam>
+ <public>true</public>
+ <package>true</package>
+ <private>true</private>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/j2ee/1.4/docs/api/</link>
+ <!--
+ <link>http://struts.apache.org/1.2.9/api/</link>
+ -->
+ <link>http://struts.apache.org/1.3.10/apidocs/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ </links>
+ <source>1.5</source>
+ <target>1.5</target>
+ <windowtitle>${pom.name} v${pom.version}:${build.date} API</windowtitle>
+ <bottom>Copyright ${pom.inceptionYear} &lt;a href="${pom.organization.url}" target="_blank"&gt;${pom.organization.name}&lt;/a&gt;. All Rights Reserved.</bottom>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <showSuccess>true</showSuccess>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-changes-plugin</artifactId>
+ <configuration>
+ <xmlPath>${basedir}/src/site/changes.xml</xmlPath>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>changes-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changelog-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ <configuration>
+ <type>range</type>
+ <range>30</range>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-docck-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>
+ ${basedir}/src/site/checkstyle/sun_checks_modified.xml
+ </configLocation>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </reporting>
+
+</project>
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.md5 b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.md5
new file mode 100644
index 000000000..11fa5b7a1
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.md5
@@ -0,0 +1 @@
+e0ba073d10f5a19f62322fc171971ff0 \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.sha1 b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.sha1
new file mode 100644
index 000000000..24cc66dfb
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.5.5/commons-iaik-0.5.5.pom.sha1
@@ -0,0 +1 @@
+ecb2fcf08eb6f8a89ec587edd908fbb7d312a5ca \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.6.2/commons-iaik-0.6.2.jar b/repository/iaik/commons-iaik/0.6.2/commons-iaik-0.6.2.jar
new file mode 100644
index 000000000..c6ed59d02
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.6.2/commons-iaik-0.6.2.jar
Binary files differ
diff --git a/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.md5 b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.md5
new file mode 100644
index 000000000..f2d00d34a
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.md5
@@ -0,0 +1 @@
+fc0104930f152e891ee26d6e7c494959 \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.sha1 b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.sha1
new file mode 100644
index 000000000..b6bf33e23
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.jar.sha1
@@ -0,0 +1 @@
+ba2377c57bd8d1000ccd825d0f1276e2111e19dd \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.md5 b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.md5
new file mode 100644
index 000000000..fac84458d
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.md5
@@ -0,0 +1 @@
+8fce1151c5036c1d834f0374f05b9482 \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.sha1 b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.sha1
new file mode 100644
index 000000000..313186a5e
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.7.1/commons-iaik-0.7.1.pom.sha1
@@ -0,0 +1 @@
+dbbc777d5bf8d49d61febfda94fa67d3e12f081f \ No newline at end of file
diff --git a/repository/iaik/commons-iaik/0.7.1/m2e-lastUpdated.properties b/repository/iaik/commons-iaik/0.7.1/m2e-lastUpdated.properties
new file mode 100644
index 000000000..439757873
--- /dev/null
+++ b/repository/iaik/commons-iaik/0.7.1/m2e-lastUpdated.properties
@@ -0,0 +1,3 @@
+#Mon Jan 09 10:07:25 CET 2012
+*|http\://nexus.iaik.tugraz.at/nexus/content/groups/internal|sources=1326100045570
+central|http\://repo1.maven.org/maven2|sources=1326100045570
diff --git a/repository/iaik/ecc/3.18/ecc-3.18.jar b/repository/iaik/ecc/3.18/ecc-3.18.jar
new file mode 100644
index 000000000..abe38aea9
--- /dev/null
+++ b/repository/iaik/ecc/3.18/ecc-3.18.jar
Binary files differ
diff --git a/repository/iaik/ecc/3.18/ecc-3.18.pom b/repository/iaik/ecc/3.18/ecc-3.18.pom
new file mode 100644
index 000000000..266ef0cf8
--- /dev/null
+++ b/repository/iaik/ecc/3.18/ecc-3.18.pom
@@ -0,0 +1,7 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>ecc</artifactId>
+ <name>IAIK ECC</name>
+ <version>3.18</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaikPkcs11Provider/1.3/iaikPkcs11Provider-1.3.jar b/repository/iaik/iaikPkcs11Provider/1.3/iaikPkcs11Provider-1.3.jar
new file mode 100644
index 000000000..de1364ee9
--- /dev/null
+++ b/repository/iaik/iaikPkcs11Provider/1.3/iaikPkcs11Provider-1.3.jar
Binary files differ
diff --git a/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.jar b/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.jar
new file mode 100644
index 000000000..4a5fca3d7
--- /dev/null
+++ b/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.jar
Binary files differ
diff --git a/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.pom b/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.pom
new file mode 100644
index 000000000..0594f8ef9
--- /dev/null
+++ b/repository/iaik/iaik_ecc/2.19/iaik_ecc-2.19.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc</artifactId>
+ <version>2.19</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_ecc_eval_signed/2.15/iaik_ecc_eval_signed-2.15.jar b/repository/iaik/iaik_ecc_eval_signed/2.15/iaik_ecc_eval_signed-2.15.jar
new file mode 100644
index 000000000..dbed40bcd
--- /dev/null
+++ b/repository/iaik/iaik_ecc_eval_signed/2.15/iaik_ecc_eval_signed-2.15.jar
Binary files differ
diff --git a/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.jar b/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.jar
new file mode 100644
index 000000000..740f04a85
--- /dev/null
+++ b/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.jar
Binary files differ
diff --git a/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.pom b/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.pom
new file mode 100644
index 000000000..7fb88a18f
--- /dev/null
+++ b/repository/iaik/iaik_ecc_signed/2.15/iaik_ecc_signed-2.15.pom
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_signed</artifactId>
+ <version>2.15</version>
+ <description>POM was created from install:install-file</description>
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc.jar b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc.jar
new file mode 100644
index 000000000..abe38aea9
--- /dev/null
+++ b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc.jar
Binary files differ
diff --git a/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar.sha1 b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar.sha1
new file mode 100644
index 000000000..c1f515b9e
--- /dev/null
+++ b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar.sha1
@@ -0,0 +1 @@
+9bc26b101cf5ea86e060039e6df16f2df0c2fee1 \ No newline at end of file
diff --git a/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom.sha1 b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom.sha1
new file mode 100644
index 000000000..40428a2b8
--- /dev/null
+++ b/repository/iaik/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom.sha1
@@ -0,0 +1 @@
+40c799da1addc280c4f04cfe65cab2b35cdf90b7 \ No newline at end of file
diff --git a/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0-eval.jar b/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0-eval.jar
new file mode 100644
index 000000000..ada154483
--- /dev/null
+++ b/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0-eval.jar
Binary files differ
diff --git a/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0.pom b/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0.pom
new file mode 100644
index 000000000..0626c9021
--- /dev/null
+++ b/repository/iaik/iaik_ixsil/1.2.0/iaik_ixsil-1.2.0.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ixsil</artifactId>
+ <version>1.2.0</version>
+ <description>Artifactory auto generated POM</description>
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar
new file mode 100644
index 000000000..95cc68e85
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar
Binary files differ
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar.sha1 b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar.sha1
new file mode 100644
index 000000000..aca85e0e9
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2-javadoc.jar.sha1
@@ -0,0 +1 @@
+eacf3e640ba6d84a2b57c65542522b6d4e5de5aa
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar
new file mode 100644
index 000000000..99b77eeef
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar
Binary files differ
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar.sha1 b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar.sha1
new file mode 100644
index 000000000..b2419ec9d
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.jar.sha1
@@ -0,0 +1 @@
+324132b942f7b1120f65c6ef7bede0e0fd9d918c
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom
new file mode 100644
index 000000000..54b44ad19
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom
@@ -0,0 +1,6 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ixsil_eval</artifactId>
+ <version>1.2.2</version>
+</project>
diff --git a/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom.sha1 b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom.sha1
new file mode 100644
index 000000000..4ecc2e613
--- /dev/null
+++ b/repository/iaik/iaik_ixsil_eval/1.2.2/iaik_ixsil_eval-1.2.2.pom.sha1
@@ -0,0 +1 @@
+91c3b7dfbe45e151de8ba51e8f433fb8ea3dc7d4
diff --git a/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom b/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom
new file mode 100644
index 000000000..b4ff61576
--- /dev/null
+++ b/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_javax_crypto</artifactId>
+ <version>1.0</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_jce_eval_signed/3.16/iaik_jce_eval_signed-3.16.jar b/repository/iaik/iaik_jce_eval_signed/3.16/iaik_jce_eval_signed-3.16.jar
new file mode 100644
index 000000000..5687b9106
--- /dev/null
+++ b/repository/iaik/iaik_jce_eval_signed/3.16/iaik_jce_eval_signed-3.16.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar
index 98b5e27a2..932e4310f 100644
--- a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar
+++ b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom
new file mode 100644
index 000000000..9bcbb93a5
--- /dev/null
+++ b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.181</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.jar b/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.jar
new file mode 100644
index 000000000..825bd2573
--- /dev/null
+++ b/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.pom b/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.pom
new file mode 100644
index 000000000..b9a480933
--- /dev/null
+++ b/repository/iaik/iaik_jce_full/5.01/iaik_jce_full-5.01.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_full</artifactId>
+ <version>5.01</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_jce_full/5.101/iaik_jce_full-5.101.jar b/repository/iaik/iaik_jce_full/5.101/iaik_jce_full-5.101.jar
new file mode 100644
index 000000000..fd0457332
--- /dev/null
+++ b/repository/iaik/iaik_jce_full/5.101/iaik_jce_full-5.101.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.jar b/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.jar
new file mode 100644
index 000000000..0e6ca6fce
--- /dev/null
+++ b/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.pom b/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.pom
new file mode 100644
index 000000000..ab1026dac
--- /dev/null
+++ b/repository/iaik/iaik_jce_full_signed/3.16/iaik_jce_full_signed-3.16.pom
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_full_signed</artifactId>
+ <version>3.16</version>
+ <description>POM was created from install:install-file</description>
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.jar b/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.jar
new file mode 100644
index 000000000..d55a1d279
--- /dev/null
+++ b/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.jar
Binary files differ
diff --git a/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.pom b/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.pom
new file mode 100644
index 000000000..e6909b2ac
--- /dev/null
+++ b/repository/iaik/iaik_jce_me4se/3.04/iaik_jce_me4se-3.04.pom
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_me4se</artifactId>
+ <version>3.04</version>
+ <description>POM was created from install:install-file</description>
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom b/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom
new file mode 100644
index 000000000..382c12003
--- /dev/null
+++ b/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jsse</artifactId>
+ <version>4.4</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.jar b/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.jar
new file mode 100644
index 000000000..e911f1f15
--- /dev/null
+++ b/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.jar
Binary files differ
diff --git a/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.pom b/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.pom
new file mode 100644
index 000000000..dd50132a3
--- /dev/null
+++ b/repository/iaik/iaik_pki/1.0-MOCCA/iaik_pki-1.0-MOCCA.pom
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_pki</artifactId>
+ <version>1.0-MOCCA</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom b/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom
new file mode 100644
index 000000000..e78656647
--- /dev/null
+++ b/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_pki_module</artifactId>
+ <version>1.0</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom b/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom
new file mode 100644
index 000000000..32c610268
--- /dev/null
+++ b/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ssl</artifactId>
+ <version>4.4</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.jar b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.jar
new file mode 100644
index 000000000..cc461be04
--- /dev/null
+++ b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.jar
Binary files differ
diff --git a/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.pom b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.pom
new file mode 100644
index 000000000..e7fe82da2
--- /dev/null
+++ b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/iaik_tsl-0.0.1-SNAPSHOT.pom
@@ -0,0 +1,135 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_tsl</artifactId>
+ <packaging>jar</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>TSL_library</name>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <finalName>${project.artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.5</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <compilerArguments>
+ <verbose />
+ </compilerArguments>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.17</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_signed</artifactId>
+ <version>2.19</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.181</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_pki_module</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_javax_crypto</artifactId>
+ <version>1.0</version>
+ </dependency>
+<!-- <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_util</artifactId>
+ <version>0.23</version>
+ </dependency> -->
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jsse</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ssl</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>w3c_http</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.xerial</groupId>
+ <artifactId>sqlite-jdbc</artifactId>
+ <version>3.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.7.1</version>
+ </dependency>
+
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/maven-metadata-local.xml b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/maven-metadata-local.xml
new file mode 100644
index 000000000..64ac0d4ca
--- /dev/null
+++ b/repository/iaik/iaik_tsl/0.0.1-SNAPSHOT/maven-metadata-local.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata modelVersion="1.1.0">
+ <groupId>iaik</groupId>
+ <artifactId>iaik_tsl</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <localCopy>true</localCopy>
+ </snapshot>
+ <lastUpdated>20130308070150</lastUpdated>
+ <snapshotVersions>
+ <snapshotVersion>
+ <extension>jar</extension>
+ <value>0.0.1-SNAPSHOT</value>
+ <updated>20130308070150</updated>
+ </snapshotVersion>
+ <snapshotVersion>
+ <extension>pom</extension>
+ <value>0.0.1-SNAPSHOT</value>
+ <updated>20130308070150</updated>
+ </snapshotVersion>
+ </snapshotVersions>
+ </versioning>
+</metadata>
diff --git a/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.jar b/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.jar
new file mode 100644
index 000000000..7a05fa705
--- /dev/null
+++ b/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.jar
Binary files differ
diff --git a/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.pom b/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.pom
new file mode 100644
index 000000000..aebc1b74e
--- /dev/null
+++ b/repository/iaik/iaik_tsl/0.5/iaik_tsl-0.5.pom
@@ -0,0 +1,250 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_tsl</artifactId>
+ <packaging>jar</packaging>
+ <version>0.5</version>
+ <name>TSL_library</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
+ </properties>
+
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <finalName>${project.artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${endorsed.dir}</outputDirectory>
+ <excludeTransitive>true</excludeTransitive>
+ <includeArtifactIds>jaxb-api,jaxb-impl</includeArtifactIds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <compilerArguments>
+ <verbose />
+ <endorseddirs>${endorsed.dir}</endorseddirs>
+ </compilerArguments>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <fork>true</fork>
+ <compilerVersion>${java.version}</compilerVersion>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.5</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>profile-for-jdk1.6</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <jdk>[1.6,)</jdk>
+ </activation>
+ <properties>
+ <java.version>1.6</java.version>
+ <envClassifier>jdk${java.version}</envClassifier>
+ </properties>
+ <build>
+ <finalName>${project.artifactId}-${project.version}-${envClassifier}</finalName>
+ </build>
+ <dependencies>
+ <!-- Requires JAVA 1.6 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+ <profile>
+ <id>profile-for-jdk1.5</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <jdk>(,1.5]</jdk>
+ </activation>
+ <properties>
+ <java.version>1.5</java.version>
+ <envClassifier>jdk${java.version}</envClassifier>
+ </properties>
+ <build>
+ <finalName>${project.artifactId}-${project.version}-${envClassifier}</finalName>
+ </build>
+ <dependencies>
+ <!-- Last Version with JAVA 1.5 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.4-1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.1709142</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_signed</artifactId>
+ <version>2.19</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.181</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_pki_module</artifactId>
+ <version>1.0</version>
+ </dependency>
+<!-- <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_javax_crypto</artifactId>
+ <version>1.0</version>
+ </dependency> -->
+<!-- <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_util</artifactId>
+ <version>0.23 (snapshot 20121011-125127 eval)</version>
+ </dependency> -->
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jsse</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ssl</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>w3c_http</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.xerial</groupId>
+ <artifactId>sqlite-jdbc</artifactId>
+ <version>3.7.2</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.7.1</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.jar b/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.jar
new file mode 100644
index 000000000..596ec60ea
--- /dev/null
+++ b/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.jar
Binary files differ
diff --git a/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.pom b/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.pom
new file mode 100644
index 000000000..2ffb92b70
--- /dev/null
+++ b/repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.pom
@@ -0,0 +1,251 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_tsl</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>TSL_library</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
+ </properties>
+
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <finalName>${project.artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${endorsed.dir}</outputDirectory>
+ <excludeTransitive>true</excludeTransitive>
+ <includeArtifactIds>jaxb-api,jaxb-impl</includeArtifactIds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <compilerArguments>
+ <verbose />
+ <endorseddirs>${endorsed.dir}</endorseddirs>
+ </compilerArguments>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <fork>true</fork>
+ <compilerVersion>${java.version}</compilerVersion>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.5</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.0,)</versionRange>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>profile-for-jdk1.6</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <jdk>[1.6,)</jdk>
+ </activation>
+ <properties>
+ <java.version>1.6</java.version>
+ <envClassifier>jdk${java.version}</envClassifier>
+ </properties>
+ <build>
+ <finalName>${project.artifactId}-${project.version}-${envClassifier}</finalName>
+ </build>
+ <dependencies>
+ <!-- Requires JAVA 1.6 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.6</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+ <profile>
+ <id>profile-for-jdk1.5</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <jdk>(,1.5]</jdk>
+ </activation>
+ <properties>
+ <java.version>1.5</java.version>
+ <envClassifier>jdk${java.version}</envClassifier>
+ </properties>
+ <build>
+ <finalName>${project.artifactId}-${project.version}-${envClassifier}</finalName>
+ </build>
+ <dependencies>
+ <!-- Last Version with JAVA 1.5 -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2.4-1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.1709142</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ecc_signed</artifactId>
+ <version>2.19</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.181</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_pki_module</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_javax_crypto</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_util</artifactId>
+ <!-- <version>0.23 (snapshot 20121011-125127 eval)</version>-->
+ <version>0.23</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jsse</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_ssl</artifactId>
+ <version>4.4</version>
+ </dependency>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>w3c_http</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.xerial</groupId>
+ <artifactId>sqlite-jdbc</artifactId>
+ <version>3.7.2</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.7.1</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/repository/iaik/iaik_tsl/maven-metadata-local.xml b/repository/iaik/iaik_tsl/maven-metadata-local.xml
new file mode 100644
index 000000000..9b36d1a39
--- /dev/null
+++ b/repository/iaik/iaik_tsl/maven-metadata-local.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_tsl</artifactId>
+ <versioning>
+ <release>1.0</release>
+ <versions>
+ <version>0.0.1-SNAPSHOT</version>
+ <version>0.5</version>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20140130172750</lastUpdated>
+ </versioning>
+</metadata>
diff --git a/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar b/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar
index 1bc0cde7c..78370c31e 100644
--- a/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar
+++ b/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar
Binary files differ
diff --git a/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom b/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom
new file mode 100644
index 000000000..75fdc3692
--- /dev/null
+++ b/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_util</artifactId>
+ <version>0.23</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar
new file mode 100644
index 000000000..143721433
--- /dev/null
+++ b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar
Binary files differ
diff --git a/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar.sha1 b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar.sha1
new file mode 100644
index 000000000..d94a0d2e1
--- /dev/null
+++ b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.jar.sha1
@@ -0,0 +1 @@
+a7229772fae682b3e0fb36c1ca99c7863b67183d \ No newline at end of file
diff --git a/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom
new file mode 100644
index 000000000..53a1a1c69
--- /dev/null
+++ b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect</artifactId>
+ <version>1.17</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom.sha1 b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom.sha1
new file mode 100644
index 000000000..ae1a98d0d
--- /dev/null
+++ b/repository/iaik/iaik_xsect/1.17/iaik_xsect-1.17.pom.sha1
@@ -0,0 +1 @@
+89ab4d09c9e7c6c635333fdd4bba4fe83eda17ed \ No newline at end of file
diff --git a/repository/iaik/iaik_xsect/1.1709142/iaik_xsect-1.1709142.jar b/repository/iaik/iaik_xsect/1.1709142/iaik_xsect-1.1709142.jar
new file mode 100644
index 000000000..96732584e
--- /dev/null
+++ b/repository/iaik/iaik_xsect/1.1709142/iaik_xsect-1.1709142.jar
Binary files differ
diff --git a/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar
new file mode 100644
index 000000000..75cc08ac9
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar
Binary files differ
diff --git a/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar.sha1 b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar.sha1
new file mode 100644
index 000000000..9342639d0
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.jar.sha1
@@ -0,0 +1 @@
+0f4ae4f842abc37209af659998de0d475401b47c
diff --git a/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom
new file mode 100644
index 000000000..af1ce91ff
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom
@@ -0,0 +1,32 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.11build48</version>
+ <dependencies>
+ <dependency>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_jce_eval_signed</artifactId>
+ <version>3.142</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.7.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom.sha1 b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom.sha1
new file mode 100644
index 000000000..1d18f50a4
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.11build48/iaik_xsect_eval-1.11build48.pom.sha1
@@ -0,0 +1 @@
+2f1a7377b98d831ae4d854f3158221e142d95d77
diff --git a/repository/iaik/iaik_xsect_eval/1.17/iaik_xsect_eval-1.17.jar b/repository/iaik/iaik_xsect_eval/1.17/iaik_xsect_eval-1.17.jar
new file mode 100644
index 000000000..d8ddf1925
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.17/iaik_xsect_eval-1.17.jar
Binary files differ
diff --git a/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom b/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom
new file mode 100644
index 000000000..2697348bd
--- /dev/null
+++ b/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
+ <version>1.1709142</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.jar b/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.jar
new file mode 100644
index 000000000..bda9f05bd
--- /dev/null
+++ b/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.jar
Binary files differ
diff --git a/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.pom b/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.pom
new file mode 100644
index 000000000..49a09d2df
--- /dev/null
+++ b/repository/iaik/ixsil/1.2.2.4/ixsil-1.2.2.4.pom
@@ -0,0 +1,7 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>ixsil</artifactId>
+ <name>IAIK IXSIL</name>
+ <version>1.2.2.4</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/jce/3.18/jce-3.18.jar b/repository/iaik/jce/3.18/jce-3.18.jar
new file mode 100644
index 000000000..4a0aa89c7
--- /dev/null
+++ b/repository/iaik/jce/3.18/jce-3.18.jar
Binary files differ
diff --git a/repository/iaik/jce/3.18/jce-3.18.pom b/repository/iaik/jce/3.18/jce-3.18.pom
new file mode 100644
index 000000000..621aaca48
--- /dev/null
+++ b/repository/iaik/jce/3.18/jce-3.18.pom
@@ -0,0 +1,7 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>jce</artifactId>
+ <name>IAIK JCE</name>
+ <version>3.18</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/moa/1.28/m2e-lastUpdated.properties b/repository/iaik/moa/1.28/m2e-lastUpdated.properties
new file mode 100644
index 000000000..325865860
--- /dev/null
+++ b/repository/iaik/moa/1.28/m2e-lastUpdated.properties
@@ -0,0 +1,10 @@
+#Wed Sep 04 11:22:13 CEST 2013
+iaikInternal|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/internal|sources=1378286533334
+central|http\://repo1.maven.org/maven2/|sources=1378286533334
+MOA|file\://D\:\\Projekte\\svn\\moa-id\\moa-idspss\\id\\server\\idserverlib/../../../repository|sources=1378286533334
+shibboleth.internet2.edu|https\://build.shibboleth.net/nexus/content/groups/public/|sources=1378286533334
+iaik3rd\ Party|tlenz|http\://nexus/nexus/content/repositories/thirdparty|sources=1378286533334
+iaikPublic|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/public|sources=1378286533334
+java.net-Public|https\://maven.java.net/content/groups/public/|sources=1378286533334
+hyberjaxb|http\://repository.highsource.org/maven2/releases/|sources=1378286533334
+iaikLibs|tlenz|http\://nexus/nexus/content/repositories/iaik|sources=1378286533334
diff --git a/repository/iaik/moa/1.28/moa-1.28.jar b/repository/iaik/moa/1.28/moa-1.28.jar
new file mode 100644
index 000000000..15d117873
--- /dev/null
+++ b/repository/iaik/moa/1.28/moa-1.28.jar
Binary files differ
diff --git a/repository/iaik/moa/1.28/moa-1.28.pom b/repository/iaik/moa/1.28/moa-1.28.pom
new file mode 100644
index 000000000..4f974d207
--- /dev/null
+++ b/repository/iaik/moa/1.28/moa-1.28.pom
@@ -0,0 +1,7 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>moa</artifactId>
+ <name>IAIK MOA</name>
+ <version>1.28</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/moa_common/2006-03-20/moa_common-2006-03-20.jar b/repository/iaik/moa_common/2006-03-20/moa_common-2006-03-20.jar
new file mode 100644
index 000000000..cb13672ac
--- /dev/null
+++ b/repository/iaik/moa_common/2006-03-20/moa_common-2006-03-20.jar
Binary files differ
diff --git a/repository/iaik/prod/iaik_X509TrustManager/0.3/m2e-lastUpdated.properties b/repository/iaik/prod/iaik_X509TrustManager/0.3/m2e-lastUpdated.properties
new file mode 100644
index 000000000..c2379afa6
--- /dev/null
+++ b/repository/iaik/prod/iaik_X509TrustManager/0.3/m2e-lastUpdated.properties
@@ -0,0 +1,10 @@
+#Wed Sep 04 10:38:34 CEST 2013
+iaikInternal|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/internal|sources=1378283914153
+central|http\://repo1.maven.org/maven2/|sources=1378283914153
+MOA|file\://D\:\\Projekte\\svn\\moa-id\\moa-idspss\\id\\server\\idserverlib/../../../repository|sources=1378283914153
+shibboleth.internet2.edu|https\://build.shibboleth.net/nexus/content/groups/public/|sources=1378283914153
+iaik3rd\ Party|tlenz|http\://nexus/nexus/content/repositories/thirdparty|sources=1378283914153
+iaikPublic|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/public|sources=1378283914153
+java.net-Public|https\://maven.java.net/content/groups/public/|sources=1378283914153
+hyberjaxb|http\://repository.highsource.org/maven2/releases/|sources=1378283914153
+iaikLibs|tlenz|http\://nexus/nexus/content/repositories/iaik|sources=1378283914153
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar
new file mode 100644
index 000000000..91ad9505d
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar
Binary files differ
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.md5 b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.md5
new file mode 100644
index 000000000..9ca556e54
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.md5
@@ -0,0 +1 @@
+89895bd5cf39659b32a5eaa23ab7a241 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.sha1 b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.sha1
new file mode 100644
index 000000000..29d414fd9
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.jar.sha1
@@ -0,0 +1 @@
+7796f42059f77249baa7cfe75326a7f5f1742821 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom
new file mode 100644
index 000000000..29b57342a
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik.prod</groupId>
+ <artifactId>iaik_cms</artifactId>
+ <version>4.01_MOA_SV</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.md5 b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.md5
new file mode 100644
index 000000000..8ed1e29bd
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.md5
@@ -0,0 +1 @@
+b2746e061aa5cf7c05b1504d8d80c0db \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.sha1 b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.sha1
new file mode 100644
index 000000000..5a2f4a10e
--- /dev/null
+++ b/repository/iaik/prod/iaik_cms/4.01_MOA_SV/iaik_cms-4.01_MOA_SV.pom.sha1
@@ -0,0 +1 @@
+5b4a31ca81d6880390d2e6a3f9131410dad9cfbb \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar b/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar
new file mode 100644
index 000000000..abe38aea9
--- /dev/null
+++ b/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.jar
Binary files differ
diff --git a/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom b/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom
new file mode 100644
index 000000000..ad3b0b202
--- /dev/null
+++ b/repository/iaik/prod/iaik_ecc_signed/2.19/iaik_ecc_signed-2.19.pom
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik.prod</groupId>
+ <artifactId>iaik_ecc_signed</artifactId>
+ <version>2.19</version>
+</project>
diff --git a/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.jar.sha1 b/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.jar.sha1
new file mode 100644
index 000000000..0248d3cbe
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.jar.sha1
@@ -0,0 +1 @@
+4a893ba4503786d33bbca85b82d16927adc6d6a6 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.pom.sha1 b/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.pom.sha1
new file mode 100644
index 000000000..33eae7f2e
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/4.0_MOA/iaik_jce_full-4.0_MOA.pom.sha1
@@ -0,0 +1 @@
+567fb4bf4a266d5b4eafbbc582972dbc2fad7195 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.jar.lastUpdated b/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.jar.lastUpdated
deleted file mode 100644
index 42ff556c7..000000000
--- a/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.jar.lastUpdated
+++ /dev/null
@@ -1,22 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed May 15 13:18:02 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.lastUpdated=1368616682476
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.lastUpdated=1368616682207
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1368616681300
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.lastUpdated=1368616681996
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1368616682060
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1368616682416
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.lastUpdated=1368616682584
-http\://repo.maven.apache.org/maven2/.lastUpdated=1368616681623
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\tools/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1368616682294
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\tools/../../../repository/.lastUpdated=1368616681780
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.error=
diff --git a/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.pom.lastUpdated b/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.pom.lastUpdated
deleted file mode 100644
index 65ee40f75..000000000
--- a/repository/iaik/prod/iaik_jce_full/5.101/iaik_jce_full-5.101.pom.lastUpdated
+++ /dev/null
@@ -1,12 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed May 15 13:18:07 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.lastUpdated=1368616681271
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1368616685249
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1368616687679
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1368616680663
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1368616687203
diff --git a/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar
new file mode 100644
index 000000000..bacb70edc
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar
Binary files differ
diff --git a/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar.sha1 b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar.sha1
new file mode 100644
index 000000000..0248d3cbe
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.jar.sha1
@@ -0,0 +1 @@
+4a893ba4503786d33bbca85b82d16927adc6d6a6 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom
new file mode 100644
index 000000000..4e0b27a6c
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik.prod</groupId>
+ <artifactId>iaik_jce_full</artifactId>
+ <version>4.0_MOA</version>
+</project> \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom.sha1 b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom.sha1
new file mode 100644
index 000000000..33eae7f2e
--- /dev/null
+++ b/repository/iaik/prod/iaik_jce_full/iaik_jce_full-4.0_MOA.pom.sha1
@@ -0,0 +1 @@
+567fb4bf4a266d5b4eafbbc582972dbc2fad7195 \ No newline at end of file
diff --git a/repository/iaik/prod/iaik_moa/1.32/m2e-lastUpdated.properties b/repository/iaik/prod/iaik_moa/1.32/m2e-lastUpdated.properties
new file mode 100644
index 000000000..0bc0b0a6c
--- /dev/null
+++ b/repository/iaik/prod/iaik_moa/1.32/m2e-lastUpdated.properties
@@ -0,0 +1,10 @@
+#Thu Jul 18 07:34:24 CEST 2013
+iaikInternal|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/internal|sources=1374125664765
+central|http\://repo1.maven.org/maven2/|sources=1374125664765
+MOA|file\://D\:\\Projekte\\svn\\moa-id\\moa-idspss\\common/../repository|sources=1374125664765
+shibboleth.internet2.edu|https\://build.shibboleth.net/nexus/content/groups/public/|sources=1374125664765
+iaik3rd\ Party|tlenz|http\://nexus/nexus/content/repositories/thirdparty|sources=1374125664765
+iaikPublic|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/public|sources=1374125664765
+java.net-Public|https\://maven.java.net/content/groups/public/|sources=1374125664765
+hyberjaxb|http\://repository.highsource.org/maven2/releases/|sources=1374125664765
+iaikLibs|tlenz|http\://nexus/nexus/content/repositories/iaik|sources=1374125664765
diff --git a/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.jar.lastUpdated b/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.jar.lastUpdated
deleted file mode 100644
index 39508d157..000000000
--- a/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.jar.lastUpdated
+++ /dev/null
@@ -1,22 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed May 15 13:18:18 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.lastUpdated=1368616698028
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.lastUpdated=1368616697758
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1368616696933
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.lastUpdated=1368616697582
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1368616697635
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1368616697964
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.lastUpdated=1368616698288
-http\://repo.maven.apache.org/maven2/.lastUpdated=1368616697395
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\tools/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1368616697883
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\tools/../../../repository/.lastUpdated=1368616697505
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.error=
diff --git a/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.pom.lastUpdated b/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.pom.lastUpdated
deleted file mode 100644
index 728b1a824..000000000
--- a/repository/iaik/prod/iaik_moa/1.5/iaik_moa-1.5.pom.lastUpdated
+++ /dev/null
@@ -1,12 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed May 15 13:18:20 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.lastUpdated=1368616696896
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1368616698745
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1368616700109
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1368616696561
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1368616699566
diff --git a/repository/iaik/prod/iaik_moa/1.5/m2e-lastUpdated.properties b/repository/iaik/prod/iaik_moa/1.5/m2e-lastUpdated.properties
new file mode 100644
index 000000000..1c0e7bd32
--- /dev/null
+++ b/repository/iaik/prod/iaik_moa/1.5/m2e-lastUpdated.properties
@@ -0,0 +1,9 @@
+#Wed Sep 04 11:14:45 CEST 2013
+java.net-Public|https\://maven.java.net/content/groups/public/|sources=1378286085859
+iaikLibs|tlenz|http\://nexus/nexus/content/repositories/iaik|sources=1378286085859
+iaik3rd\ Party|tlenz|http\://nexus/nexus/content/repositories/thirdparty|sources=1378286085859
+iaikPublic|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/public|sources=1378286085859
+shibboleth.internet2.edu|https\://build.shibboleth.net/nexus/content/groups/public/|sources=1378286085859
+central|http\://repo1.maven.org/maven2/|sources=1378286085859
+hyberjaxb|http\://repository.highsource.org/maven2/releases/|sources=1378286085859
+iaikInternal|tlenz|http\://nexus.iaik.tugraz.at/nexus/content/groups/internal|sources=1378286085859
diff --git a/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.jar.lastUpdated b/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.jar.lastUpdated
deleted file mode 100644
index ab7af62d9..000000000
--- a/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.jar.lastUpdated
+++ /dev/null
@@ -1,3 +0,0 @@
-#Last modified on: Thu Dec 27 14:05:38 CET 2012
-#Thu Dec 27 14:05:38 CET 2012
-MOA=1356613538568
diff --git a/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.pom.lastUpdated b/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.pom.lastUpdated
deleted file mode 100644
index b50698d8c..000000000
--- a/repository/iaik/prod/iaik_tsl/0.0.2-SNAPSHOT/iaik_tsl-0.0.2-SNAPSHOT.pom.lastUpdated
+++ /dev/null
@@ -1,3 +0,0 @@
-#Last modified on: Thu Dec 27 14:05:37 CET 2012
-#Thu Dec 27 14:05:37 CET 2012
-MOA=1356613537915
diff --git a/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom b/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom
new file mode 100644
index 000000000..81f3e826c
--- /dev/null
+++ b/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>iaik</groupId>
+ <artifactId>w3c_http</artifactId>
+ <version>1.0</version>
+ <description>POM was created from install:install-file</description>
+</project>
diff --git a/repository/iaik/xsect/1.02/xsect-1.02.jar b/repository/iaik/xsect/1.02/xsect-1.02.jar
new file mode 100644
index 000000000..9b2e4cc41
--- /dev/null
+++ b/repository/iaik/xsect/1.02/xsect-1.02.jar
Binary files differ
diff --git a/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.jar.lastUpdated b/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.jar.lastUpdated
deleted file mode 100644
index 78b5176b5..000000000
--- a/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.jar.lastUpdated
+++ /dev/null
@@ -1,3 +0,0 @@
-#Last modified on: Mon Dec 17 20:58:30 CET 2012
-#Mon Dec 17 20:58:30 CET 2012
-MOA=1355774310289
diff --git a/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.pom.lastUpdated b/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.pom.lastUpdated
deleted file mode 100644
index b4f47fc4d..000000000
--- a/repository/org/xerial/sqlite-jdbc/3.7.8-SNAPSHOT/sqlite-jdbc-3.7.8-SNAPSHOT.pom.lastUpdated
+++ /dev/null
@@ -1,3 +0,0 @@
-#Last modified on: Thu Dec 27 12:24:22 CET 2012
-#Thu Dec 27 12:24:22 CET 2012
-MOA=1356607462442
diff --git a/repository/xalan-bin-dist/serializer/2.10.0/serializer-2.10.0-sources.jar.lastUpdated b/repository/xalan-bin-dist/serializer/2.10.0/serializer-2.10.0-sources.jar.lastUpdated
deleted file mode 100644
index 450824e7b..000000000
--- a/repository/xalan-bin-dist/serializer/2.10.0/serializer-2.10.0-sources.jar.lastUpdated
+++ /dev/null
@@ -1,8 +0,0 @@
-#Last modified on: Tue Jun 19 09:58:36 CEST 2012
-#Tue Jun 19 09:58:36 CEST 2012
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\auth/../../../repository=1340092716254
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\idserverlib/../../../repository=1340024044491
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\stork-saml-engine/../../repository=1339605327080
--1137991424@https\://vidp.openlimit.com\:8120/artifactory/libs-snapshot=1340024044486
--1137991424@https\://vidp.openlimit.com\:8120/artifactory/libs-release=1340024043644
-http\://repo1.maven.org/maven2=1340092716398
diff --git a/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.jar.lastUpdated b/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.jar.lastUpdated
deleted file mode 100644
index 72e5744b0..000000000
--- a/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.jar.lastUpdated
+++ /dev/null
@@ -1,20 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed Apr 17 12:01:34 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.lastUpdated=1366192894894
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.lastUpdated=1366192894629
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1366192893795
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.lastUpdated=1366192894406
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1366192894480
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1366192894830
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.lastUpdated=1366192894987
-http\://repo.maven.apache.org/maven2/.lastUpdated=1366192894218
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1366192894710
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.error=
diff --git a/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.pom.lastUpdated b/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.pom.lastUpdated
deleted file mode 100644
index e04390820..000000000
--- a/repository/xalan-bin-dist/serializer/2.7.1/serializer-2.7.1.pom.lastUpdated
+++ /dev/null
@@ -1,12 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed Apr 17 12:01:37 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.lastUpdated=1366192893730
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1366192895946
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1366192897001
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1366192893425
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1366192896653
diff --git a/repository/xalan-bin-dist/xml-apis/2.10.0/xml-apis-2.10.0-sources.jar.lastUpdated b/repository/xalan-bin-dist/xml-apis/2.10.0/xml-apis-2.10.0-sources.jar.lastUpdated
deleted file mode 100644
index 04fd7a1ab..000000000
--- a/repository/xalan-bin-dist/xml-apis/2.10.0/xml-apis-2.10.0-sources.jar.lastUpdated
+++ /dev/null
@@ -1,8 +0,0 @@
-#Last modified on: Tue Jun 19 09:58:36 CEST 2012
-#Tue Jun 19 09:58:36 CEST 2012
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\auth/../../../repository=1340092715933
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\idserverlib/../../../repository=1340024039340
-file\://E\:\\workspace_moa_stork_integration\\moa-idspss\\id\\server\\stork-saml-engine/../../repository=1339605326450
--1137991424@https\://vidp.openlimit.com\:8120/artifactory/libs-snapshot=1340024039336
--1137991424@https\://vidp.openlimit.com\:8120/artifactory/libs-release=1340024037229
-http\://repo1.maven.org/maven2=1340092716084
diff --git a/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.jar.lastUpdated b/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.jar.lastUpdated
deleted file mode 100644
index e61976db2..000000000
--- a/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.jar.lastUpdated
+++ /dev/null
@@ -1,20 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed Apr 17 12:01:34 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.lastUpdated=1366192894892
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.lastUpdated=1366192894628
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1366192893794
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.lastUpdated=1366192894405
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1366192894479
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1366192894829
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.lastUpdated=1366192894985
-http\://repo.maven.apache.org/maven2/.lastUpdated=1366192894217
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverlib/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1366192894709
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\idserverlib/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\api/../../../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\handbook\\clients\\webservice/../../../../../repository/.error=
diff --git a/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.pom.lastUpdated b/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.pom.lastUpdated
deleted file mode 100644
index b90a46001..000000000
--- a/repository/xalan-bin-dist/xml-apis/2.7.1/xml-apis-2.7.1.pom.lastUpdated
+++ /dev/null
@@ -1,12 +0,0 @@
-#NOTE: This is an internal implementation file, its format can be changed without prior notice.
-#Wed Apr 17 12:01:36 CEST 2013
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.lastUpdated=1366192893413
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.lastUpdated=1366192895941
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\spss\\server\\serverws/../../../repository/.lastUpdated=1366192896997
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.error=
-http\://repo.maven.apache.org/maven2/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\common/../repository/.lastUpdated=1366192893124
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\proxy/../../../repository/.error=
-file\://C\:\\eclipse_workspaces\\MOA_Git01\\moa-idspss\\id\\server\\auth/../../../repository/.lastUpdated=1366192896649
diff --git a/spss/assembly-lib.xml b/spss/assembly-lib.xml
index c034f6082..895cc97c2 100644
--- a/spss/assembly-lib.xml
+++ b/spss/assembly-lib.xml
@@ -4,7 +4,7 @@
<formats>
<format>dir</format>
<format>zip</format>
- <format>tar.gz</format>
+<!-- <format>tar.gz</format> -->
</formats>
<baseDirectory>moa-spss-lib-${project.version}</baseDirectory>
diff --git a/spss/assembly.xml b/spss/assembly.xml
index 1c560fe5d..17133d090 100644
--- a/spss/assembly.xml
+++ b/spss/assembly.xml
@@ -4,7 +4,7 @@
<formats>
<format>dir</format>
<format>zip</format>
- <format>tar.gz</format>
+<!-- <format>tar.gz</format> -->
</formats>
<baseDirectory>moa-spss-${project.version}</baseDirectory>
diff --git a/spss/handbook/clients/api/moa-spss-handbook-apiClient.iml b/spss/handbook/clients/api/moa-spss-handbook-apiClient.iml
new file mode 100644
index 000000000..fdffc1a0f
--- /dev/null
+++ b/spss/handbook/clients/api/moa-spss-handbook-apiClient.iml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ </component>
+</module>
+
diff --git a/spss/handbook/clients/moa-spss-handbook-clients.iml b/spss/handbook/clients/moa-spss-handbook-clients.iml
new file mode 100644
index 000000000..6e02e5944
--- /dev/null
+++ b/spss/handbook/clients/moa-spss-handbook-clients.iml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/spss/handbook/clients/referencedData/moa-spss-handbook-referencedData.iml b/spss/handbook/clients/referencedData/moa-spss-handbook-referencedData.iml
new file mode 100644
index 000000000..07392b36c
--- /dev/null
+++ b/spss/handbook/clients/referencedData/moa-spss-handbook-referencedData.iml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/spss/handbook/clients/webservice/moa-spss-handbook-webserviceClient.iml b/spss/handbook/clients/webservice/moa-spss-handbook-webserviceClient.iml
new file mode 100644
index 000000000..fdffc1a0f
--- /dev/null
+++ b/spss/handbook/clients/webservice/moa-spss-handbook-webserviceClient.iml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ </component>
+</module>
+
diff --git a/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.resp.xml b/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.resp.xml
new file mode 100644
index 000000000..8691c4563
--- /dev/null
+++ b/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.resp.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VerifyXMLSignatureResponse xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+ <SignerInfo>
+ <dsig:X509Data>
+ <dsig:X509SubjectName>T=DI,serialNumber=847206943023,givenName=Klaus,SN=Stranacher,CN=Klaus Stranacher,C=AT</dsig:X509SubjectName>
+ <dsig:X509IssuerSerial>
+ <dsig:X509IssuerName>CN=a-sign-premium-mobile-03,OU=a-sign-premium-mobile-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName>
+ <dsig:X509SerialNumber>685117</dsig:X509SerialNumber>
+ </dsig:X509IssuerSerial>
+ <dsig:X509Certificate>MIIEtTCCA52gAwIBAgIDCnQ9MA0GCSqGSIb3DQEBBQUAMIGdMQswCQYDVQQGEwJB
+VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp
+bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMSEwHwYDVQQLDBhhLXNpZ24tcHJl
+bWl1bS1tb2JpbGUtMDMxITAfBgNVBAMMGGEtc2lnbi1wcmVtaXVtLW1vYmlsZS0w
+MzAeFw0xMjAxMTkxMDUwNDRaFw0xNzAxMTkxMDUwNDRaMHExCzAJBgNVBAYTAkFU
+MRkwFwYDVQQDDBBLbGF1cyBTdHJhbmFjaGVyMRMwEQYDVQQEDApTdHJhbmFjaGVy
+MQ4wDAYDVQQqDAVLbGF1czEVMBMGA1UEBRMMODQ3MjA2OTQzMDIzMQswCQYDVQQM
+DAJESTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCl9cWMwe9LaXbcwuLCMRXS6
+KYhou9Fzvo7ScXpwcRn1sbTSjUIIhLUTrqfqO/pnwoKd87PmNcGUFoCXvsb4lUqj
+ggHyMIIB7jARBgNVHQ4ECgQITPnzawkXeUUwDgYDVR0PAQH/BAQDAgbAMBMGA1Ud
+IwQMMAqACEu4Yddf1khjMAkGA1UdEwQCMAAwfgYIKwYBBQUHAQEEcjBwMEUGCCsG
+AQUFBzAChjlodHRwOi8vd3d3LmEtdHJ1c3QuYXQvY2VydHMvYS1zaWduLXByZW1p
+dW0tbW9iaWxlLTAzYS5jcnQwJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmEtdHJ1
+c3QuYXQvb2NzcDBgBgNVHSAEWTBXMEsGBiooABEBFDBBMD8GCCsGAQUFBwIBFjNo
+dHRwOi8vd3d3LmEtdHJ1c3QuYXQvZG9jcy9jcC9hLXNpZ24tcHJlbWl1bS1tb2Jp
+bGUwCAYGBACLMAEBMCcGCCsGAQUFBwEDAQH/BBgwFjAIBgYEAI5GAQEwCgYIKwYB
+BQUHCwEwgZ0GA1UdHwSBlTCBkjCBj6CBjKCBiYaBhmxkYXA6Ly9sZGFwLmEtdHJ1
+c3QuYXQvb3U9YS1zaWduLXByZW1pdW0tbW9iaWxlLTAzLG89QS1UcnVzdCxjPUFU
+P2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q/YmFzZT9vYmplY3RjbGFzcz1laWRD
+ZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MA0GCSqGSIb3DQEBBQUAA4IBAQBWEeyDzBQA
+5O5CY7z6K9EwbXxxuuaEEb1GVIyTZ4DcfodjkEEdGqWicsPdUUJDZ7ETyaKucgVt
+WaOHaObkCua9tM5TP3YtaEyDRteqU7N6LMDcMrXle8WOTUcIhSFy5UU8SnFtbZyQ
+v+eeAW48PVq5pzBzizGNtMKCv9XC7df5ARhDEU7tYaVrKIobTdeq8D7zXnZ2Wdt9
+6VG6QBe8eH49bAxabnOk/rF6TMO2NX4h/tlQLBzOdOeEolUHOHkA3L01REL2m/6k
+lPNsA8mX++cD3yKuoCWxtl27peTscRyGKEo2EBLtt7mfaTFBbkdKo1WUkZ+dVesa
+XtKckFCEtW3r</dsig:X509Certificate>
+ <QualifiedCertificate/>
+ <SecureSignatureCreationDevice Source="Certificate"/>
+ <IssuerCountryCode>AT</IssuerCountryCode>
+ </dsig:X509Data>
+ </SignerInfo>
+ <SignatureCheck>
+ <Code>0</Code>
+ </SignatureCheck>
+ <SignatureManifestCheck>
+ <Code>0</Code>
+ </SignatureManifestCheck>
+ <CertificateCheck>
+ <Code>0</Code>
+ </CertificateCheck>
+ </VerifyXMLSignatureResponse>
diff --git a/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.xml b/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.xml
new file mode 100644
index 000000000..efdc2a76a
--- /dev/null
+++ b/spss/handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<moa:VerifyXMLSignatureRequest xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#"><moa:VerifySignatureInfo><moa:VerifySignatureEnvironment><moa:XMLContent>
+<dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"/><dsig:Reference Id="reference-1-1" URI="#signed-data-1-1"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2"><xpf:XPath Filter="intersect" xmlns:xpf="http://www.w3.org/2002/06/xmldsig-filter2">id('signed-data-1-1')/node()</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>ck5CfKRJ6J4x7YusP2LmJXRBo3sFoSgTCXlujYNSFvI=</dsig:DigestValue></dsig:Reference><dsig:Reference Id="etsi-data-reference-1-1" Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2"><xpf:XPath Filter="intersect" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#" xmlns:xpf="http://www.w3.org/2002/06/xmldsig-filter2">//*[@Id='etsi-signed-1-1']/etsi:QualifyingProperties/etsi:SignedProperties</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>twh9pMjAoknEfJ97w9PA8pEnVFrKb/14Mmdl6AhweE8=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>N5mPWLfwxBrJIVQEAktiZqStkManxG7P8GBE8rw5DCEB2k7OctmvlPLLy+JtQy11OVNU0ISQeJn3BprTxgU/tw==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>MIIEtTCCA52gAwIBAgIDCnQ9MA0GCSqGSIb3DQEBBQUAMIGdMQswCQYDVQQGEwJBVDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMSEwHwYDVQQLDBhhLXNpZ24tcHJlbWl1bS1tb2JpbGUtMDMxITAfBgNVBAMMGGEtc2lnbi1wcmVtaXVtLW1vYmlsZS0wMzAeFw0xMjAxMTkxMDUwNDRaFw0xNzAxMTkxMDUwNDRaMHExCzAJBgNVBAYTAkFUMRkwFwYDVQQDDBBLbGF1cyBTdHJhbmFjaGVyMRMwEQYDVQQEDApTdHJhbmFjaGVyMQ4wDAYDVQQqDAVLbGF1czEVMBMGA1UEBRMMODQ3MjA2OTQzMDIzMQswCQYDVQQMDAJESTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCl9cWMwe9LaXbcwuLCMRXS6KYhou9Fzvo7ScXpwcRn1sbTSjUIIhLUTrqfqO/pnwoKd87PmNcGUFoCXvsb4lUqjggHyMIIB7jARBgNVHQ4ECgQITPnzawkXeUUwDgYDVR0PAQH/BAQDAgbAMBMGA1UdIwQMMAqACEu4Yddf1khjMAkGA1UdEwQCMAAwfgYIKwYBBQUHAQEEcjBwMEUGCCsGAQUFBzAChjlodHRwOi8vd3d3LmEtdHJ1c3QuYXQvY2VydHMvYS1zaWduLXByZW1pdW0tbW9iaWxlLTAzYS5jcnQwJwYIKwYBBQUHMAGGG2h0dHA6Ly9vY3NwLmEtdHJ1c3QuYXQvb2NzcDBgBgNVHSAEWTBXMEsGBiooABEBFDBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3LmEtdHJ1c3QuYXQvZG9jcy9jcC9hLXNpZ24tcHJlbWl1bS1tb2JpbGUwCAYGBACLMAEBMCcGCCsGAQUFBwEDAQH/BBgwFjAIBgYEAI5GAQEwCgYIKwYBBQUHCwEwgZ0GA1UdHwSBlTCBkjCBj6CBjKCBiYaBhmxkYXA6Ly9sZGFwLmEtdHJ1c3QuYXQvb3U9YS1zaWduLXByZW1pdW0tbW9iaWxlLTAzLG89QS1UcnVzdCxjPUFUP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q/YmFzZT9vYmplY3RjbGFzcz1laWRDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MA0GCSqGSIb3DQEBBQUAA4IBAQBWEeyDzBQA5O5CY7z6K9EwbXxxuuaEEb1GVIyTZ4DcfodjkEEdGqWicsPdUUJDZ7ETyaKucgVtWaOHaObkCua9tM5TP3YtaEyDRteqU7N6LMDcMrXle8WOTUcIhSFy5UU8SnFtbZyQv+eeAW48PVq5pzBzizGNtMKCv9XC7df5ARhDEU7tYaVrKIobTdeq8D7zXnZ2Wdt96VG6QBe8eH49bAxabnOk/rF6TMO2NX4h/tlQLBzOdOeEolUHOHkA3L01REL2m/6klPNsA8mX++cD3yKuoCWxtl27peTscRyGKEo2EBLtt7mfaTFBbkdKo1WUkZ+dVesaXtKckFCEtW3r</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo><dsig:Object Id="etsi-signed-1-1"><etsi:QualifyingProperties Target="#signature-1-1" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"><etsi:SignedProperties><etsi:SignedSignatureProperties><etsi:SigningTime>2014-03-17T12:08:58Z</etsi:SigningTime><etsi:SigningCertificate><etsi:Cert><etsi:CertDigest><etsi:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><etsi:DigestValue>rUAiWR/xWih+N/Aa7AUvetg2FFU=</etsi:DigestValue></etsi:CertDigest><etsi:IssuerSerial><dsig:X509IssuerName>CN=a-sign-premium-mobile-03,OU=a-sign-premium-mobile-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName><dsig:X509SerialNumber>685117</dsig:X509SerialNumber></etsi:IssuerSerial></etsi:Cert></etsi:SigningCertificate><etsi:SignaturePolicyIdentifier><etsi:SignaturePolicyImplied/></etsi:SignaturePolicyIdentifier></etsi:SignedSignatureProperties><etsi:SignedDataObjectProperties><etsi:DataObjectFormat ObjectReference="#reference-1-1"><etsi:MimeType>text/plain</etsi:MimeType></etsi:DataObjectFormat></etsi:SignedDataObjectProperties></etsi:SignedProperties></etsi:QualifyingProperties></dsig:Object><dsig:Object Id="signed-data-1-1">Ich bin ein einfacher Text.</dsig:Object></dsig:Signature>
+</moa:XMLContent></moa:VerifySignatureEnvironment><moa:VerifySignatureLocation xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">//dsig:Signature</moa:VerifySignatureLocation></moa:VerifySignatureInfo>
+<moa:TrustProfileID>Test-TSLProfil</moa:TrustProfileID>
+</moa:VerifyXMLSignatureRequest> \ No newline at end of file
diff --git a/spss/handbook/conf/moa-spss/certstore/54A361D38F73772377E15E145772C03EC0197142/F86591A6D86718886A0234B8E54E21AAEA63E24B b/spss/handbook/conf/moa-spss/certstore/54A361D38F73772377E15E145772C03EC0197142/F86591A6D86718886A0234B8E54E21AAEA63E24B
new file mode 100644
index 000000000..2bf4ad712
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/certstore/54A361D38F73772377E15E145772C03EC0197142/F86591A6D86718886A0234B8E54E21AAEA63E24B
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/certstore/CCBA90ED697BA209AB6093FC19FB15B53EE26933/159E42D4A53599389431771D5C936552BB22B084 b/spss/handbook/conf/moa-spss/certstore/CCBA90ED697BA209AB6093FC19FB15B53EE26933/159E42D4A53599389431771D5C936552BB22B084
new file mode 100644
index 000000000..9a777fd34
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/certstore/CCBA90ED697BA209AB6093FC19FB15B53EE26933/159E42D4A53599389431771D5C936552BB22B084
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/certstore/D866A07634012B24DB601087D8B3A9FFEDF5CADB/969A71FDCC5302167A60158828B9E7862DED3B4D b/spss/handbook/conf/moa-spss/certstore/D866A07634012B24DB601087D8B3A9FFEDF5CADB/969A71FDCC5302167A60158828B9E7862DED3B4D
new file mode 100644
index 000000000..d17d07619
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/certstore/D866A07634012B24DB601087D8B3A9FFEDF5CADB/969A71FDCC5302167A60158828B9E7862DED3B4D
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/certstore/E583DB7202A8D1570A18CD11146B0CBCA438F71A/2A5945E1FC2006BE0D59C3375253C9D3327D197D b/spss/handbook/conf/moa-spss/certstore/E583DB7202A8D1570A18CD11146B0CBCA438F71A/2A5945E1FC2006BE0D59C3375253C9D3327D197D
new file mode 100644
index 000000000..a6a9acdc3
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/certstore/E583DB7202A8D1570A18CD11146B0CBCA438F71A/2A5945E1FC2006BE0D59C3375253C9D3327D197D
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/certstore/FE51079176B9F46204816CABA94824B3B14A3830/2E66C9841181C08FB1DFABD4FF8D5CC72BE08F02 b/spss/handbook/conf/moa-spss/certstore/FE51079176B9F46204816CABA94824B3B14A3830/2E66C9841181C08FB1DFABD4FF8D5CC72BE08F02
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/certstore/FE51079176B9F46204816CABA94824B3B14A3830/2E66C9841181C08FB1DFABD4FF8D5CC72BE08F02
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/log4j.properties b/spss/handbook/conf/moa-spss/log4j.properties
index 02b767b87..67bd58309 100644
--- a/spss/handbook/conf/moa-spss/log4j.properties
+++ b/spss/handbook/conf/moa-spss/log4j.properties
@@ -8,7 +8,7 @@ org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFacto
# Configure root logger and loggers for moa-spss
log4j.rootLogger=info, stdout
log4j.logger.moa.spss.server=info, moaspss
-log4j.logger.iaik.server=info, moaspss
+log4j.logger.iaik.server=warn, moaspss
# Configure the 'stdout' appender to write logging output to the console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
diff --git a/spss/handbook/conf/moa-spss/sp.minimum_with_tsl.config.xml b/spss/handbook/conf/moa-spss/sp.minimum_with_tsl.config.xml
index 79345890a..8d7541b73 100644
--- a/spss/handbook/conf/moa-spss/sp.minimum_with_tsl.config.xml
+++ b/spss/handbook/conf/moa-spss/sp.minimum_with_tsl.config.xml
@@ -119,13 +119,13 @@
</cfg:RevocationChecking>
<!-- Optionale Angabe einer TSL Konfiguration-->
<!-- Wichtig: Das WorkingDirectory muss jedenfalls den Unterordner „trust“ aus der Beispielkonfiguration beinhalten. -->
- <cfg:TSLConfiguration>
+ <!-- <cfg:TSLConfiguration>
<cfg:UpdateSchedule>
<cfg:StartTime>02:00:00</cfg:StartTime>
<cfg:Period>86400000</cfg:Period>
</cfg:UpdateSchedule>
<cfg:WorkingDirectory>tslworking</cfg:WorkingDirectory>
- </cfg:TSLConfiguration>
+ </cfg:TSLConfiguration>-->
</cfg:CertificateValidation>
</cfg:SignatureVerification>
</cfg:MOAConfiguration>
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Enc-05.20130923-20230920.SerNoFCDEE.cer b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Enc-05.20130923-20230920.SerNoFCDEE.cer
new file mode 100644
index 000000000..d17d07619
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Enc-05.20130923-20230920.SerNoFCDEE.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer
new file mode 100644
index 000000000..a6a9acdc3
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-corporate-05.20130923-20230920.SerNoFCE21.cer b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-corporate-05.20130923-20230920.SerNoFCE21.cer
new file mode 100644
index 000000000..9a777fd34
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/officialSignature/a-sign-corporate-05.20130923-20230920.SerNoFCE21.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer
new file mode 100644
index 000000000..a6a9acdc3
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-Premium-Sig-05.20130923-20230920.SerNoFCDB8.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-premium-mobile-05.20130923-20230920.SerNoFCDD4.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-premium-mobile-05.20130923-20230920.SerNoFCDD4.cer
new file mode 100644
index 000000000..2bf4ad712
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/a-sign-premium-mobile-05.20130923-20230920.SerNoFCDD4.cer
Binary files differ
diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
new file mode 100644
index 000000000..b9a0e5a61
--- /dev/null
+++ b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Root-05.20130923-20230920.SerNoFCDB4.cer
Binary files differ
diff --git a/spss/handbook/handbook/config/MOA-SPSS-config-1.5.2.xsd b/spss/handbook/handbook/config/MOA-SPSS-config-2.0.0.xsd
index 391ef4133..391ef4133 100644
--- a/spss/handbook/handbook/config/MOA-SPSS-config-1.5.2.xsd
+++ b/spss/handbook/handbook/config/MOA-SPSS-config-2.0.0.xsd
diff --git a/spss/handbook/handbook/config/config.html b/spss/handbook/handbook/config/config.html
index f44bd7dc0..3ef04f90c 100644
--- a/spss/handbook/handbook/config/config.html
+++ b/spss/handbook/handbook/config/config.html
@@ -143,7 +143,7 @@
</tr>
</table>
<h2><a name="uebersicht_zentraledatei" id="uebersicht_zentraledatei"></a>1.2 Zentrale Konfigurationsdatei</h2>
- <p>Die Konfiguration von MOA SP/SS erfolgt zentral &uuml;ber eine einzige Konfigurationsdatei. Das Format der Konfigurationsdatei ist XML und muss dem Schema <a href="./MOA-SPSS-config-1.5.2.xsd">MOA-SPSS-config-1.5.2.xsd</a> entsprechen. <a href="#konfigurationsparameter">Abschnitt 2</a> erl&auml;utert die Konfigurationsm&ouml;glichkeiten im Einzelnen.</p>
+ <p>Die Konfiguration von MOA SP/SS erfolgt zentral &uuml;ber eine einzige Konfigurationsdatei. Das Format der Konfigurationsdatei ist XML und muss dem Schema <a href="./MOA-SPSS-config-2.0.0.xsd">MOA-SPSS-config-2.0.0.xsd</a> entsprechen. <a href="#konfigurationsparameter">Abschnitt 2</a> erl&auml;utert die Konfigurationsm&ouml;glichkeiten im Einzelnen.</p>
<h3><a name="uebersicht_zentraledatei_aktualisierung" id="uebersicht_zentraledatei_aktualisierung"></a>1.2.1
Aktualisierung auf das Format von MOA SP/SS 1.3</h3>
<p>Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, &uuml;bersichtlicheres Format f&uuml;r die
diff --git a/spss/handbook/handbook/index.html b/spss/handbook/handbook/index.html
index 69edc2437..f84920d0a 100644
--- a/spss/handbook/handbook/index.html
+++ b/spss/handbook/handbook/index.html
@@ -15,7 +15,7 @@
</table>
<hr/>
<p class="title">MOA: Serversignatur (SS) und Signaturpr&uuml;fung (SP) </p>
- <p class="subtitle">&Uuml;bersicht zur Dokumentation der Version 1.5.2 </p>
+ <p class="subtitle">&Uuml;bersicht zur Dokumentation der Version 2.0.0</p>
<hr/>
<dl>
<dt><a href="./intro/intro.html">Einf&uuml;hrung</a></dt>
diff --git a/spss/handbook/handbook/install/install.html b/spss/handbook/handbook/install/install.html
index 3c3414d29..d44ce6514 100644
--- a/spss/handbook/handbook/install/install.html
+++ b/spss/handbook/handbook/install/install.html
@@ -131,7 +131,7 @@
<dt>Installation von Apache Tomcat</dt>
<dd> Installieren Sie Apache Tomcat in ein Verzeichnis, das keine Leerzeichen im Pfadnamen enth&auml;lt. Verwenden Sie bitte die zu Ihrer Java SE passende Distribution von Tomcat. Das Wurzelverzeichnis der Tomcat-Installation wird im weiteren Verlauf als <code>$CATALINA_HOME</code> bezeichnet.</dd>
<dt>Entpacken der MOA SP/SS Webservice Distribution</dt>
- <dd> Entpacken Sie die Datei <code>moa-spss-1.5.2.zip</code> in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als <code>$MOA_SPSS_INST</code> bezeichnet. </dd>
+ <dd> Entpacken Sie die Datei <code>moa-spss-2.0.0.zip</code> in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als <code>$MOA_SPSS_INST</code> bezeichnet. </dd>
<dt>Installation der Kryptographiebibliotheken von SIC/IAIK</dt>
<dd>
<p>Kopieren Sie alle Dateien aus dem Verzeichnis <code>$MOA_SPSS_INST/ext</code> in das Verzeichnis <code>$JAVA_HOME/jre/lib/ext</code>. Zus&auml;tzlich m&uuml;ssen Sie die Rechtedateien Ihrer Java SE austauschen. Laden Sie dazu die passenden <span class="term">Unlimited Strength
@@ -385,7 +385,7 @@ INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=&lt;null&gt;
<dt>Installation von Java SE</dt>
<dd>Installieren Sie Java SE in ein beliebiges Verzeichnis. Das Wurzelverzeichnis der Java SE Installation wird im weiteren Verlauf als <code>$JAVA_HOME</code> bezeichnet.</dd>
<dt>Entpacken der MOA SP/SS Klassenbibliotheks-Distribution</dt>
- <dd> Entpacken Sie die Datei <code>moa-spss-1.5.2-lib.zip</code> in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als <code>$MOA_SPSS_INST</code> bezeichnet. </dd>
+ <dd> Entpacken Sie die Datei <code>moa-spss-2.0.0-lib.zip</code> in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als <code>$MOA_SPSS_INST</code> bezeichnet. </dd>
<dt>Installation der Kryptographiebibliotheken von SIC/IAIK</dt>
<dd>
<p>Kopieren Sie alle Dateien aus dem Verzeichnis <code>$MOA_SPSS_INST/ext</code> in das Verzeichnis <code>$JAVA_HOME/jre/lib/ext</code>. Zus&auml;tzlich m&uuml;ssen Sie die Rechtedateien Ihrer Java SE austauschen. Laden Sie dazu die passenden <span class="term">Unlimited Strength
@@ -403,7 +403,7 @@ INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=&lt;null&gt;
</tr><tr>
<td>MOA SP/SS</td>
-<td>1.5.2&nbsp; </td>
+<td>2.0.0&nbsp; </td>
<td><code>moa-spss.jar</code>, <code>moa-common.jar</code></td>
</tr><tr>
<td>MOA IAIK</td>
diff --git a/spss/handbook/handbook/intro/intro.html b/spss/handbook/handbook/intro/intro.html
index 286ebb961..138ca61e8 100644
--- a/spss/handbook/handbook/intro/intro.html
+++ b/spss/handbook/handbook/intro/intro.html
@@ -30,7 +30,7 @@
<hr/>
<h1><a name="allgemeines"></a>1 Allgemeines</h1>
<p> Die Module Serversignatur (SS) und Signaturpr&uuml;fung (SP) k&ouml;nnen von Anwendungen verwendet werden, um elektronische Signaturen zu erstellen bzw. vorliegende elektronische Signaturen zu &uuml;berpr&uuml;fen.</p>
- <p>Die Funktionalit&auml;t und der Aufbau der Schnittstelle zu den beiden Modulen ist in der <a href="../spec/MOA-SPSS-1.5.2.pdf" target="_blank" class="term">Spezifikation MOA SP/SS (V1.5.2)</a> detailliert beschrieben. Da diese Spezifikation auf der <a href="http://www.buergerkarte.at/konzept/securitylayer/spezifikation/20140114/core/core.html#core" target="_blank" class="term"> Schnittstellenspezifikation des Security-Layers (V 1.2.7)</a> aufbaut, ist deren Kenntnis zum Verstehen der Schnittstellen zu SS und SP erforderlich. </p>
+ <p>Die Funktionalit&auml;t und der Aufbau der Schnittstelle zu den beiden Modulen ist in der <a href="../spec/MOA-SPSS-2.0.0.pdf" target="_blank" class="term">Spezifikation MOA SP/SS (V2.0.0)</a> detailliert beschrieben. Da diese Spezifikation auf der <a href="http://www.buergerkarte.at/konzept/securitylayer/spezifikation/20140114/core/core.html#core" target="_blank" class="term"> Schnittstellenspezifikation des Security-Layers (V 1.2.7)</a> aufbaut, ist deren Kenntnis zum Verstehen der Schnittstellen zu SS und SP erforderlich. </p>
<h1><a name="ss"></a>2 Modul Serversignatur (SS) </h1>
<p> Das Modul Serversignatur (SS) dient zum Erstellen von XML-Signaturen in Anlehnung an die <a href="http://www.buergerkarte.at/konzept/securitylayer/spezifikation/20140114/core/core.html#core" target="_blank" class="term"> Schnittstellenspezifikation des Security-Layers (V 1.2.7)</a>. Eine Signatur kann entweder rein in Software erstellt werden, oder aber unter Zuhilfenahme eines Hardware Security Modules (HSM), das den privaten Schl&uuml;ssel gesch&uuml;tzt enth&auml;lt und die Signatur berechnet.</p>
<p> Der Zugriff auf einzelne Signaturschl&uuml;ssel in MOA SS kann basierend auf dem f&uuml;r TLS-Client-Authentisierung verwendeten Zertifikat eingeschr&auml;nkt werden. </p>
diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.pdf b/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.pdf
deleted file mode 100644
index 25c0c091e..000000000
--- a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.pdf
+++ /dev/null
Binary files differ
diff --git a/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.pdf b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.pdf
new file mode 100644
index 000000000..6cf538229
--- /dev/null
+++ b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.pdf
Binary files differ
diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.wsdl b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.wsdl
index 7c1b0c438..c8bf32950 100644
--- a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.wsdl
+++ b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.wsdl
@@ -3,7 +3,7 @@
Web Service Description for MOA SP/SS 1.5
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:moa="http://reference.e-government.gv.at/namespace/moa/20020822#" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MOA" targetNamespace="http://reference.e-government.gv.at/namespace/moa/20020822#">
- <import namespace="http://reference.e-government.gv.at/namespace/moa/20020822#" location="../resources/schemas/MOA-SPSS-1.5.2.xsd"/>
+ <import namespace="http://reference.e-government.gv.at/namespace/moa/20020822#" location="../resources/schemas/MOA-SPSS-2.0.0.xsd"/>
<message name="CreateCMSSignatureInput">
<part name="body" element="moa:CreateCMSSignatureRequest"/>
</message>
diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.xsd b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.xsd
index 739b12431..739b12431 100644
--- a/spss/handbook/handbook/spec/MOA-SPSS-1.5.2.xsd
+++ b/spss/handbook/handbook/spec/MOA-SPSS-2.0.0.xsd
diff --git a/spss/handbook/handbook/usage/usage.html b/spss/handbook/handbook/usage/usage.html
index dee5a08fd..690b7120f 100644
--- a/spss/handbook/handbook/usage/usage.html
+++ b/spss/handbook/handbook/usage/usage.html
@@ -52,6 +52,7 @@
<li><a href="#webservice_xmlrequests_pruefungxml_xmldsigmanifest">Pr&uuml;fung eines XMLDSIG-Manifests</a></li>
<li><a href="#webservice_xmlrequests_pruefungxml_ergaenzungsobjekte">Erg&auml;nzungsobjekte</a></li>
<li><a href="#webservice_xmlrequests_pruefungxml_signaturmanifest">Signatur-Manifest des Security-Layers</a></li>
+ <li><a href="#webservice_xmlrequests_pruefungxml_tsl">Pr&uuml;fung gegen Trustprofil mit TSL Unterst&uuml;tzung</a></li>
</ol>
</li>
</ol>
@@ -1185,6 +1186,69 @@ Ich habe weiters ein eigenens ID-Attribut bekommen.&lt;/doc:Paragraph&gt;
&lt;/VerifyXMLSignatureResponse&gt;
</pre>
<p>Das Element<code> CertificateCheck</code> enth&auml;lt das Resultat der Zertifikatspr&uuml;fung (siehe <a href="#webservice_xmlrequests_pruefungxml_einfach">Einfaches Beispiel</a>).</p>
+<!-- TSL -->
+<h4><a name="webservice_xmlrequests_pruefungxml_tsl"></a>2.1.4.6 Pr&uuml;fung gegen Trustprofil mit TSL Unterst&uuml;tzung</h4>
+<h5>Request</h5>
+<p><code><a href="../../clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.xml" target="_blank">VerifyXMLSignatureRequest.TSL.xml</a></code> ist ein einfacher XML-Request zur Pr&uuml;fung einer XML-Signatur. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit einger&uuml;ckt und gek&uuml;rzt wurde.</p>
+<pre>
+&lt;VerifyXMLSignatureRequest xmlns=&quot;http://reference.e-government.gv.at/namespace/moa/20020822#&quot;&gt;
+ &lt;VerifySignatureInfo&gt;
+ &lt;VerifySignatureEnvironment&gt;
+ &lt;XMLContent&gt;
+ &lt;dsig:Signature Id=&quot;signature-1-1&quot; xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
+ [..]
+ &lt;/dsig:Signature&gt;
+ &lt;/XMLContent&gt;
+ &lt;/VerifySignatureEnvironment&gt;
+</pre>
+<p>Das Element <code>VerifySignatureEnvironment</code> enth&auml;lt jenes XML-Dokument, das die zu pr&uuml;fende XML-Signatur enth&auml;lt. </p>
+<pre>
+ &lt;VerifySignatureLocation
+ xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;//dsig:Signature&lt;/VerifySignatureLocation&gt;
+ &lt;/VerifySignatureInfo&gt;
+</pre>
+<p>Das Element <code>VerifySignatureLocation</code> enth&auml;lt als Text den XPath-Ausdruck zur Selektion der XML-Signatur innerhalb des zu pr&uuml;fenden XML-Dokuments. Die Auswertung des XPath-Ausdrucks muss genau ein Element <code>dsig:Signature</code> ergeben. Bitte beachten Sie, dass im Kontext des Elements <code>VerifySignatureLocation</code> alle im XPath-Ausdruck verwendeten Namespace-Pr&auml;fixe bekannt sein m&uuml;ssen (hier das Pr&auml;fix <code>dsig</code>). </p>
+<pre>
+ &lt;TrustProfileID&gt;Test-TSLProfil&lt;/TrustProfileID&gt;
+&lt;/VerifyXMLSignatureRequest&gt;
+</pre>
+<p>Das Element <code>TrustProfileID</code> schlie&szlig;lich enth&auml;lt den Bezeichner des Vertrauensprofils, gegen das die Zertifikatspr&uuml;fung von MOA SP durchgef&uuml;hrt wird. In diesem Falle muss f&uuml;r das Vertrauenprofil die TSL Unterst&uuml;tzung aktiviert sein. In der beispielhaften Konfiguration <a href="../../../conf/moa-spss/sp.minimum_with_tsl.config.xml" target="_blank">sp.minimum_with_tsl.config.xml</a> ist so eine Vertrauensprofile mit der ID Test-TSLProfil eingerichtet.</p>
+<h5>Response</h5>
+<p><code><a href="../../clients/webservice/resources/requests/VerifyXMLSignatureRequest.TSL.resp.xml" target="_blank">VerifyXMLSignatureRequest.TSL.resp.xml</a></code> ist eine typische Response des SP Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit einger&uuml;ckt und gek&uuml;rzt wurde.</p>
+<pre>
+&lt;VerifyXMLSignatureResponse
+ xmlns=&quot;http://reference.e-government.gv.at/namespace/moa/20020822#&quot;
+ xmlns:dsig=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&gt;
+ &lt;SignerInfo&gt;
+ &lt;dsig:X509Data&gt;
+ &lt;dsig:X509SubjectName&gt;T=DI,serialNumber=847206943023,givenName=Klaus,SN=Stranacher,
+ CN=Klaus Stranacher,C=AT&lt;/dsig:X509SubjectName&gt;
+ &lt;dsig:X509IssuerSerial&gt;
+ &lt;dsig:X509IssuerName&gt;CN=a-sign-premium-mobile-03,OU=a-sign-premium-mobile-03,
+ O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT&lt;/dsig:X509IssuerName&gt;
+ &lt;dsig:X509SerialNumber&gt;685117&lt;/dsig:X509SerialNumber&gt;
+ &lt;/dsig:X509IssuerSerial&gt;
+ &lt;dsig:X509Certificate&gt;...&lt;/dsig:X509Certificate&gt;
+ &lt;QualifiedCertificate/&gt;<br> &lt;SecureSignatureCreationDevice Source=&quot;Certificate&quot;/&gt;<br> &lt;IssuerCountryCode&gt;AT&lt;/IssuerCountryCode&gt;<br> &lt;/dsig:X509Data&gt;
+ &lt;/SignerInfo&gt;
+</pre>
+<p>Die Response enth&auml;lt zun&auml;chst in <code>SignerInfo/dsig:X509Data</code> Informationen &uuml;ber den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind. </p>
+<p><code>dsig:X509SubjectName</code> ist immer vorhanden und enth&auml;lt den Namen des Signators. <code>dsig:X509IssuerSerial</code> ist ebenfalls immer vorhanden und enth&auml;lt den Namen des Austellers des Signatorzertifikats (<code>dsig:X509IssuerName</code>) sowie die Seriennummer des Zertifikats (<code>dsig:X509SerialNumber</code>). Auch <code>dsig:X509Certificate</code> ist ist immer vorhanden und enth&auml;lt das Signatorzertifikat in base64 kodierter Form. </p>
+<p>Optional vorhanden ist das inhaltslose Element <code>QualifiedCertificate</code>, und zwar dann, wenn es sich beim Signatorzertifikat um ein qualifiziertes Zertifikat handelt. Optional vorhanden ist das Element <code>SecureSignatureCreationDevice</code>, und zwar dann wenn die Signatur mittels einer sicheren Signaturerstellungseinheit erzeugt wurde. Das Attribut <code>Source</code>, gibt dabei an ob diese Information &uuml;ber die entsprechende TSL (<code>Source=TSL</code>) oder &uuml;ber das Zertifikat ermittelt wurde (<code>Source=Certificate</code>). Das weitere optionale Element <code>IssuerCountryCode</code> gibt dabei den L&auml;ndercode des Zertifizierungsdiensteanbieters an, der das Signaturzertifikat ausgestellt hat. Ebenfalls optional vorhanden (nicht in diesem Beispiel) ist schlie&szlig;lich das Element <code>PublicAuthority</code>, und zwar dann, wenn das Signatorzertifikat die &ouml;sterreichspezifische Zertifikatserweiterung <a href="http://www.digitales.oesterreich.gv.at/site/cob__28513/5580/default.aspx" target="_blank">Verwaltungseigenschaft</a> aufweist. Ist in dieser Zertifikatserweiterung das Verwaltungskennzeichen mitkodiert, wird dieses Kennzeichen als Textinhalt des optionalen Elements <code>PublicAuthority/Code</code> geliefert.</p>
+<pre>
+ &lt;SignatureCheck&gt;
+ &lt;Code&gt;0&lt;/Code&gt;
+ &lt;/SignatureCheck&gt;
+</pre>
+<p> Anschlie&szlig;end an <code>SignerInfo</code> enth&auml;lt die Response mit <code>SignatureCheck/Code</code> das Resultat der kryptographischen Pr&uuml;fung der Signatur. In unserem Beispiel ist dort der Wert <code>0</code> enthalten, d. h. die Signatur konnte erfolgreich validiert werden. F&uuml;r eine &Uuml;bersicht der m&ouml;glichen Kodes siehe <a href="#sl"> Security-Layer Spezifikation</a>.</p>
+<pre>
+ &lt;CertificateCheck&gt;
+ &lt;Code&gt;0&lt;/Code&gt;
+ &lt;/CertificateCheck&gt;
+</pre>
+<p>Abschlie&szlig;end enth&auml;lt die Response mit <code>CertificateCheck/Code</code> das Resultat der Pr&uuml;fung des Signatorzertifikats. Zun&auml;chst pr&uuml;ft MOA SP, ob ausgehend vom Signatorzertifikat eine Zertifikatskette zu einem im zugeh&ouml;rigen Vertrauensprofil konfigurierten sog. <span class="term">Trust Anchor</span> gebildet werden kann. Gelingt dies, wird die G&uuml;ltigkeit jedes Zertifikats dieser Kette &uuml;berpr&uuml;ft. In unserem Beispiel enth&auml;lt <code>Code</code> den Wert <code>0</code>, d. h. MOA SP konnte die Kette bilden, und alle Zertifikate der Kette sind g&uuml;ltig. F&uuml;r eine &Uuml;bersicht der m&ouml;glichen Kodes siehe <a href="#sl"> Security-Layer Spezifikation</a>.</p>
+
+<!-- TSL -->
<h2><a name="webservice_clients" id="webservice_clients"></a>2.2 Webservice-Clients</h2>
<p><a href="#webservice_xmlrequests">Abschnitt 2.1</a> bespricht eine Reihe von typischen XML-Requests, die &uuml;ber die Webservice-Schnittstelle an MOA SP/SS gesendet werden k&ouml;nnen, um entweder Signaturen zu erstellen (MOA SS) oder Signaturen zu pr&uuml;fen (MOA SP). Dieser Abschnitt zeigt die Verwendung des prototypischen Webservice-Clients, der mit dieser Dokumentation zu MOA SP/SS ausgeliefert wird.</p>
<h3><a name="webservice_clients_übersicht" id="webservice_clients_übersicht"></a>2.2.1 &Uuml;bersicht</h3>
diff --git a/spss/handbook/moa-spss-handbook.iml b/spss/handbook/moa-spss-handbook.iml
new file mode 100644
index 000000000..0b49fc962
--- /dev/null
+++ b/spss/handbook/moa-spss-handbook.iml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="javaeeApplication" name="javaEEApplication">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="application.xml" url="file://$MODULE_DIR$/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2" />
+ </descriptors>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/spss/server/history.txt b/spss/server/history.txt
index 02419a3fa..651524419 100644
--- a/spss/server/history.txt
+++ b/spss/server/history.txt
@@ -1,16 +1,18 @@
##############
-1.5.2
+2.0.0
##############
- Signaturerstellung:
- Unterstuetzung von XAdES Version 1.4.2
- Unterstuetzung von CMS/CAdES Signaturen Version 2.2.1
-- TSL Unterstuetzung
+- Signaturpruefung:
+ - Trust-service Status List (TSL) Unterstuetzung
+- Update der Standard Trustprofile und Standard Konfigurationen
- Sicherheitsupdates
- Angabe einer Whitelist um das Aufloesen externer Referenzen von den angegebenen Quellen zu aktivieren.
- Libraries aktualisiert bzw. hinzugefuegt:
iaik-moa: Version 1.5
- iaik-tsl Version 1.0.0
+ iaik-tsl Version 1.0
##############
1.5.1
@@ -18,7 +20,7 @@
- Sicherheitsupdates
- Defaultmaessiges Deaktiveren des Aufloesens von externen Referenzen
- - Angabe einer Blacklist in der Konfiguration um den Intranetbereich zu sch�tzen, so das Aufloesen externer Referenzen aktiviert wird
+ - Angabe einer Blacklist in der Konfiguration um den Intranetbereich zu schützen, so das Aufloesen externer Referenzen aktiviert wird
- Update der Standard Trustprofile und Standard Konfigurationen
- Standard Trustprofil "OfficialSignature" fuer Amtssignaturen hinzugefuegt
- Libraries aktualisiert:
diff --git a/spss/server/moa-spss.iml b/spss/server/moa-spss.iml
new file mode 100644
index 000000000..6e02e5944
--- /dev/null
+++ b/spss/server/moa-spss.iml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/spss/server/readme.update.txt b/spss/server/readme.update.txt
index 28796ddcb..07d100272 100644
--- a/spss/server/readme.update.txt
+++ b/spss/server/readme.update.txt
@@ -1,11 +1,11 @@
======================================================================
- Update einer bestehenden MOA-SPSS-Installation auf Version 1.5.2
+ Update einer bestehenden MOA-SPSS-Installation auf Version 2.0.0
======================================================================
Es gibt zwei Moeglichkeiten (im Folgenden als "Update Variante A" und
"Update Variante B" bezeichnet), das Update von MOA-SPSS auf Version
-1.5.2 durchzufuehren. Update Variante A geht dabei den Weg ueber eine
+2.0.0 durchzufuehren. Update Variante A geht dabei den Weg ueber eine
vorangestellte Neuinstallation, waehrend Variante B direkt eine
bestehende Installation aktualisiert.
@@ -16,7 +16,7 @@ JAVA_HOME bezeichnet das Wurzelverzeichnis der JDK-Installation
CATALINA_HOME bezeichnet das Wurzelverzeichnis der Tomcat-Installation
MOA_SPSS_INST bezeichnet das Verzeichnis, in das Sie die Datei
-moa-spss-1.5.2.zip entpackt haben.
+moa-spss-2.0.0.zip entpackt haben.
=================
Update Variante A
@@ -26,9 +26,9 @@ Update Variante A
Ihrer MOA-SPSS-Installation.
2.) Erstellen Sie eine Sicherungskopie aller "iaik*.jar"-Dateien im Verzeichnis
- JAVA_HOME\jre\lib\ext, und l�schen Sie diese Dateien danach.
+ JAVA_HOME\jre\lib\ext, und loeschen Sie diese Dateien danach.
-3.) F�hren Sie eine Neuinstallation gemaess Handbuch durch.
+3.) Fuehren Sie eine Neuinstallation gemaess Handbuch durch.
4.) Kopieren Sie etwaige Konfigurationsdateien, Trust-Profile und Key-Stores,
die Sie aus Ihrer alten Installation beibehalten moechten, aus Ihrer
@@ -53,7 +53,7 @@ Update Variante B
1.) Erstellen Sie eine Sicherungskopie des kompletten Tomcat-Verzeichnisses
Ihrer MOA-SPSS-Installation.
-2.) Entpacken Sie die Datei "moa-spss-1.5.2.zip" in das Verzeichnis MOA_SPSS_INST.
+2.) Entpacken Sie die Datei "moa-spss-2.0.0.zip" in das Verzeichnis MOA_SPSS_INST.
3.) Erstellen Sie eine Sicherungskopie aller "iaik*.jar"-Dateien im Verzeichnis
JAVA_HOME\jre\lib\ext und loeschen Sie diese Dateien danach.
@@ -110,7 +110,7 @@ Update Variante B
10.) Update des Cert-Stores.
a) Kopieren Sie den Inhalt des Verzeichnisses MOA_SPSS_INST\conf\moa-spss\certstore
in das Verzeichnis CATALINA_HOME\conf\moa-spss\certstore. Wenn Sie gefragt werden, ob Sie
- vorhandene Dateien oder Unterverzeichnisse �berschreiben sollen, dann bejahen Sie das.
+ vorhandene Dateien oder Unterverzeichnisse ueberschreiben sollen, dann bejahen Sie das.
b) Falls vorhanden, loeschen Sie die Datei "890A4C8282E95EBB398685D9501486EF213941B5" aus dem
Verzeichnis CATALINA_HOME\conf\moa-spss\certstore\10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D.
@@ -123,7 +123,7 @@ Update Variante B
CATALINA_HOME\conf\moa-spss\certstore\10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D.
11.) Nur wenn alte Installation aelter als Version 1.3.0:
- Mit dem Wechsel auf Version 1.3.0 verwendet MOA SP ein neues Format f�r die
+ Mit dem Wechsel auf Version 1.3.0 verwendet MOA SP ein neues Format fuer die
XML-Konfigurationsdatei. Sie muessen die Konfigurationsdatei fuer MOA-SP aus
Ihrer alten Installation auf das neue Format konvertieren. Details dazu
finden Sie im MOA-SPSS-Installationshandbuch. \ No newline at end of file
diff --git a/spss/server/serverlib/moa-spss-lib.iml b/spss/server/serverlib/moa-spss-lib.iml
new file mode 100644
index 000000000..d1832bd65
--- /dev/null
+++ b/spss/server/serverlib/moa-spss-lib.iml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/java/at/gv/egovernment/moa/spss/api" relative="/WEB-INF" />
+ </webroots>
+ <sourceRoots>
+ <root url="file://$MODULE_DIR$/src/main/java" />
+ <root url="file://$MODULE_DIR$/src/main/resources" />
+ </sourceRoots>
+ </configuration>
+ </facet>
+ <facet type="web" name="Web2">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/test/java/test/at/gv/egovernment/moa/spss/server/iaik/config" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/test/java/test/at/gv/egovernment/moa/spss/server/iaik" relative="/WEB-INF" />
+ </webroots>
+ <sourceRoots>
+ <root url="file://$MODULE_DIR$/src/main/java" />
+ <root url="file://$MODULE_DIR$/src/main/resources" />
+ </sourceRoots>
+ </configuration>
+ </facet>
+ <facet type="web" name="Web3">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind" relative="/WEB-INF" />
+ </webroots>
+ <sourceRoots>
+ <root url="file://$MODULE_DIR$/src/main/java" />
+ <root url="file://$MODULE_DIR$/src/main/resources" />
+ </sourceRoots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="module" module-name="moa-common" scope="TEST" production-on-test="" />
+ <orderEntry type="module" module-name="moa-spss-tools" scope="TEST" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ </component>
+</module>
+
diff --git a/spss/server/serverlib/pom.xml b/spss/server/serverlib/pom.xml
index 1c756d4d4..4eb2a2218 100644
--- a/spss/server/serverlib/pom.xml
+++ b/spss/server/serverlib/pom.xml
@@ -143,16 +143,16 @@
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_tsl</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_util</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_xsect</artifactId>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
@@ -167,7 +167,7 @@
<artifactId>sqlite-jdbc</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_jsse</artifactId>
</dependency>
@@ -197,7 +197,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.2</version>
+ <version>2.9.1</version>
<configuration>
<quiet>true</quiet>
<author>false</author>
@@ -260,7 +260,7 @@
<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
<link>http://logging.apache.org/log4j/docs/api/</link>
</links>
- <target>1.4</target>
+ <target>1.5</target>
</configuration>
<executions>
<execution>
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java
index 30eed7001..6cf46c50a 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java
@@ -36,6 +36,7 @@ import org.w3c.dom.Element;
import at.gv.egovernment.moa.util.Constants;
+
import at.gv.egovernment.moa.spss.util.MessageProvider;
/**
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
index 6209d8ef9..6b3f4301f 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java
@@ -175,7 +175,7 @@ public class VerifyCMSSignatureRequestParser {
excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr);
if (excludeByteRangeToStr != null)
excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr);
-
+
return factory.createCMSDataObject(metaInfo, content, excludeByteRangeFrom, excludeByteRangeTo);
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
index 0908d88c9..3d2da8384 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
@@ -1268,6 +1268,111 @@ public class ConfigurationPartsBuilder {
}
/**
+ * Build the trust profile mapping.
+ *
+ * @return The profile ID to profile mapping.
+ */
+ public Map buildTrustProfiles()
+ {
+ Map trustProfiles = new HashMap();
+ NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_PROFILE_XPATH);
+ Element profileElem;
+
+ while ((profileElem = (Element) profileIter.nextNode()) != null)
+ {
+ String id = getElementValue(profileElem, CONF + "Id", null);
+ String trustAnchorsLocStr = getElementValue(profileElem, CONF + "TrustAnchorsLocation", null);
+ String signerCertsLocStr = getElementValue(profileElem, CONF + "SignerCertsLocation", null);
+
+ URI trustAnchorsLocURI = null;
+ try
+ {
+ trustAnchorsLocURI = new URI(trustAnchorsLocStr);
+ if (!trustAnchorsLocURI.isAbsolute()) { // make it absolute to the config file
+ trustAnchorsLocURI = new URI(configRoot_.toURL() + trustAnchorsLocStr);
+ }
+ }
+ catch (URIException e) {
+ warn("config.14", new Object[] { "uri", id, trustAnchorsLocStr }, e);
+ continue;
+ }
+ catch (MalformedURLException e)
+ {
+ warn("config.15", new Object[] {id}, e);
+ continue;
+ }
+
+ File profileDir = new File(trustAnchorsLocURI.getPath());
+ if (!profileDir.exists() || !profileDir.isDirectory()) {
+ warn("config.27", new Object[] { "uri", id });
+ continue;
+ }
+
+
+
+ if (trustProfiles.containsKey(id)) {
+ warn("config.04", new Object[] { "TrustProfile", id });
+ continue;
+ }
+
+ URI signerCertsLocURI = null;
+ if (signerCertsLocStr != null && !"".equals(signerCertsLocStr))
+ {
+ try
+ {
+ signerCertsLocURI = new URI(signerCertsLocStr);
+ if (!signerCertsLocURI.isAbsolute()) signerCertsLocURI = new URI(configRoot_.toURL() + signerCertsLocStr);
+
+ File signerCertsDir = new File(signerCertsLocURI.getPath());
+ if (!signerCertsDir.exists() || !signerCertsDir.isDirectory()) {
+ warn("config.27", new Object[] { "signerCertsUri", id });
+ continue;
+ }
+ }
+ catch (URIException e) {
+ warn("config.14", new Object[] { "signerCertsUri", id, trustAnchorsLocStr }, e);
+ continue;
+ }
+ catch (MalformedURLException e) {
+ warn("config.15", new Object[] {id}, e);
+ continue;
+ }
+ }
+
+ signerCertsLocStr = (signerCertsLocURI != null) ? signerCertsLocURI.toString() : null;
+
+ TrustProfile profile = null;
+
+ profile = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr, false, null);
+
+ trustProfiles.put(id, profile);
+
+ }
+
+ return trustProfiles;
+ }
+
+ /**
+ * checks if a trustprofile with TSL support is enabled
+ *
+ * @return true if TSL support is enabled in at least one trustprofile, else false
+ */
+ public boolean checkTrustProfilesTSLenabled()
+ {
+ NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_PROFILE_XPATH);
+ Element profileElem;
+
+ boolean tslSupportEnabled = false;
+ while ((profileElem = (Element) profileIter.nextNode()) != null) {
+ Element eutslElem = (Element) XPathUtils.selectSingleNode(profileElem, CONF + "EUTSL");
+ if (eutslElem != null) //EUTSL element found --> TSL enabled
+ tslSupportEnabled = true;
+ }
+
+ return tslSupportEnabled;
+ }
+
+ /**
* Returns the location of the certificate store.
*
* @return the location of the certificate store.
@@ -1385,6 +1490,22 @@ public class ConfigurationPartsBuilder {
Logger.warn(new LogMsg(txt));
warnings.add(txt);
}
+
+ /**
+ * Log a warning.
+ *
+ * @param messageId The message ID.
+ * @param args Additional parameters for the message.
+ * @see at.gv.egovernment.moa.spss.server.util.MessageProvider
+ */
+ private void debug(String messageId, Object[] args) {
+ MessageProvider msg = MessageProvider.getInstance();
+ String txt = msg.getMessage(messageId, args);
+
+ Logger.debug(new LogMsg(txt));
+
+ }
+
/**
* Log a debug message.
@@ -1577,31 +1698,31 @@ public class ConfigurationPartsBuilder {
public TSLConfiguration getTSLConfiguration() {
TSLConfigurationImpl tslconfiguration = new TSLConfigurationImpl();
-
+
String euTSLUrl = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "EUTSLUrl", null);
if (StringUtils.isEmpty(euTSLUrl)) {
euTSLUrl = TSLConfiguration.DEFAULT_EU_TSL_URL;
- warn("config.39", new Object[] { "EUTSL", euTSLUrl });
+ debug("config.39", new Object[] { "EUTSL", euTSLUrl });
}
String updateSchedulePeriod = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "UpdateSchedule/" + CONF + "Period" , null);
if (StringUtils.isEmpty(updateSchedulePeriod)) {
updateSchedulePeriod = TSLConfiguration.DEFAULT_UPDATE_SCHEDULE_PERIOD;
- warn("config.39", new Object[] { "UpdateSchedule/Period", updateSchedulePeriod });
+ debug("config.39", new Object[] { "UpdateSchedule/Period", updateSchedulePeriod });
}
String updateScheduleStartTime = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "UpdateSchedule/" + CONF + "StartTime", null);
if (StringUtils.isEmpty(updateScheduleStartTime)) {
updateScheduleStartTime = TSLConfiguration.DEFAULT_UPDATE_SCHEDULE_STARTTIME;
- warn("config.39", new Object[] { "UpdateSchedule/StartTime", updateScheduleStartTime });
+ debug("config.39", new Object[] { "UpdateSchedule/StartTime", updateScheduleStartTime });
}
String workingDirectoryStr = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "WorkingDirectory", null);
if (StringUtils.isEmpty(workingDirectoryStr)) {
workingDirectoryStr = TSLConfiguration.DEFAULT_WORKING_DIR;
- warn("config.39", new Object[] { "WorkingDirectory", workingDirectoryStr });
+ debug("config.39", new Object[] { "WorkingDirectory", workingDirectoryStr });
}
// convert update schedule starting time to Date object
@@ -1638,24 +1759,12 @@ public class ConfigurationPartsBuilder {
return null;
}
- File hashcache = new File(tslWorkingDir, "hashcache");
- if (!hashcache.exists()) {
- hashcache.mkdir();
- }
- if (!hashcache.isDirectory()) {
- error("config.38", new Object[] { hashcache.getAbsolutePath() });
- return null;
- }
-
- System.setProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR", hashcache.getAbsolutePath());
-// String hashcachedir = System.getProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR");
-// System.out.println("Hashcache: " + hashcachedir);
-
+
debug("TSL Konfiguration - EUTSLUrl: " + euTSLUrl);
debug("TSL Konfiguration - UpdateSchedule/Period: " + updateSchedulePeriod);
debug("TSL Konfiguration - UpdateSchedule/StartTime: " + updateScheduleStartTime);
debug("TSL Konfiguration - TSLWorkingDirectory: " + tslWorkingDir.getAbsolutePath());
- debug("TSL Konfiguration - Hashcache: " + hashcache.getAbsolutePath());
+
// set TSL configuration
tslconfiguration.setEuTSLUrl(euTSLUrl);
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
index 2cad35763..d67cbf1b4 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
@@ -347,6 +347,16 @@ public class ConfigurationProvider
try {
builder = new ConfigurationPartsBuilder(configElem, configRoot);
+ if (builder.checkTrustProfilesTSLenabled()) {
+ debug("TSL support enabled for at least one trustprofile.");
+ tslconfiguration_ = builder.getTSLConfiguration();
+ trustProfiles = builder.buildTrustProfiles(tslconfiguration_.getWorkingDirectory());
+ }
+ else {
+ tslconfiguration_ = null;
+ trustProfiles = builder.buildTrustProfiles();
+ }
+
digestMethodAlgorithmName = builder.getDigestMethodAlgorithmName();
canonicalizationAlgorithmName =
builder.getCanonicalizationAlgorithmName();
@@ -361,14 +371,14 @@ public class ConfigurationProvider
keyGroupMappings =
builder.buildKeyGroupMappings(keyGroups, ANONYMOUS_ISSUER_SERIAL);
- tslconfiguration_ = builder.getTSLConfiguration();
-
xadesVersion = builder.getXAdESVersion();
defaultChainingMode = builder.getDefaultChainingMode();
chainingModes = builder.buildChainingModes();
useAuthorityInfoAccess_ = builder.getUseAuthorityInfoAccess();
autoAddCertificates_ = builder.getAutoAddCertificates();
- trustProfiles = builder.buildTrustProfiles(tslconfiguration_.getWorkingDirectory());
+ //trustProfiles = builder.buildTrustProfiles(tslconfiguration_.getWorkingDirectory());
+
+
distributionPoints = builder.buildDistributionPoints();
enableRevocationChecking_ = builder.getEnableRevocationChecking();
maxRevocationAge_ = builder.getMaxRevocationAge();
@@ -379,6 +389,7 @@ public class ConfigurationProvider
revocationArchiveJDBCDriverClass_ = builder.getRevocationArchiveJDBCDriverClass();
+
//check TSL configuration
checkTSLConfiguration();
@@ -428,7 +439,21 @@ public class ConfigurationProvider
}
}
- private void checkTSLConfiguration() throws ConfigurationException {
+ private boolean checkTSLenableTrustprofilesExist()throws ConfigurationException {
+ boolean bTSLEnabledTPExist = false;
+ Iterator it = trustProfiles.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry pairs = (Map.Entry)it.next();
+ TrustProfile tp = (TrustProfile) pairs.getValue();
+ if (tp.isTSLEnabled())
+ bTSLEnabledTPExist = bTSLEnabledTPExist || true;
+ }
+
+ return bTSLEnabledTPExist;
+
+ }
+
+ private void checkTSLConfiguration() throws ConfigurationException {
boolean bTSLEnabledTPExist = false;
Iterator it = trustProfiles.entrySet().iterator();
while (it.hasNext()) {
@@ -449,6 +474,43 @@ public class ConfigurationProvider
throw new ConfigurationException("config.40", null);
}
+ File workingDir = new File(tslconfiguration_.getWorkingDirectory());
+ File eu_trust = new File(workingDir.getAbsolutePath() + "/trust/eu");
+ if (!eu_trust.exists()) {
+ error("config.51", new Object[] {"Verzeichnis \"trust/eu\" existiert nicht"});
+ throw new ConfigurationException("config.51", new Object[] {"Verzeichnis \"trust/eu\" existiert nicht"});
+ }
+ else {
+ File[] eutrustFiles = eu_trust.listFiles();
+ if (eutrustFiles == null) {
+ error("config.51", new Object[] {"Verzeichnis \"trust/eu\" ist leer"});
+ throw new ConfigurationException("config.51", new Object[] {"Verzeichnis \"trust/eu\" ist leer"});
+ }
+ else {
+ if (eutrustFiles.length == 0) {
+ error("config.51", new Object[] {"Verzeichnis \"trust/eu\" ist leer"});
+ throw new ConfigurationException("config.51", new Object[] {"Verzeichnis \"trust/eu\" ist leer"});
+ }
+ }
+
+ }
+
+ File hashcache = new File(tslconfiguration_.getWorkingDirectory(), "hashcache");
+ if (!hashcache.exists()) {
+ hashcache.mkdir();
+ }
+ if (!hashcache.isDirectory()) {
+ error("config.38", new Object[] { hashcache.getAbsolutePath() });
+ return;
+ }
+
+ System.setProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR", hashcache.getAbsolutePath());
+// String hashcachedir = System.getProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR");
+// System.out.println("Hashcache: " + hashcachedir);
+
+
+ Logger.debug("TSL Konfiguration - Hashcache: " + hashcache.getAbsolutePath());
+
}
@@ -759,6 +821,17 @@ public class ConfigurationProvider
Logger.info(new LogMsg(msg.getMessage(messageId, parameters)));
}
+ /**
+ * Log a debug message.
+ *
+ * @param messageId The message ID.
+ * @param parameters Additional parameters for the message.
+ * @see at.gv.egovernment.moa.spss.server.util.MessageProvider
+ */
+ private static void debug(String message) {
+ Logger.debug(message);
+ }
+
/**
* Log a warning.
*
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
index 0e5faf790..aca6f5895 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
@@ -311,6 +311,12 @@ public class CMSSignatureVerificationInvoker {
ByteArrayOutputStream contentOs = new ByteArrayOutputStream();
+ CMSDataObject dataobject = request.getDataObject();
+ BigDecimal from = dataobject.getExcludeByteRangeFrom();
+ BigDecimal to = dataobject.getExcludeByteRangeTo();
+
+ if ( (from == null) || (to == null))
+ return contentIs;
BigDecimal counter = new BigDecimal("0");
BigDecimal one = new BigDecimal("1");
@@ -318,7 +324,7 @@ public class CMSSignatureVerificationInvoker {
try {
while ((byteRead=contentIs.read()) >= 0) {
- if (inRange(counter, request.getDataObject())) {
+ if (inRange(counter, dataobject)) {
// if byte is in byte range, set byte to 0x00
contentOs.write(0);
}
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/connector/TSLConnector.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/connector/TSLConnector.java
index 07da0a998..3a004a81d 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/connector/TSLConnector.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/connector/TSLConnector.java
@@ -1,6 +1,7 @@
package at.gv.egovernment.moa.spss.tsl.connector;
import iaik.asn1.ObjectID;
+
import iaik.util._;
import iaik.util.logging._l;
import iaik.utils.RFC2253NameParser;
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/timer/TSLUpdaterTimerTask.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/timer/TSLUpdaterTimerTask.java
index 5456701c0..e06abe44d 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/timer/TSLUpdaterTimerTask.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/timer/TSLUpdaterTimerTask.java
@@ -46,7 +46,9 @@ public class TSLUpdaterTimerTask extends TimerTask {
public void run() {
try {
+ Logger.info("Start TSL Update");
update();
+ Logger.info("Finished TSL Update");
} catch (TSLEngineDiedException e) {
MessageProvider msg = MessageProvider.getInstance();
Logger.error(new LogMsg(msg.getMessage("tsl.00", null)), e);
@@ -172,33 +174,33 @@ public class TSLUpdaterTimerTask extends TimerTask {
// convert ArrayList<File> to X509Certificate[]
if (tsl_certs == null) {
- Logger.error("No certificates from TSL imported.");
- throw new TSLSearchException("No certificates from TSL imported.");
+ Logger.warn("No certificates from TSL imported.");
+ //throw new TSLSearchException("No certificates from TSL imported.");
}
+ else {
- X509Certificate[] addCertificatesTSL = new X509Certificate[tsl_certs.size()];
- Iterator itcert = tsl_certs.iterator();
- i = 0;
- File f = null;
- while(itcert.hasNext()) {
- f = (File)itcert.next();
- FileInputStream fis = new FileInputStream(f);
- X509Certificate cert = new X509Certificate(fis);
- addCertificatesTSL[i] = cert;
+ X509Certificate[] addCertificatesTSL = new X509Certificate[tsl_certs.size()];
+ Iterator itcert = tsl_certs.iterator();
+ i = 0;
+ File f = null;
+ while(itcert.hasNext()) {
+ f = (File)itcert.next();
+ FileInputStream fis = new FileInputStream(f);
+ X509Certificate cert = new X509Certificate(fis);
+ addCertificatesTSL[i] = cert;
- i++;
- fis.close();
- }
+ i++;
+ fis.close();
+ }
- Logger.debug(new LogMsg("Add " + addCertificatesTSL.length + " certificates."));
- storeUpdater.addCertificatesToTrustStores(addCertificatesTSL, tid);
- storeUpdater.addCertificatesToCertStores(addCertificatesTSL, tid);
+ Logger.debug(new LogMsg("Add " + addCertificatesTSL.length + " certificates."));
+ storeUpdater.addCertificatesToTrustStores(addCertificatesTSL, tid);
+ storeUpdater.addCertificatesToCertStores(addCertificatesTSL, tid);
- Logger.debug(new LogMsg("Add " + addCertificates.length + " certificates."));
- storeUpdater.addCertificatesToTrustStores(addCertificates, tid);
- storeUpdater.addCertificatesToCertStores(addCertificates, tid);
-
-
+ Logger.debug(new LogMsg("Add " + addCertificates.length + " certificates."));
+ storeUpdater.addCertificatesToTrustStores(addCertificates, tid);
+ storeUpdater.addCertificatesToCertStores(addCertificates, tid);
+ }
}
}
}
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/utils/TSLImportFromFileContext.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/utils/TSLImportFromFileContext.java
index f0dbd779e..492d10eda 100644
--- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/utils/TSLImportFromFileContext.java
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/tsl/utils/TSLImportFromFileContext.java
@@ -1,6 +1,7 @@
package at.gv.egovernment.moa.spss.tsl.utils;
import iaik.util.logging._l;
+
import iaik.util.logging.Log.MultiThreadLoggingGroup;
import iaik.utils.RFC2253NameParserException;
import iaik.utils.Util;
@@ -15,6 +16,7 @@ import iaik.xml.crypto.tsl.TSLOpenURIException;
import iaik.xml.crypto.tsl.TSLThreadContext;
import iaik.xml.crypto.tsl.ValidationFixupFilter;
import iaik.xml.crypto.tsl.ValidationFixupFilter.AttributeValueFixup;
+import iaik.xml.crypto.tsl.ValidationFixupFilter.DeleteAttrFixup;
import iaik.xml.crypto.tsl.ValidationFixupFilter.ElementStringValueFixup;
import iaik.xml.crypto.tsl.ValidationFixupFilter.FixedSaxLevelValidationExcption;
import iaik.xml.crypto.tsl.ValidationFixupFilter.Fixup;
@@ -97,44 +99,34 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
trustAnchorsWrongOnEuTsl_;
public TSLImportFromFileContext(
- Countries expectedTerritory,
- URL url,
- Number otherTslPointerId,
- String workingdirectory,
- boolean sqlMultithreaded,
- boolean throwExceptions,
- boolean logExceptions,
- boolean throwWarnings,
- boolean logWarnings,
- boolean nullRedundancies,
- String baseuri,
- Map <Countries, ListIterator<X509Certificate>> trustAnchorsWrongOnEuTsl,
- TSLThreadContext parentContext) {
- super(
- expectedTerritory,
- url,
- otherTslPointerId,
- workingdirectory,
- sqlMultithreaded,
- throwExceptions,
- logExceptions,
- throwWarnings,
- logWarnings,
- nullRedundancies,
- parentContext);
- baseuri_ = baseuri;
- trustAnchorsWrongOnEuTsl_ = trustAnchorsWrongOnEuTsl;
- }
-
- public List<ThrowableAndLocatorAndMitigation> getErrorsAndWarnings() {
- List<ThrowableAndLocatorAndMitigation> errorsAndWarnings = new ArrayList<ThrowableAndLocatorAndMitigation>();
- errorsAndWarnings.addAll(this.fatals_);
- errorsAndWarnings.addAll(this.faildTransactions_);
- errorsAndWarnings.addAll(this.warnings_);
-
- return errorsAndWarnings;
- }
-
+ Countries expectedTerritory,
+ URL url,
+ Number otherTslPointerId,
+ String workingdirectory,
+ boolean sqlMultithreaded,
+ boolean throwExceptions,
+ boolean logExceptions,
+ boolean throwWarnings,
+ boolean logWarnings,
+ boolean nullRedundancies,
+ String baseuri,
+ Map <Countries, ListIterator<X509Certificate>> trustAnchorsWrongOnEuTsl,
+ TSLThreadContext parentContext) {
+ super(
+ expectedTerritory,
+ url,
+ otherTslPointerId,
+ workingdirectory,
+ sqlMultithreaded,
+ throwExceptions,
+ logExceptions,
+ throwWarnings,
+ logWarnings,
+ nullRedundancies,
+ parentContext);
+ baseuri_ = baseuri;
+ trustAnchorsWrongOnEuTsl_ = trustAnchorsWrongOnEuTsl;
+ }
/* (non-Javadoc)
* @see iaik.xml.crypto.tsl.TSLImportFromFileContext#getbaseURI()
*/
@@ -142,67 +134,80 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
public String getbaseURI() {
return this.baseuri_;
}
-
+
+
+
+
//@Override
- protected RuntimeException wrapException(Throwable t, Locator l, Mitigation m) {
- return super.wrapException(t, l, m);
- }
+ protected RuntimeException wrapException(Throwable t, Locator l, Mitigation m) {
+ return super.wrapException(t, l, m);
+ }
@Override
- public synchronized void throwException(Throwable e) {
+ public
+ synchronized void throwException(Throwable e) {
if (e instanceof TSLValidationException) {
// we do not throw dom validation errors for testing
// and just collect them
wrapException(e);
-
} else if (e instanceof TSLVerificationException) {
+
+ boolean corrected = false;
// we do not throw verification errors for testing
// and just collect them
- if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NO_TSL_SIGNATURE
- .getClass().getName(), "true"))
- && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NO_TSL_SIGNATURE) {
-
- //TSL with no signature are ignored!!!!
- l.warn("TSL IS NOT SIGNED! "
- + this.expectedTerritory_.name() + " TSL ignored.");
- }
-
- if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_REFERENCE_IN_TSL_SIGNATURE
- .getClass().getName(), "true"))
- && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_REFERENCE_IN_TSL_SIGNATURE) {
- ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
- }
-
- if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_TRANSFORMS_IN_TSL_SIGNATURE
- .getClass().getName(), "true"))
- && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_TRANSFORMS_IN_TSL_SIGNATURE) {
- ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
- }
-
- if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_TRANSFORM_IN_TSL_SIGNATURE
- .getClass().getName(), "true"))
- && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_TRANSFORM_IN_TSL_SIGNATURE) {
- ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
- }
-
- if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_C14N_IN_TSL_SIGNATURE
- .getClass().getName(), "true"))
- && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_C14N_IN_TSL_SIGNATURE) {
- ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
- }
+// // NEVER DO THIS! unless you want to import TSLs without signatures.
+// if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NO_TSL_SIGNATURE
+// .getClass().getName(), "true"))
+// && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NO_TSL_SIGNATURE) {
+// ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
+// }
+//
+// if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_REFERENCE_IN_TSL_SIGNATURE
+// .getClass().getName(), "true"))
+// && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_REFERENCE_IN_TSL_SIGNATURE) {
+// ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
+// }
- wrapException(e);
+// if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_TRANSFORMS_IN_TSL_SIGNATURE
+// .getClass().getName(), "true"))
+// && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_TRANSFORMS_IN_TSL_SIGNATURE) {
+// ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
+//
+// corrected = true;
+// }
+//
+//
+// if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_TRANSFORM_IN_TSL_SIGNATURE
+// .getClass().getName(), "true"))
+// && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_TRANSFORM_IN_TSL_SIGNATURE) {
+// ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
+//
+// corrected = true;
+// }
+//
+// if (Boolean.valueOf(_.getSysProperty(TSLSecurityException.Type.NON_CONFORMANT_C14N_IN_TSL_SIGNATURE
+// .getClass().getName(), "true"))
+// && ((TSLVerificationException) e).getType() == TSLSecurityException.Type.NON_CONFORMANT_C14N_IN_TSL_SIGNATURE) {
+// ((TSLVerificationException) e).setMitigation(Mitigation.IGNORED);
+//
+// corrected = true;
+// }
+//
+// if (corrected)
+// wrapException(e);
+// else
+// super.throwException(e);
+
+ super.throwException(e);
} else if (e instanceof FileNotFoundException) {
// we do not stop and continue processing
wrapException(e);
-
} else if (e instanceof IllegalArgumentException) {
// we do not stop and continue processing
wrapException(e);
-
} else {
// all other errors are treated as per default
super.throwException(e);
@@ -221,9 +226,6 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
if(
e instanceof FixedSaxLevelValidationExcption &&
enclosingMethod.getDeclaringClass().equals(ValidationFixupFilter.class)){
-
-
-
wrapException(e,
((LocatorAspect) e).getLocator(),
new FixedValidationMitigation("Performed SAX Level Fixup."));
@@ -247,7 +249,7 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
if (parameters[0] instanceof DOMError) {
DOMError domError = (DOMError) parameters[0];
- l.info(""+domError.getRelatedData());
+ _l.warn(""+domError.getRelatedData());
// domError.getRelatedData().getClass().getField("")
@@ -308,6 +310,7 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
}
});
return mitigatedResult;
+
}
}
@@ -378,11 +381,43 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
}
}
- l.error("Ignoring download error using old: " + parameters[0], null);
+ _l.err("Ignoring download error using old: " + parameters[0], null);
wrapException(e);
return parameters[1];
}
+// if (
+// expectedTerritory_ == Countries.PL &&(
+// (e.getCause() instanceof java.io.EOFException ||
+// e.getCause() instanceof iaik.security.ssl.SSLException) &&
+// parameters[0] instanceof URL &&
+// ((URL)parameters[0]).getProtocol().equalsIgnoreCase("https")
+// )){
+// File f = null;
+// System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
+// TLS.register("TLSv1");
+// try {
+// f = (File) enclosingMethod.invoke(thisObject, parameters);
+// } catch (IllegalAccessException e1) {
+// wrapException(e1);
+// } catch (InvocationTargetException e1) {
+// wrapException(e1);
+// }
+//
+// // System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", null);
+// TLS.register();
+//
+// if (f != null){
+// wrapException(e, null, new Mitigation() {
+// @Override
+// public String getReport() {
+// return "Trying TLSv1 and sun.security.ssl.allowUnsafeRenegotiation=true";
+// }
+// });
+// return f;
+// }
+// }
+
if (
e instanceof TSLSecurityException &&
enclosingMethod.getDeclaringClass().equals(TSLContext.class) &&
@@ -406,14 +441,14 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
wrapException(e1);
}
wrapException(e, getLocator(),
- new iaik.xml.crypto.tsl.ex.SeverityAspect.Mitigation(){
- @Override
- public String getReport() {
- return "make an exception for " + expectedTerritory_ + " who have the wrong certificate in " +
- "the EU TSL and allow the certificate " +
- parameters[1];
- }
- });
+ new iaik.xml.crypto.tsl.ex.SeverityAspect.Mitigation(){
+ @Override
+ public String getReport() {
+ return "make an exception for " + expectedTerritory_ + " who have the wrong certificate in " +
+ "the EU TSL and allow the certificate " +
+ parameters[1];
+ }
+ });
return null;
}
X509Certificate crt = (X509Certificate)parameters[1];
@@ -530,47 +565,45 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
}
}
-// //TODO: CONSIDER, IF WE REALLY WANT THIS PART OF CODE!
-// //ugly hack to accept a certificate which uses a crazy X509SubjectName!!
-// if ( expectedTerritory_ == Countries.DK &&
-// e instanceof KeySelectorException &&
-// parameters[0] instanceof X509DataImpl){
-// if (e.getMessage().equals("KeyInfo X509SubjectName (CN=Adam Arndt Digst,serialNumber=CVR:34051178-RID:25902029,O=Digitaliseringsstyrelsen // CVR:34051178,C=DK) does not match SubjectDN (serialNumber=CVR:34051178-RID:25902029+CN=Adam Arndt Digst,O=Digitaliseringsstyrelsen // CVR:34051178,C=DK) of KeyInfo X509Certificate.\n"+
-// "Any X509IssuerSerial, X509SKI, and X509SubjectName elements that appear MUST refer to the certificate or certificates containing the validation key.")) {
-//
-// X509DataImpl x509DataImpl = (X509DataImpl) parameters[0];
-//
-// Node child = x509DataImpl.getNode().getFirstChild().getNextSibling();
-// Node child1 = x509DataImpl.getNode().getFirstChild();
-//
-// x509DataImpl.getNode().removeChild(child);
-// x509DataImpl.getNode().removeChild(child1);
-//
-//
-// parameters[0] = (X509Data) x509DataImpl
-//
-// Object mitigatedResult = null;
-// try {
-//
-// mitigatedResult = enclosingMethod.invoke(thisObject, parameters);
-// } catch (IllegalAccessException e1) {
-// wrapException(e1);
-// } catch (InvocationTargetException e1) {
-// wrapException(e1);
-// }
-//
-// if (mitigatedResult != null){
-// wrapException(e, null, new Mitigation(null) {
-// @Override
-// public String getReport() {
-// return "Deleted wrong X509SubjectName from XMLDSIG Signature.";
-// }
-// });
-// return mitigatedResult;
-// }
-// }
-// }
-
+ if ( expectedTerritory_ == Countries.DK &&
+ e instanceof KeySelectorException &&
+ parameters[0] instanceof X509DataImpl){
+ if (e.getMessage().equals("KeyInfo X509SubjectName (CN=Adam Arndt Digst,serialNumber=CVR:34051178-RID:25902029,O=Digitaliseringsstyrelsen // CVR:34051178,C=DK) does not match SubjectDN (serialNumber=CVR:34051178-RID:25902029+CN=Adam Arndt Digst,O=Digitaliseringsstyrelsen // CVR:34051178,C=DK) of KeyInfo X509Certificate.\n"+
+ "Any X509IssuerSerial, X509SKI, and X509SubjectName elements that appear MUST refer to the certificate or certificates containing the validation key.")) {
+
+ X509DataImpl x509DataImpl = (X509DataImpl) parameters[0];
+
+ ListIterator li = x509DataImpl.getContent().listIterator();
+ li.next();
+ String sn = (String) li.next();
+
+ _l.err(sn, null);
+
+ System.exit(1);
+
+ Object mitigatedResult = null;
+ try {
+
+ mitigatedResult = enclosingMethod.invoke(thisObject, parameters);
+ } catch (IllegalAccessException e1) {
+ wrapException(e1);
+ } catch (InvocationTargetException e1) {
+ wrapException(e1);
+ }
+
+ if (mitigatedResult != null){
+ wrapException(e, null, new iaik.xml.crypto.tsl.ex.SeverityAspect.Mitigation() {
+ @Override
+ public String getReport() {
+ return "Deleted wrong X509SubjectName from XMLDSIG Signature.";
+ }
+ });
+ return mitigatedResult;
+
+ }
+ }
+ }
+
} else {
if (e instanceof MitigatedTSLSecurityException){
@@ -578,7 +611,6 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
// and collect them
wrapException(e);
return null;
-
} else if (e instanceof FixedSaxLevelValidationExcption) {
// we allow to mitigate Sax Level Fixup for testing
// and collect them
@@ -607,7 +639,11 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
if(expectedTerritory_ == Countries.EL){
//fix the whitespace in Greece TSL
status = status.trim();
- }
+ }
+ if (status != null && status.startsWith("http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/")) {
+ status = status.substring("http://uri.etsi.org/TrstSvc/TrustedList/Svcstatus/".length());
+ }
+
return super.compressStatus(status);
}
@@ -625,6 +661,37 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
@Override
public iaik.xml.crypto.tsl.ValidationFixupFilter.Fixup getSaxLevelValidationFixup(SAXParseException e) {
+ if (expectedTerritory_ == Countries.AT){
+ if (e.getMessage().equals("cvc-type.3.1.1: Element 'tsl:URI' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'xml:lang' was found.")){
+ return new DeleteAttrFixup("http://www.w3.org/XML/1998/namespace","lang", e, this);
+ }
+ }
+
+ if (expectedTerritory_ == Countries.CZ){
+ if (e.getMessage().equals("cvc-type.3.1.1: Element 'tsl:URI' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'xml:lang' was found.")){
+ return new DeleteAttrFixup("http://www.w3.org/XML/1998/namespace","lang", e, this);
+ }
+ }
+
+ if (expectedTerritory_ == Countries.FR){
+ if (e.getMessage().equals("cvc-type.3.1.1: Element 'tsl:URI' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'xml:lang' was found.")){
+ return new DeleteAttrFixup("http://www.w3.org/XML/1998/namespace","lang", e, this);
+ }
+ }
+
+ if (expectedTerritory_ == Countries.NO){
+ if (e.getMessage().equals("cvc-type.3.1.1: Element 'tsl:URI' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'xml:lang' was found.")){
+ return new DeleteAttrFixup("http://www.w3.org/XML/1998/namespace","lang", e, this);
+ }
+ }
+
+ if (expectedTerritory_ == Countries.SK){
+ if (e.getMessage().equals("cvc-type.3.1.1: Element 'tsl:URI' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'xml:lang' was found.")){
+ return new DeleteAttrFixup("http://www.w3.org/XML/1998/namespace","lang", e, this);
+ }
+ }
+
+
if (expectedTerritory_ == Countries.ES && getDownloadLocation().toString().contains(".es/")){
if (e.getMessage().equals("cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tslx:CertSubjectDNAttributeType'.")){
return new LocalNameFixup("CertSubjectDNAttributeType","CertSubjectDNAttribute",e, this);
@@ -734,7 +801,7 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
String msg = e.getMessage();
- l.info(msg);
+ _l.info(msg);
return(
msg.startsWith("["+SQLiteErrorCode.SQLITE_CONSTRAINT.name()+"]") &&
msg.contains("column " + DbTables.TSLDownload.C.rawHash + " is not unique")
@@ -748,7 +815,7 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
@Override
protected long howLongWaitForThreads() {
// TODO Auto-generated method stub
- return 10000;
+ return 100000;
}
@Override
@@ -768,7 +835,7 @@ public class TSLImportFromFileContext extends iaik.xml.crypto.tsl.TSLImportFromF
synchronized (log) {
parentContext_.print("<" + ncName + " state=\"" + currentThread.getState()
+ "\" " + " id=\"" + currentThread.getId() + "\">\n" + log.toString() + "</"
- + ncName + ">\n");
+ + ncName + ">" + _.LB);
parentContext_.flushLog();
log.setLength(0);
}
diff --git a/spss/server/serverlib/src/main/resources/resources/properties/spss_messages_de.properties b/spss/server/serverlib/src/main/resources/resources/properties/spss_messages_de.properties
index e4ee607c0..9e2e0e490 100644
--- a/spss/server/serverlib/src/main/resources/resources/properties/spss_messages_de.properties
+++ b/spss/server/serverlib/src/main/resources/resources/properties/spss_messages_de.properties
@@ -159,6 +159,7 @@ config.46=Start periodical TSL update task at {0} and then every {1} millisecond
config.48=No whitelisted URIs given.
config.49=Whitelisted URI: {0}.
config.50=Fehler beim Erstellen des TSL Vertrauensprofils: Das Verzeichnis ({0}) ist kein Verzeichnis.
+config.51=Fehler beim Erstellen der TSL Konfiguration: TSL-Arbeitsverzeichnis ist fehlerhaft ({0}).
handler.00=Starte neue Transaktion: TID={0}, Service={1}
handler.01=Aufruf von Adresse={0}
diff --git a/spss/server/serverws/moa-spss-ws.iml b/spss/server/serverws/moa-spss-ws.iml
new file mode 100644
index 000000000..0714500d5
--- /dev/null
+++ b/spss/server/serverws/moa-spss-ws.iml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ <root url="file://$MODULE_DIR$/resources/wsdl" relative="resources/schemas" />
+ <root url="file://$MODULE_DIR$/../../handbook" relative="WEB-INF" />
+ </webroots>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="moa-spss-lib" />
+ <orderEntry type="library" name="Maven: axis:axis:1.0_IAIK" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-jaxrpc:1.4" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.axis:axis-saaj:1.4" level="project" />
+ <orderEntry type="library" name="Maven: axis:axis-wsdl4j:1.5.1" level="project" />
+ <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
+ <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+ <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: postgresql:postgresql:7.2" level="project" />
+ <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xerces:xercesImpl:2.9.0" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:xml-apis:2.7.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xalan-bin-dist:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ixsil:1.2.2.5" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_cms:4.1_MOA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Provider:1.2.4" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: iaik.prod:iaik_Pkcs11Wrapper:1.2.17" level="project" />
+ <orderEntry type="module" module-name="moa-common" />
+ <orderEntry type="library" name="Maven: jaxen:jaxen:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: saxpath:saxpath:1.0-FCS" level="project" />
+ <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.5" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_tsl:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_xsect_eval:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ecc_signed:2.19" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jce_eval_signed:3.181" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_pki_module:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_javax_crypto:1.0" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_jsse:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:iaik_ssl:4.4" level="project" />
+ <orderEntry type="library" name="Maven: iaik:w3c_http:1.0" level="project" />
+ <orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.7.8-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.6" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_util:0.23" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_xsect:1.1709142" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jsse:4.4" level="project" />
+ </component>
+</module>
+
diff --git a/spss/server/serverws/pom.xml b/spss/server/serverws/pom.xml
index b8a04eba4..76319b676 100644
--- a/spss/server/serverws/pom.xml
+++ b/spss/server/serverws/pom.xml
@@ -17,12 +17,26 @@
<repositoryPath>${basedir}/../../../repository</repositoryPath>
</properties>
+
+ <repositories>
+ <repository>
+ <id>JBoss IAIK</id>
+ <url>http://nexus.iaik.tugraz.at/nexus/content/repositories/nexus/</url>
+ <!-- <releases><enabled>true</enabled></releases> -->
+ </repository>
+ <repository>
+ <id>IAIK libs</id>
+ <url>http://nexus.iaik.tugraz.at/nexus/content/repositories/iaik/</url>
+ <!-- <releases><enabled>true</enabled></releases> -->
+ </repository>
+ </repositories>
+
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.1.1</version>
+ <version>2.3</version>
<!-- <version>2.0.2</version>-->
<configuration>
<archive>
@@ -70,7 +84,7 @@
<artifactId>iaik_ixsil</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_tsl</artifactId>
</dependency>
<dependency>
@@ -78,12 +92,12 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_util</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_xsect</artifactId>
+ <groupId>iaik</groupId>
+ <artifactId>iaik_xsect_eval</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
@@ -98,13 +112,10 @@
<artifactId>sqlite-jdbc</artifactId>
</dependency>
<dependency>
- <groupId>iaik.prod</groupId>
+ <groupId>iaik</groupId>
<artifactId>iaik_jsse</artifactId>
- </dependency>
- <dependency>
- <groupId>iaik.prod</groupId>
- <artifactId>iaik_util</artifactId>
- </dependency>
+ </dependency>
+
<!-- transitive dependencies we don't want to include into the war -->
<dependency>
<groupId>iaik.prod</groupId>
diff --git a/spss/server/tools/moa-spss-tools.iml b/spss/server/tools/moa-spss-tools.iml
new file mode 100644
index 000000000..25d80b1dd
--- /dev/null
+++ b/spss/server/tools/moa-spss-tools.iml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_moa:1.5" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_jce_full:5.101" level="project" />
+ <orderEntry type="library" name="Maven: iaik.prod:iaik_ecc:2.19" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ <orderEntry type="library" name="Maven: xalan-bin-dist:xalan:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
+ <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
+ <orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" />
+ </component>
+</module>
+
diff --git a/spss/server/tools/pom.xml b/spss/server/tools/pom.xml
index 48e0a998c..503c49545 100644
--- a/spss/server/tools/pom.xml
+++ b/spss/server/tools/pom.xml
@@ -25,6 +25,10 @@
<scope>compile</scope>
</dependency>
-->
+
+
+
+
<dependency>
<groupId>iaik.prod</groupId>
<artifactId>iaik_moa</artifactId>
@@ -52,6 +56,10 @@
</dependency>
</dependencies>
+
+
+
+
<build>
<plugins>
<plugin>
@@ -63,6 +71,16 @@
</archive>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
</plugins>
</build>
+
</project>
diff --git a/spss/server/tools/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java b/spss/server/tools/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java
index 0c144ce73..d334501d2 100644
--- a/spss/server/tools/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java
+++ b/spss/server/tools/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java
@@ -60,7 +60,7 @@ public class CertTool {
/** Error message if the DN cannot be parsed according to RFC2253. */
private static final String ILLEGAL_RFC2253_NAME =
- "Kein gültiger RFC2253-Name";
+ "Kein gültiger RFC2253-Name";
/**
* Main entry point of the tool.
@@ -163,7 +163,7 @@ public class CertTool {
certStore.storeCertificate(cert, null);
- System.out.println("\nDas Zertifikat wurde erfolreich hinzugefügt.\n");
+ System.out.println("\nDas Zertifikat wurde erfolreich hinzugef�gt.\n");
} catch (FileNotFoundException e) {
System.err.println("Zertifikat nicht gefunden: " + certFile);
@@ -175,10 +175,10 @@ public class CertTool {
"Fehler beim Lesen des Zertifikats: " + e.getMessage());
} catch (DirectoryStoreException e) {
System.err.println(
- "Fehler beim Öffnen des Zertifikatsspeichers: " + e.getMessage());
+ "Fehler beim Öffnen des Zertifikatsspeichers: " + e.getMessage());
} catch (CertStoreException e) {
System.err.println(
- "Fehler beim Hinzufügen des Zertifikats: " + e.getMessage());
+ "Fehler beim Hinzufügen des Zertifikats: " + e.getMessage());
} catch (Throwable t) {
System.err.println("Allgemeiner Fehler: " + t.getMessage());
t.printStackTrace();